Building 70 Projects ranging from beginner to advanced so anyone can — learn from, build upon, use as a reference, or even copy directly. Gamified Cybersecurity learning 👇
Go to file
HERITAGE-XION fcf234f88f check some potentially buggy sit 2026-01-10 20:32:30 +01:00
.github/workflows added publish workflow 2026-01-07 16:32:04 +01:00
docs metadata-scrubber-tool: 2026-01-10 19:23:43 +01:00
scripts applied formatting from yapf style file 2026-01-10 19:58:35 +01:00
src check some potentially buggy sit 2026-01-10 20:32:30 +01:00
tests applied formatting from yapf style file 2026-01-10 19:58:35 +01:00
typings/piexif metadata-scrubber-tool: 2026-01-07 14:40:53 +01:00
.gitignore applied formatting from yapf style file 2026-01-10 19:58:35 +01:00
.python-version metadata-scrubber-tool: 2026-01-07 15:12:15 +01:00
.style.yapf added yapf and style file 2026-01-10 19:25:07 +01:00
.yapfignore applied formatting from yapf style file 2026-01-10 19:58:35 +01:00
LICENSE Add MIT License to the project 2026-01-06 02:01:43 +01:00
README.md metadata-scrubber-tool: 2026-01-10 19:23:43 +01:00
docker-compose.yml Metadata-Scrubber-Tool: 2026-01-03 16:02:14 +01:00
main.py metadata-scrubber-tool: 2026-01-07 15:12:15 +01:00
pyproject.toml metadata-scrubber-tool: 2026-01-10 19:23:43 +01:00
pyrightconfig.json metadata-scrubber-tool: 2026-01-07 14:38:16 +01:00
requirements.txt metadata-scrubber-tool: 2026-01-05 17:15:13 +01:00
uv.lock added yapf and style file 2026-01-10 19:25:07 +01:00

README.md

🔒 Metadata Scrubber

A privacy-focused CLI tool that removes sensitive metadata from files. Supports images, PDFs, and Microsoft Office documents. Perfect for protecting your privacy before sharing files online.

Tests Python 3.10+ License: MIT

Features

  • Multi-format support - Images (JPEG, PNG), PDFs, and Office docs (Word, Excel, PowerPoint)
  • Concurrent processing - Process 1000+ files efficiently with ThreadPoolExecutor
  • Dry-run mode - Preview what would be scrubbed without making changes
  • Verification reports - Before/after comparison to confirm removal
  • Smart format detection - Uses library-level format detection, not just file extensions
  • Beautiful CLI - Rich progress bars and formatted output
  • Privacy-first - Removes GPS coordinates, author info, timestamps, camera data

📁 Supported Formats

Category Extensions Metadata Removed
Images .jpg, .jpeg, .png EXIF, GPS, camera info, timestamps
PDF .pdf Author, creator, producer, dates
Word .docx Author, title, comments, keywords
Excel .xlsx, .xlsm, .xltx, .xltm Author, title, company, comments
PowerPoint .pptx, .pptm, .potx, .potm Author, title, comments, keywords

🚀 Quick Start

Installation

# Using uv (recommended)
uv pip install metadata-scrubber

# Or clone and install locally
git clone https://github.com/Heritage-XioN/metadata-scrubber-tool.git
cd metadata-scrubber-tool
uv sync

Basic Usage

# Read metadata from a file
mst read document.pdf

# Scrub metadata and save to output folder
mst scrub photo.jpg --output ./cleaned

# Batch process entire folder
mst scrub ./documents -r -ext docx --output ./cleaned

# Verify removal
mst verify original.jpg ./cleaned/processed_original.jpg

📖 Commands

mst read - View Metadata

Extract and display all embedded metadata from a file.

mst read photo.jpg                      # Single file
mst read report.pdf                     # PDF file
mst read ./docs -r -ext docx            # All Word docs recursively

Example output:

╭────────────────── Metadata Report ──────────────────╮
│ ╭────────────────────┬────────────────────────────╮ │
│ │ Property           │ Value                      │ │
│ ├────────────────────┼────────────────────────────┤ │
│ │ 📷 Camera          │                            │ │
│ │   Make             │ Canon                      │ │
│ │   Model            │ Canon EOS 80D              │ │
│ │   Software         │ Adobe Photoshop            │ │
│ ├────────────────────┼────────────────────────────┤ │
│ │ 📍 GPS             │                            │ │
│ │   GPSLatitude      │ 40.7128                    │ │
│ │   GPSLongitude     │ -74.0060                   │ │
│ ├────────────────────┼────────────────────────────┤ │
│ │ 📅 Dates           │                            │ │
│ │   DateTimeOriginal │ 2024:01:15 14:30:00        │ │
│ │   created          │ 2024-01-15 14:30:00        │ │
│ ╰────────────────────┴────────────────────────────╯ │
╰─────────────────────────────────────────────────────╯

