Skip to main content

Extract metadata from images (library + optional upload API).

Project description

image-data-extracter

Python library (and optional API) that extracts metadata from an image file.

Features

  • Basic metadata: format, dimensions, mode, color profile info, file size, hashes
  • EXIF metadata (when present), including GPS and orientation
  • CLI: print JSON metadata for a local file
  • Optional FastAPI endpoint: upload an image and get metadata back

Install (local)

python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install -U pip
python3 -m pip install -e ".[api]"

Library usage

from image_data_extractor import extract_metadata

metadata = extract_metadata("path/to/image.jpg")
print(metadata["image"]["width"], metadata["image"]["height"])

CLI usage

python3 -m image_data_extractor path/to/image.jpg --pretty

API usage (optional)

python3 -m pip install -e ".[api]"
uvicorn app.main:app --reload

Then POST a multipart upload:

curl -s \
  -F "file=@path/to/image.jpg" \
  "http://127.0.0.1:8000/metadata?pretty=1"

Web UI (optional)

When the API is running, open:

  • http://127.0.0.1:8000/ (upload UI)
  • http://127.0.0.1:8000/docs (Swagger)

Development

python3 -m pip install -e ".[dev,api]"
pytest -q

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

nb_image_data_extractor-0.1.1.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

nb_image_data_extractor-0.1.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file nb_image_data_extractor-0.1.1.tar.gz.

File metadata

  • Download URL: nb_image_data_extractor-0.1.1.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for nb_image_data_extractor-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3fcdbe71063cf69de1e587d5970b50ea730d9af87366e666936ba83316c54e9a
MD5 e29fad8fc7c7420b789c9bb3e437cb37
BLAKE2b-256 f6e0868be29d80785597f18b7310056db7b34a670610dd44d699a90523daacfd

See more details on using hashes here.

File details

Details for the file nb_image_data_extractor-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for nb_image_data_extractor-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ad985d87b8e63dd8b4acd90f42876c7a9fe5a3d60ee3e8d99aa48d6b5b0d1d31
MD5 8ab8fbe0780964063547eb5e84087e32
BLAKE2b-256 a6887ff55759c0a91343aceedb2eba6bca283510c274be2af9f46659dc16070f

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