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.0.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.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nb_image_data_extractor-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 61b06eb94fc1b5534449685f2361ef67b578c085c46546dfbfa122bad970b225
MD5 3f394eaf7988672dd2b3586d20ccc0ae
BLAKE2b-256 ca632ea34b173608e63e8560c7c0e170736136958006e6e3037efe3392af3601

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nb_image_data_extractor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b03bc365089c94244b09ea12534aa43653d5531d6b4e9febcf33a5118dceae9a
MD5 c66bdd57cc0e8adda9d7d1de245c08c1
BLAKE2b-256 30a26dc80232009b9d57d36dd38021f3d40c7e5cc35a558362692e30f9725043

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