mst scrub - Remove Metadata

Remove sensitive metadata from files and save cleaned copies.

mst scrub photo.jpg --output ./out      # Single file
mst scrub ./photos -r -ext jpg -o ./out # All JPEGs in directory
mst scrub ./docs -r -ext pdf --dry-run  # Preview without changes
mst scrub ./files -r -ext xlsx -w 8     # 8 concurrent workers

Example output:

Processing 42 files with 4 workers...

⠸ Scrubbing metadata... ━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 42/42 0:00:12

╭───────────────────── Summary ─────────────────────╮
│ ✅ Processed: 42                                  │
│ ❌ Failed:    0                                   │
│ 📁 Output:    C:\Users\...\cleaned                │
╰───────────────────────────────────────────────────╯

Dry-run example:

mst scrub ./photos -r -ext jpg --dry-run
🔍 DRY-RUN MODE - No files will be modified

Would process 15 files:
  • photo1.jpg → processed_photo1.jpg
  • photo2.jpg → processed_photo2.jpg
  • vacation/beach.jpg → processed_beach.jpg
  ...

mst verify - Verify Metadata Removal

Compare original and processed files to confirm sensitive data was removed.

mst verify original.jpg ./out/processed_original.jpg

Example output:

Comparing: test_canon.jpg → processed_test_canon.jpg

                          Verification Report                          
┏━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
┃ Property                ┃ Before                   ┃ After          ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩
│ Make                    │ Canon                    │ ✅ Removed     │
│ Model                   │ Canon EOS 80D            │ ✅ Removed     │
│ Software                │ Adobe Photoshop          │ ✅ Removed     │
│ GPSLatitude             │ 40.7128                  │ ✅ Removed     │
│ GPSLongitude            │ -74.0060                 │ ✅ Removed     │
│ Artist                  │ John Smith               │ ✅ Removed     │
│ Copyright               │ © 2024 John Smith        │ ✅ Removed     │
│ DateTimeOriginal        │ 2024:01:15 14:30:00      │ ⚪ Preserved   │
└─────────────────────────┴──────────────────────────┴────────────────┘

✅ Status: CLEAN - All sensitive metadata removed
Removed: 38 | Preserved: 2

⚙️ CLI Options

Option Description
-r, --recursive Process directories recursively
-ext, --extension Filter by file extension (jpg, png, pdf, docx, xlsx, pptx)
-o, --output Output directory for cleaned files
-d, --dry-run Preview without making changes
-w, --workers Number of concurrent workers (default: 4, max: 16)
-V, --verbose Show detailed debug logs
-v, --version Show version

🛠️ Development

Setup

git clone https://github.com/Heritage-XioN/metadata-scrubber-tool.git
cd metadata-scrubber-tool

# Install with dev dependencies
uv sync --all-extras

# Run tests
pytest

# Run linting
ruff check .

# Run type checking
mypy src

Project Structure

src/
├── main.py                   # CLI entry point (Typer app)
├── commands/
│   ├── read.py               # Read metadata command
│   ├── scrub.py              # Scrub metadata command
│   └── verify.py             # Verify removal command
├── services/
│   ├── metadata_factory.py   # Factory for creating handlers
│   ├── metadata_handler.py   # Abstract base class
│   ├── image_handler.py      # JPEG/PNG handler
│   ├── pdf_handler.py        # PDF handler
│   ├── excel_handler.py      # Excel handler
│   ├── powerpoint_handler.py # PowerPoint handler
│   ├── worddoc_handler.py    # Word document handler
│   ├── report_generator.py   # Verification reports
│   └── batch_processor.py    # Concurrent batch processing
└── core/
    ├── jpeg_metadata.py      # JPEG EXIF processor
    └── png_metadata.py       # PNG metadata processor

docs/
├── metadata-risks.md         # Privacy risks documentation
└── best-practices.md         # Secure file sharing guide

📚 Documentation


⚠️ Security Considerations

  • Original files are never modified - processed copies are created
  • Use --dry-run to preview changes before committing
  • Use mst verify to confirm sensitive data was removed
  • GPS coordinates are completely stripped for privacy
  • Author information is removed from all supported formats
  • Always backup files before scrubbing in production

📄 License

MIT License - See LICENSE for details.


Made with ❤️ for privacy