Skip to main content

A CLI tool to remove, edit, or selectively filter metadata from images, documents, audio, and video files.

Project description

Metadata Cleaner

CI Release PyPI version License: MIT

Metadata Cleaner is a privacy-focused CLI for viewing and removing metadata from local files. It writes cleaned copies by default and avoids modifying originals in-place.

Supported Files

  • Images: JPG, JPEG, PNG, TIFF, WEBP, AVIF
  • Documents: PDF, DOCX, TXT
  • Audio: MP3, WAV, FLAC, OGG, AAC, M4A, WMA
  • Video: MP4, MKV, MOV, AVI, WEBM, FLV

Video support requires ffmpeg and ffprobe. AVIF and broader metadata coverage benefit from exiftool.

Installation

Requires Python 3.11 or newer.

pip install metadata-cleaner
metadata-cleaner --help

For development:

git clone https://github.com/sandy-sp/metadata-cleaner.git
cd metadata-cleaner
poetry install --with dev
poetry run metadata-cleaner --help

CLI Usage

View metadata:

metadata-cleaner view sample.jpg

Remove metadata from one file:

metadata-cleaner delete sample.jpg

Write to a specific file:

metadata-cleaner delete sample.jpg --output cleaned/sample.jpg

Process a folder recursively:

metadata-cleaner delete ./photos --output ./cleaned-photos

Preview a run without writing files:

metadata-cleaner delete ./photos --dry-run

Edit metadata where supported:

metadata-cleaner edit song.mp3 --changes '{"artist": "Unknown"}'

Development Checks

python3 manage.py test
python3 manage.py lint
python3 manage.py check

CI runs tests, lint, and pip-audit on pull requests and pushes to main.

Docker

docker build -t metadata-cleaner .
docker run --rm -v "$(pwd)/photos:/data" metadata-cleaner delete /data

Logging

By default, logs go to stderr only. To write a log file, opt in explicitly:

METADATA_CLEANER_LOG_FILE=./metadata-cleaner.log metadata-cleaner delete sample.jpg

Use debug logging when needed:

METADATA_CLEANER_LOG_LEVEL=DEBUG metadata-cleaner view sample.jpg

Resources

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

metadata_cleaner-3.4.0.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

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

metadata_cleaner-3.4.0-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

Details for the file metadata_cleaner-3.4.0.tar.gz.

File metadata

  • Download URL: metadata_cleaner-3.4.0.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.17.0-1010-azure

File hashes

Hashes for metadata_cleaner-3.4.0.tar.gz
Algorithm Hash digest
SHA256 a01205049dd72f1ee2e9f2abe24bb06591ef94666c62bf72883fadad3b2cb767
MD5 fd6d3f6a542f09756f85e76b61c5673b
BLAKE2b-256 c45a52e0bb3578ef4f6a2c284e2d0539e76fc88f36fc2544d0398ecd4485e806

See more details on using hashes here.

File details

Details for the file metadata_cleaner-3.4.0-py3-none-any.whl.

File metadata

  • Download URL: metadata_cleaner-3.4.0-py3-none-any.whl
  • Upload date:
  • Size: 22.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.17.0-1010-azure

File hashes

Hashes for metadata_cleaner-3.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6b3dd1cc11776441cad9b3c570508a056623644a6bf30cfada8dd7f3ee265397
MD5 e9096b0ef244be44195f259b7dd54fa9
BLAKE2b-256 8eb90d5b416fe471b5f4cc616e15b360aac731e6908aa4049054fc4f6698b6db

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