IPTCInfo3

Read and write IPTC photo metadata in Python. Pure Python, zero dependencies, tested on every release from 3.10 to 3.15.

v2.4.0 Python 3.10–3.15 Zero Dependencies 70+ IPTC Fields
$ pip install IPTCInfo3
πŸ“¦ Install from PyPI ⭐ View on GitHub

About

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.

Installation

# Using pip
pip install IPTCInfo3

# Using uv (recommended)
uv pip install IPTCInfo3

Requirements: Python 3.10 or higher, no external dependencies required.

Features

πŸ” Read & Write Metadata

Extract and modify IPTC metadata β€” keywords, captions, copyright, creator, document IDs β€” programmatically.

🐍 Modern Python

Tested on Python 3.10 through 3.15 on every commit via a CI matrix. Drops EOL interpreters.

🌐 Unicode Support

International characters with proper charset handling, including ISO 2022 escape sequences and UTF-8.

🎯 70+ IPTC Fields

Full IIM Application Record coverage: core photo fields plus audio, document ID, and workflow fields.

🀝 Friendly Aliases

creator, credit, and destination work out of the box, matching exiftool and gThumb conventions.

⚑ Zero Dependencies

Pure-Python implementation using only the standard library. No duplicate list entries, safe saves with optional backups.

Quick Start

Reading IPTC Data

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'

Writing IPTC Data

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')

Handling Different Charsets

# 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

Supported IPTC Fields

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.

What's New

v2.4.0 latest

✨ New Features

  • 19 missing IIM fields added β€” object type/attribute reference, audio block (150–154), document IDs (184–188), prefs, classify state, similarity index, document notes/history, EXIF camera info, catalog sets

v2.3.2

✨ New Features

  • creator alias for by-line per IPTC Core β€” info['creator'] now works for reading and writing

v2.3.1

πŸ”„ Compatibility

  • Python 3.10–3.15 support β€” verified on 3.14 and 3.15, CI matrix across all six versions
  • Dropped EOL interpreters 3.8 and 3.9
  • Fixed SyntaxWarning in file_is_jpeg() and the pytest config so bare pytest collects tests

Full changelog β†’

Advanced Examples

Batch Processing

import 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}")

Avoiding Backup Files

# By default, save operations create a backup with ~ suffix
# To disable this, use the overwrite option:
info.save_as('photo.jpg', {'overwrite': True})

Working with Custom Fields

# Custom fields (custom1 through custom20) for non-standard metadata
info['custom1'] = 'Custom metadata value'
info['custom2'] = 'Another custom value'
info.save()

Resources

Contributing

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.

License

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.