Skip to main content

A CLI & Python API for editing EXIF data in photos.

Project description

Tagkit Logo

Tagkit

GitHub Read the Docs

Checks codecov

PyPI Python Versions

License: MIT

Tagkit is a Python toolkit and CLI for viewing and manipulating EXIF metadata in image files. It provides both a user-friendly command-line interface and a flexible Python API for programmatic access to EXIF data, with rich formatting options for photographers.

Screenshot: tagkit CLI table output


Source Code: https://github.com/rvforest/tagkit

Documentation: https://tagkit.readthedocs.io


Features

  • View EXIF metadata for one or more images
  • Filter by tag names or IDs
  • Output as a rich table or JSON
  • Handles binary EXIF data (bytes) with base64 encoding
  • Photographer-friendly formatting for shutter speed, aperture, ISO, and more
  • Extensible Python API for custom workflows

Installation

CLI

Invoke directly with uvx

uvx tagkit [command]

or install with uv, pipx, or pip

uv tool install tagkit
pipx install tagkit
pip install tagkit

Python Package

Install in your project with pip or the package manager of your choice.

pip install tagkit

CLI Usage

View EXIF Data

tagkit view [OPTIONS] FILE_OR_PATTERN

Options

  • --glob Use glob pattern matching for file selection.

  • --regex Use regex pattern matching for file selection.

  • --tags TAGS Comma-separated list of EXIF tag names or IDs to filter.

  • --thumbnail Show EXIF tags from image thumbnails instead of the main image.

  • --json Output EXIF data as JSON instead of a table.

Examples

# View EXIF data for a single image
tagkit view image.jpg

# View EXIF data for all JPGs in a folder
tagkit view "*.jpg" --glob

# Filter by specific tags
tagkit view image.jpg --tags Make,Model

# Output as JSON
tagkit view image.jpg --json

API Usage

Extract EXIF Data

from tagkit import ExifImageCollection

# Get EXIF data for one or more images
exif_collection = ExifImageCollection(['image1.jpg', 'image2.jpg'], tag_filter=['Make', 'Model'])

# Access EXIF data for each file
for file_path, exif_image in exif_collection.files.items():
    print(f"File: {file_path}")
    for tag in exif_image.tags.values():
        print(f"  {tag.name}: {tag.formatted_value}")

Working with ExifTag

from tagkit.core.tag import ExifTag

tag = ExifTag(id=271, value="Canon", ifd="IFD0")
print(tag.name)             # e.g., "Make"
print(tag.exif_type)        # e.g., "ASCII"
print(tag.formatted_value)  # e.g., "Canon"
print(tag.as_dict())        # Dict representation

Notes

  • Any EXIF bytes that cannot be decoded as UTF-8 will be displayed as base64-encoded strings.
  • Shutter speed, aperture, and ISO are formatted in a style familiar to photographers.
  • The CLI and API are extensible for custom workflows and formatting.

License

MIT


Contributing

Pull requests and issues are welcome! Please see the code and tests for examples of usage and extension.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tagkit-0.3.0.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tagkit-0.3.0-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

Details for the file tagkit-0.3.0.tar.gz.

File metadata

  • Download URL: tagkit-0.3.0.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.7.12

File hashes

Hashes for tagkit-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d0fc1f6bee17df845388e1df0c7e4095917816442cb7eee2a1b9499aa08dce0c
MD5 fc9081c70425c91c3fb45eacb7504f9e
BLAKE2b-256 d551aa862ca8aa8642c9eea35927eb5116519bf2c34037f8a387c4e47ded64d9

See more details on using hashes here.

File details

Details for the file tagkit-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: tagkit-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 29.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.7.12

File hashes

Hashes for tagkit-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9b69dc77830213195f9df4e3317d4792b2bc1a0b3217996d423fa0fafa57b82a
MD5 a50453d3fa756b86ea7496c52a3ff3ac
BLAKE2b-256 a1a80e3e134053f76bc54be8b3655ab69991de638fed298872404685157f8343

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page