Read and write IPTC photo metadata in Python. Pure Python, zero dependencies, tested on every release from 3.10 to 3.15.
IPTCInfo3 is a Python library for reading and modifying IPTC metadata in JPEG images. The International Press Telecommunications Council (IPTC) defines a format for exchanging meta-information in news content, including photographs. This library lets you embed and extract information like captions, keywords, copyright notices, creator credits, document IDs, and more β no external dependencies required.
# Using pip
pip install IPTCInfo3
# Using uv (recommended)
uv pip install IPTCInfo3
Requirements: Python 3.10 or higher, no external dependencies required.
Extract and modify IPTC metadata β keywords, captions, copyright, creator, document IDs β programmatically.
Tested on Python 3.10 through 3.15 on every commit via a CI matrix. Drops EOL interpreters.
International characters with proper charset handling, including ISO 2022 escape sequences and UTF-8.
Full IIM Application Record coverage: core photo fields plus audio, document ID, and workflow fields.
creator, credit, and destination work out of the box, matching exiftool and gThumb conventions.
Pure-Python implementation using only the standard library. No duplicate list entries, safe saves with optional backups.
from iptcinfo3 import IPTCInfo
# Open an image file
info = IPTCInfo('photo.jpg')
# Read metadata
print(info['caption/abstract'])
print(info['keywords'])
print(info['copyright notice'])
print(info['creator']) # alias for 'by-line'
from iptcinfo3 import IPTCInfo
# Open or create IPTC info (force=True for files without IPTC data)
info = IPTCInfo('photo.jpg', force=True)
# Set metadata
info['caption/abstract'] = 'A beautiful sunset over the mountains'
info['keywords'] = ['sunset', 'mountains', 'landscape']
info['copyright notice'] = 'Β© 2026 Your Name'
info['creator'] = 'Your Name'
# Save changes
info.save()
# Or save to a new file
info.save_as('photo_with_metadata.jpg')
# Specify input and output charsets
info = IPTCInfo('photo.jpg', inp_charset='utf8', out_charset='utf8')
# ISO 2022 escape sequences (including UTF-8 ESC % G)
# are recognised automatically
IPTCInfo3 covers the IIM Application Record. Commonly used fields:
| Field Name | Description | Type |
|---|---|---|
object name |
Title or name of the image | String |
caption/abstract |
Description of the image content | String |
keywords |
Searchable keywords (duplicates prevented) | List |
creator2.3.2+ |
Creator/photographer (alias for by-line) |
String |
by-line |
Creator/photographer name | String |
credit line |
Credit/provider information (IPTC Core 1.1) | String |
copyright notice |
Copyright information | String |
headline |
Headline of the content | String |
city |
City where photo was taken | String |
country/primary location name |
Country name | String |
job id2.4.0+ |
Job identifier | String |
unique document id2.4.0+ |
Globally unique document identifier | String |
document notes2.4.0+ |
Workflow / document notes | String |
destination |
Destination/transmission reference (alias) | String |
v2.4.0 also added the audio block (audio type, audio duration, β¦), object type reference, classify state, catalog sets, and more. See the changelog for the full list.
creator alias for by-line per IPTC Core β info['creator'] now works for reading and writingSyntaxWarning in file_is_jpeg() and the pytest config so bare pytest collects testsimport os
from iptcinfo3 import IPTCInfo
# Process all JPEG files in a directory
for filename in os.listdir('photos'):
if filename.lower().endswith('.jpg'):
info = IPTCInfo(f'photos/{filename}', force=True)
info['copyright notice'] = 'Β© 2026 Your Name'
info['keywords'].append('batch-processed')
info.save()
print(f"Processed {filename}")
# By default, save operations create a backup with ~ suffix
# To disable this, use the overwrite option:
info.save_as('photo.jpg', {'overwrite': True})
# Custom fields (custom1 through custom20) for non-standard metadata
info['custom1'] = 'Custom metadata value'
info['custom2'] = 'Another custom value'
info.save()
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
Check out the Publishing Guide if you're interested in the development workflow.
IPTCInfo3 is dual-licensed under the Artistic License 1.0 or GNU General Public License (GPL) 1.0 or later. You may choose either license.
Original Perl version by Josh Carter, ported to Python by TamΓ‘s GulΓ‘csi, maintained by James Campbell.