Skip to main content

Remove metadata from images and videos recursively

Project description

assets-metadata-remover

PyPI version Python versions License: MIT

A command-line tool to read and remove metadata from images and videos recursively. Generates clean copies in an output folder that mirrors the original structure. Original files are never modified.

Features

  • Read metadata — Display metadata from images and videos in table or JSON format
  • Remove metadata — Strip all metadata (EXIF, XMP, IPTC, GPS, etc.) from files
  • Removal reports — Show detailed tables of what metadata was removed from each file
  • Recursive processing — Process entire directory trees while preserving folder structure
  • Safety first — Original files are never modified; always writes to separate output folder
  • Graceful degradation — Continues processing even if some tools are missing

Installation

With pipx (recommended)

pipx install assets-metadata-remover

With pip

pip install assets-metadata-remover

System dependencies

  • exiftool — required for image processing
  • ffmpeg — required for video processing

macOS:

brew install exiftool ffmpeg

Ubuntu/Debian:

sudo apt-get install libimage-exiftool-perl ffmpeg

Fedora:

sudo dnf install perl-Image-ExifTool ffmpeg

If a tool is missing, the script detects it at startup and processes only the files it can handle, showing a clear warning.

Quick start

# Read metadata from a photo
assets-metadata-remover read ~/photo.jpg

# Remove metadata from a directory
assets-metadata-remover clean ~/Photos

# Show what was removed
assets-metadata-remover clean ~/Photos --report

Commands

read — Display metadata

Display metadata from images and videos in a human-readable table or JSON format.

assets-metadata-remover read <path> [--json]

Options:

  • --json — Output as JSON (useful for scripting)

Examples:

Read metadata from a single file:

$ assets-metadata-remover read ~/photo.jpg

File: /Users/you/photo.jpg
┌─────────────────────┬──────────────────────────────┐
│ Key                  Value                        │
├─────────────────────┼──────────────────────────────┤
│ Make                 Canon                        │
│ Model                Canon EOS 5D Mark IV         │
│ DateTimeOriginal     2024:03:15 14:23:45          │
│ GPSLatitude          40 deg 42' 46.08" N          │
│ GPSLongitude        │ 74 deg 0' 21.60" W           │
└─────────────────────┴──────────────────────────────┘

Read metadata from a directory:

assets-metadata-remover read ~/Photos

Output as JSON for programmatic use:

assets-metadata-remover read ~/Photos --json | jq '.[] | select(.metadata.GPSLatitude)'

clean — Remove metadata

Remove all metadata from images and videos, creating clean copies in an output folder.

assets-metadata-remover clean <path> [options]

Options:

  • -o, --output DIR — Output directory (default: <input>_clean)
  • --dry-run — Simulate without writing files
  • -v, --verbose — Show per-file logging
  • --verify — Re-inspect copies and report residual metadata
  • --report — Show table of metadata removed from each file

Examples:

Process a directory with custom output:

assets-metadata-remover clean ~/Photos -o ~/Photos_clean

Simulate without writing (dry run):

assets-metadata-remover clean ~/Photos --dry-run

Show metadata removal report:

$ assets-metadata-remover clean ~/Photos --report

/Users/you/Photos/vacation.jpg
  Metadata removed:
  ┌─────────────────────┬──────────────────────────────┐
   Key                  Removed Value                  ├─────────────────────┼──────────────────────────────┤
   Make                 Canon                           Model                Canon EOS 5D Mark IV            GPSLatitude          40 deg 42' 46.08" N          │
  │ GPSLongitude        │ 74 deg 0' 21.60" W           │
  │ DateTimeOriginal    │ 2024:03:15 14:23:45          │
  └─────────────────────┴──────────────────────────────┘

  ✔ Images cleaned: 1
  ✔ Videos cleaned: 0
  ⏭ Skipped:          0
  ✖ Errors:           0
  📊 Total metadata fields removed: 5
  📁 Output: /Users/you/Photos_clean

Verbose mode with verification:

assets-metadata-remover clean ~/Photos -v --verify

Process a single file:

assets-metadata-remover clean ~/photo.jpg -o ~/clean/

Supported formats

Images: JPG, JPEG, PNG, TIFF, TIF, WebP, HEIC, HEIF, GIF, BMP

Videos: MP4, MOV, MKV, AVI, M4V, WebM, WMV, FLV, 3GP

Extension comparison is case-insensitive (.JPG and .jpg are equivalent).

Safety

Original files are never modified. The script always writes to a separate output folder.

  • The clean command creates copies in <input>_clean/ by default
  • Use -o to specify a custom output directory
  • Use --dry-run to preview what would be processed without writing files
  • Directory symlinks are not followed to avoid infinite loops

Limitations

  • Videos are copied without re-encoding (-c copy), which is fast and lossless, but some exotic formats may not be compatible with the output container
  • Some metadata embedded in proprietary formats may not be fully removed by exiftool
  • Reading metadata before cleaning (with --report or -v) doubles the number of tool calls per file

Development

Setup

git clone https://github.com/synapsync/assets-metadata-remover.git
cd assets-metadata-remover
python -m venv .venv
source .venv/bin/activate
pip install -e .

Build and publish

make build          # Build wheel and sdist
make publish        # Upload to PyPI
make publish-test   # Upload to TestPyPI
make test           # Run smoke tests

License

MIT License. See LICENSE for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Changelog

v1.5.0 (2026-06-14)

  • Added GPS location extraction with consolidated coordinates in decimal format
  • Display Google Maps link for photos with GPS data
  • Enhanced read command output with location summary
  • Added location field to JSON output with latitude, longitude, and maps link

v1.4.0 (2026-06-14)

  • Improved README with badges, multi-platform installation, and real output examples
  • Added comprehensive changelog
  • Enhanced documentation with quick start guide

v1.3.0 (2026-06-14)

  • Added --report flag to clean command to show metadata removal tables
  • Added total metadata fields removed count in summary
  • Filter out _original backup files from directory scans

v1.2.0 (2026-06-14)

  • Added read command to display metadata from files
  • Support for table and JSON output formats
  • Graceful handling of missing tools

v1.1.0 (2026-06-14)

  • Refactored to subcommand architecture (read and clean)
  • Extracted shared utilities to separate module

v1.0.0 (2026-06-14)

  • Initial release
  • Remove metadata from images and videos recursively
  • Support for exiftool and ffmpeg

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

assets_metadata_remover-1.5.0.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

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

assets_metadata_remover-1.5.0-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file assets_metadata_remover-1.5.0.tar.gz.

File metadata

  • Download URL: assets_metadata_remover-1.5.0.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for assets_metadata_remover-1.5.0.tar.gz
Algorithm Hash digest
SHA256 59a11b2a6b7b7e3e004a0cde00c8b10f5c2685e4004e401a596521b0a3a2f357
MD5 76bcc3e8ef547143833ef1e189a125cd
BLAKE2b-256 27776a4792dc6488c0ded9e2894ec163b7d35cd6ca32a2baf73cd3eb849eccc7

See more details on using hashes here.

File details

Details for the file assets_metadata_remover-1.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for assets_metadata_remover-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1782b1a9906bfe6eed628f46dddf7f31cf710323c456579fd67388bc2ddb5fee
MD5 a2d6e18f213f2768c64984913b52eb0d
BLAKE2b-256 4b18f257da424a14545084267e39a4e157ac3b092ccae5e6ff5baa19701e112f

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