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.


Source Code: https://github.com/rvforest 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.2.0.tar.gz (1.8 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.2.0-py3-none-any.whl (28.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for tagkit-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d323f9fc6a91ec9ff645eef4c3c03b6c6bcbdf4de511344dc731ea1286b2c2ed
MD5 0ddd2b244fca40393ba3502b7c17ba98
BLAKE2b-256 4de7b1cb47b3a79ccdec558ea2646febf9983aadb8dc041af3c004313c028576

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for tagkit-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b19efba8dd5f3c7d70186a747afb5e30f1a2aaaf545349249a3c63fde86830a6
MD5 3a95110d92ac94ddfe17aae95c494618
BLAKE2b-256 279f3051efafdbfee4e7fb6a36b8b25beb4dfd95a18daf7334d89c25b38844ce

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