IPTCInfo3 2.2.0__tar.gz → 2.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,15 @@
1
+ ## 2.3.0 (2025-12-02)
2
+
3
+ ### Bug Fixes
4
+ - **Issue #50**: Fixed keywords and other list fields to prevent duplicate values (deduplicates on append and save)
5
+ - **Issue #45**: Removed outdated VERSION = 1.9 comment from code
6
+
7
+ ### New Features
8
+ - **Issue #44**: Added LICENSE file with dual Artistic-1.0 / GPL-1.0+ license
9
+ - Added `UniqueList` class for list fields that automatically prevents duplicates
10
+
11
+ ---
12
+
1
13
  ## 2.2.0 (2025-10-02)
2
14
 
3
15
  ### Bug Fixes
@@ -15,6 +27,13 @@
15
27
  - **Issue #38**: Verified backup file behavior (use `options={'overwrite': True}` to avoid ~ files)
16
28
  - Better error handling and logging throughout
17
29
 
30
+ ### Build System Modernization
31
+ - Migrated from legacy `setup.py` to modern `pyproject.toml`
32
+ - Now uses `uv` and `hatchling` for building (PEP 517/518 compliant)
33
+ - Simplified setup.py to minimal backward compatibility shim
34
+ - Added comprehensive publishing guide (`PUBLISHING.md`)
35
+ - Supports Python 3.8 through 3.13
36
+
18
37
  ### Notes
19
38
  - **Issue #39, #41**: Ready for PyPI release with all fixes from master branch
20
39
 
@@ -0,0 +1,20 @@
1
+ IPTCInfo3 - IPTC metadata extraction and modification for Python
2
+
3
+ Copyright (C) 2000-2004 Josh Carter <josh@multipart-mixed.com>
4
+ Copyright (C) 2004-2008 Tamas Gulacsi <gthomas@gthomas.hu>
5
+ Copyright (C) 2008-2025 James Campbell
6
+
7
+ DUAL LICENSE
8
+
9
+ This software is dual-licensed. You may choose either:
10
+
11
+ 1. The Artistic License 1.0
12
+ https://opensource.org/licenses/Artistic-1.0
13
+
14
+ 2. The GNU General Public License v1.0 or later
15
+ https://www.gnu.org/licenses/old-licenses/gpl-1.0.en.html
16
+
17
+ You may use, modify, and distribute this software under the terms of
18
+ either license, at your option.
19
+
20
+ Full license texts available at the URLs above.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: IPTCInfo3
3
- Version: 2.2.0
3
+ Version: 2.3.0
4
4
  Summary: Extract and modify IPTC metadata from JPEG images
5
5
  Project-URL: Homepage, https://github.com/jamesacampbell/iptcinfo3
6
6
  Project-URL: Repository, https://github.com/jamesacampbell/iptcinfo3
@@ -8,6 +8,7 @@ Project-URL: Issues, https://github.com/jamesacampbell/iptcinfo3/issues
8
8
  Author-email: Tamas Gulacsi <gthomas@fw.hu>
9
9
  Maintainer-email: James Campbell <jc@normail.co>
10
10
  License: Artistic-1.0 OR GPL-1.0-or-later
11
+ License-File: LICENSE
11
12
  Keywords: exif,iptc,jpeg,metadata,photography
12
13
  Classifier: Development Status :: 4 - Beta
13
14
  Classifier: Intended Audience :: Developers
@@ -33,8 +34,6 @@ Description-Content-Type: text/x-rst
33
34
  ``IPTCINFO 3``
34
35
  ==============
35
36
 
36
- `Build Status <https://api.travis-ci.org/crccheck/iptcinfo3.png>`_
37
-
38
37
  Like IPTCInfo but finally compatible for Python 3
39
38
  -------------------------------------------------
40
39
 
@@ -55,6 +54,23 @@ programs -- pull it back out. You can use the information directly in
55
54
  Python programs, export it to XML, or even export SQL statements ready
56
55
  to be fed into a database.
57
56
 
