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, HEIC, HEIF
  • Documents: PDF, DOCX, EPUB, ODT, 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

Print metadata for automation:

metadata-cleaner view sample.jpg --json

Write metadata JSON to a file:

metadata-cleaner view sample.jpg --json-output reports/metadata.json

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

Write a JSON summary report:

metadata-cleaner delete ./photos --summary-file reports/summary.json

The shared --json-output reports/summary.json option writes the same delete summary payload.

Summary reports include per-file status and output paths for audit trails. Add --checksums to include input/output hashes. SHA-256 is the default; use --checksum-algorithm sha512 or --checksum-algorithm blake2b for stronger hash reports. Add --preserve-timestamps when cleaned files should keep source file times. Use --report-detail compact or --report-detail summary for smaller reports. Use --report-filter failed to list only failed per-file entries. Formats that copy, rewrite, re-save, use ExifTool, delete audio tags, or remux video include precise per-file processing notes in JSON summary reports.

Edit metadata where supported:

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

Start the local Web UI:

metadata-cleaner web

The Web UI runs on 127.0.0.1 by default and shows original metadata next to cleaned-copy metadata so you can verify what changed before using the cleaned file. Use the Files button to view or delete uploaded originals and cleaned copies saved in the current local session.

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

Published release images are available from GitHub Container Registry:

docker run --rm -v "$(pwd)/photos:/data" ghcr.io/sandy-sp/metadata-cleaner:latest 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.18.13.tar.gz (26.8 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.18.13-py3-none-any.whl (32.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: metadata_cleaner-3.18.13.tar.gz
  • Upload date:
  • Size: 26.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.4 CPython/3.12.3 Linux/6.17.0-1013-azure

File hashes

Hashes for metadata_cleaner-3.18.13.tar.gz
Algorithm Hash digest
SHA256 3bbf5a9e0dc88a53899d3b91f167c080f2f79129f2e619f5e48e88396cbb51ee
MD5 c9df467fa77f48fa961ab96dc1c725ac
BLAKE2b-256 8ff6586562fba7668cea6ff8fb3cf37316420f6ca39b6cc28676491b541f9d85

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for metadata_cleaner-3.18.13-py3-none-any.whl
Algorithm Hash digest
SHA256 2e67a3ddb62a6eb0d840f64e3437169fd915b776731f9203a53a59e0534ed0f5
MD5 56c5629a87831088388ffd96c4a4b228
BLAKE2b-256 202bbe982f3d1687487a983830987067e62eb17be41ab797fd7510316d45a7bc

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