Skip to main content

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

Project description

Tagkit Logo

Tagkit

License: MIT Python Versions

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.


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.1.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.1.0-py3-none-any.whl (27.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for tagkit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 71463c56a522e6e7d4288e65266579339b66d13ea6b253d60f3e65f5732d406e
MD5 ad2142970a4b23ec9fe4693153f05a70
BLAKE2b-256 26a071dcd303f2a0f0bce8807f81c90067825c2db64a1fe7d623c5f485fd8dd7

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for tagkit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 92335f73f8928de9cb2d636b7eb404ed6a9f5f79e37e266759082dc70969b82a
MD5 0f62d1554566e2eef9173b5c89f34d10
BLAKE2b-256 d8b66cc729e247532929a223a7cb198e860ad787d7fe18dc46feae7335a1b525

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