57
+ Installation
58
+ ------------
59
+
60
+ Install from PyPI::
61
+
62
+ pip install IPTCInfo3
63
+
64
+ Or with uv::
65
+
66
+ uv pip install IPTCInfo3
67
+
68
+ Requirements
69
+ ------------
70
+
71
+ - Python 3.8 or higher
72
+ - No external dependencies required
73
+
58
74
  Usage
59
75
  -----
60
76
 
@@ -1,8 +1,6 @@
1
1
  ``IPTCINFO 3``
2
2
  ==============
3
3
 
4
- `Build Status <https://api.travis-ci.org/crccheck/iptcinfo3.png>`_
5
-
6
4
  Like IPTCInfo but finally compatible for Python 3
7
5
  -------------------------------------------------
8
6
 
@@ -23,6 +21,23 @@ programs -- pull it back out. You can use the information directly in
23
21
  Python programs, export it to XML, or even export SQL statements ready
24
22
  to be fed into a database.
25
23
 
24
+ Installation
25
+ ------------
26
+
27
+ Install from PyPI::
28
+
29
+ pip install IPTCInfo3
30
+
31
+ Or with uv::
32
+
33
+ uv pip install IPTCInfo3
34
+
35
+ Requirements
36
+ ------------
37
+
38
+ - Python 3.8 or higher
39
+ - No external dependencies required
40
+
26
41
  Usage
27
42
  -----
28
43
 
@@ -14,7 +14,6 @@
14
14
  # it under the terms of the Artistic License or the GNU General Public
15
15
  # License (GPL). You may choose either license.
16
16
  #
17
- # VERSION = '1.9';
18
17
  """
19
18
  IPTCInfo - Python module for extracting and modifying IPTC image meta-data
20
19
  """
@@ -27,7 +26,7 @@ import tempfile
27
26
  from struct import pack, unpack
28
27
  import json
29
28
 
30
- __version__ = '2.2.0'
29
+ __version__ = '2.3.0'
31
30
  __author__ = 'Gulácsi, Tamás'
32
31
  __updated_by__ = 'Campbell, James'
33
32
 
@@ -524,6 +523,17 @@ c_charset = {100: 'iso8859_1', 101: 'iso8859_2', 109: 'iso8859_3',
524
523
  c_charset_r = {v: k for k, v in c_charset.items()}
525
524
 
526
525
 
526
+ class UniqueList(list):
527
+ """A list that prevents duplicate values on append/extend."""
528
+ def append(self, value):
529
+ if value not in self:
530
+ super().append(value)
531
+
532
+ def extend(self, values):
533
+ for v in values:
534
+ self.append(v)
535
+
536
+
527
537
  class IPTCData(dict):
528
538
  """Dict with int/string keys from c_listdatanames"""
529
539
  def __init__(self, diction={}, *args, **kwds):
@@ -608,9 +618,9 @@ class IPTCInfo:
608
618
 
609
619
  def __init__(self, fobj, force=False, inp_charset=None, out_charset=None):
610
620
  self._data = IPTCData({
611
- 'supplemental category': [],
612
- 'keywords': [],
613
- 'contact': [],
621
+ 'supplemental category': UniqueList(),
622
+ 'keywords': UniqueList(),
623
+ 'contact': UniqueList(),
614
624
  })
615
625
  self._fobj = fobj
616
626
  self._force = force
@@ -956,10 +966,11 @@ class IPTCInfo:
956
966
  out.append(pack("!BBBH", tag, record, dataset, len(value)))
957
967
  out.append(value)
958
968
  else:
969
+ seen = set()
959
970
  for v in map(bytes, value):
960
- if v is None or len(v) == 0:
971
+ if v is None or len(v) == 0 or v in seen:
961
972
  continue
962
-
973
+ seen.add(v)
963
974
  out.append(pack("!BBBH", tag, record, dataset, len(v)))
964
975
  out.append(v)
965
976
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "IPTCInfo3"
7
- version = "2.2.0"
7
+ version = "2.3.0"
8
8
  description = "Extract and modify IPTC metadata from JPEG images"
9
9
  readme = "README.rst"
10
10
  license = { text = "Artistic-1.0 OR GPL-1.0-or-later" }
File without changes