https://github.com/james-see/iptcinfo3
iptcinfo working for python 3 finally do pip3 install iptcinfo3
https://github.com/james-see/iptcinfo3
exif iptc metadata photography python3
Last synced: 3 months ago
JSON representation
iptcinfo working for python 3 finally do pip3 install iptcinfo3
- Host: GitHub
- URL: https://github.com/james-see/iptcinfo3
- Owner: james-see
- License: other
- Created: 2016-10-13T18:29:30.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-12-02T17:55:46.000Z (6 months ago)
- Last Synced: 2025-12-13T03:06:30.467Z (6 months ago)
- Topics: exif, iptc, metadata, photography, python3
- Language: Python
- Homepage: https://james-see.github.io/iptcinfo3
- Size: 3.64 MB
- Stars: 56
- Watchers: 4
- Forks: 34
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
``IPTCINFO 3``
==============
Like IPTCInfo but finally compatible for Python 3
-------------------------------------------------
Ported from Josh Carter's Perl IPTCInfo-1.9.pm by Tamas Gulacsi
Ever wish you add information to your photos like a caption, the place
you took it, the date, and perhaps even keywords and categories? You
already can. The `International Press Telecommunications Council (IPTC) `_
defines a format for exchanging meta-information in news content, and
that includes photographs. You can embed all kinds of information in
your images. The trick is putting it to use.
That's where this IPTCInfo Python module comes into play. You can embed
information using many programs, including Adobe Photoshop, and
IPTCInfo will let your web server -- and other automated server
programs -- pull it back out. You can use the information directly in
Python programs, export it to XML, or even export SQL statements ready
to be fed into a database.
Wikidata item https://www.wikidata.org/wiki/Q137179516
Installation
------------
Install from PyPI::
pip install IPTCInfo3
Or with uv::
uv pip install IPTCInfo3
On Gentoo Linux: on `gentoo-zh overlay `_.
Requirements
------------
- Python 3.8 or higher
- No external dependencies required
Usage
-----
``from iptcinfo3 import IPTCInfo``
Create new info object
``info = IPTCInfo('doge.jpg')``
Print list of keywords, supplemental categories, contacts
``print(info['keywords'])``
``print(info['supplementalCategories'])``
``print(info['contacts'])``
Get specific attributes...
``caption = info['caption/abstract']``
Create object for file that may not have IPTC data
``info = IPTCInfo('such_iptc.jpg', force=True)``
Add/change an attribute
``info['caption/abstract'] = 'Witty caption here'``
``info['supplemental category'] = ['portrait']``
Lists for keywords, so you can just append!
``info['keywords']).append('cool')``
Save new info to file
``info.save()``
``info.save_as('very_meta.jpg')``
For real life usage example see https://gitlab.com/vitaly-zdanevich/upload_to_commons_with_categories_from_iptc/-/blob/master/upload_to_commons_with_categories_from_iptc.py