updated readme and project version
This commit is contained in:
parent
84f60d66aa
commit
d00d9d4598
135
README.md
135
README.md
|
|
@ -1,7 +1,11 @@
|
||||||
# 🔒 Metadata Scrubber Tool
|
# 🔒 Metadata Scrubber
|
||||||
|
|
||||||
A privacy-focused CLI tool that removes sensitive metadata (EXIF, GPS, author info) from image files. Perfect for protecting your privacy before sharing photos online.
|
A privacy-focused CLI tool that removes sensitive metadata (EXIF, GPS, author info) from image files. Perfect for protecting your privacy before sharing photos online.
|
||||||
|
|
||||||
|
[](https://github.com/Heritage-XioN/metadata-scrubber-tool/actions)
|
||||||
|
[](https://python.org)
|
||||||
|
[](LICENSE)
|
||||||
|
|
||||||
## ✨ Features
|
## ✨ Features
|
||||||
|
|
||||||
- **Multi-format support** - JPEG, PNG (with PDF/Office planned)
|
- **Multi-format support** - JPEG, PNG (with PDF/Office planned)
|
||||||
|
|
@ -11,106 +15,107 @@ A privacy-focused CLI tool that removes sensitive metadata (EXIF, GPS, author in
|
||||||
- **Beautiful CLI** - Rich progress bars and formatted output
|
- **Beautiful CLI** - Rich progress bars and formatted output
|
||||||
- **Privacy-first** - Removes GPS coordinates, camera info, timestamps, author data
|
- **Privacy-first** - Removes GPS coordinates, camera info, timestamps, author data
|
||||||
|
|
||||||
## 📚 Educational Value
|
## 🚀 Quick Start
|
||||||
|
|
||||||
This project demonstrates:
|
### Installation
|
||||||
- **Factory pattern** for extensible file type handling
|
|
||||||
- **Abstract base classes** for consistent handler interfaces
|
|
||||||
- **Concurrent processing** with thread-safe operations
|
|
||||||
- **CLI development** with Typer and Rich
|
|
||||||
- **Image metadata handling** with Pillow and piexif
|
|
||||||
|
|
||||||
## 📋 Prerequisites
|
|
||||||
|
|
||||||
- Python 3.10+
|
|
||||||
- [uv](https://github.com/astral-sh/uv) (recommended) or pip
|
|
||||||
|
|
||||||
## 🚀 Installation
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Clone the repository
|
# Using uv (recommended)
|
||||||
|
uv pip install metadata-scrubber
|
||||||
|
|
||||||
|
# Or clone and install locally
|
||||||
git clone https://github.com/Heritage-XioN/metadata-scrubber-tool.git
|
git clone https://github.com/Heritage-XioN/metadata-scrubber-tool.git
|
||||||
cd metadata-scrubber-tool
|
cd metadata-scrubber-tool
|
||||||
|
uv sync
|
||||||
# Create virtual environment and install dependencies
|
|
||||||
uv venv
|
|
||||||
.venv\Scripts\activate # Windows
|
|
||||||
# source .venv/bin/activate # Linux/Mac
|
|
||||||
|
|
||||||
uv pip install -r requirements.txt
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## 📖 Usage
|
### Basic Usage
|
||||||
|
|
||||||
### Read Metadata
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Single file
|
# Read metadata from a file
|
||||||
python -m src.main read photo.jpg
|
mst read photo.jpg
|
||||||
|
|
||||||
# Recursive directory scan
|
# Scrub metadata and save to output folder
|
||||||
python -m src.main read ./photos/ -r -ext jpg
|
mst scrub photo.jpg --output ./cleaned
|
||||||
|
|
||||||
|
# Batch process entire folder
|
||||||
|
mst scrub ./photos -r -ext jpg --output ./cleaned
|
||||||
```
|
```
|
||||||
|
|
||||||
### Scrub Metadata
|
## 📖 Commands
|
||||||
|
|
||||||
|
### `mst read` - View Metadata
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Single file
|
mst read photo.jpg # Single file
|
||||||
python -m src.main scrub photo.jpg --output ./cleaned
|
mst read ./photos -r -ext jpg # Directory (recursive)
|
||||||
|
```
|
||||||
|
|
||||||
# Batch process with 8 workers
|
### `mst scrub` - Remove Metadata
|
||||||
python -m src.main scrub ./photos/ -r -ext jpg --output ./cleaned --workers 8
|
|
||||||
|
|
||||||
# Preview without changes
|
```bash
|
||||||
python -m src.main scrub ./photos/ -r -ext jpg --dry-run
|
mst scrub photo.jpg --output ./out # Single file
|
||||||
|
mst scrub ./photos -r -ext jpg -o ./out # Directory
|
||||||
|
mst scrub ./photos -r -ext jpg --dry-run # Preview only
|
||||||
|
mst scrub ./photos -r -ext jpg -w 8 # 8 concurrent workers
|
||||||
```
|
```
|
||||||
|
|
||||||
### CLI Options
|
### CLI Options
|
||||||
|
|
||||||
| Command | Options |
|
| Option | Description |
|
||||||
|---------|---------|
|
|--------|-------------|
|
||||||
| `read` | `-r` / `--recursive`, `-ext` / `--extension` |
|
| `-r`, `--recursive` | Process directories recursively |
|
||||||
| `scrub` | `-r`, `-ext`, `-o` / `--output`, `-d` / `--dry-run`, `-w` / `--workers` |
|
| `-ext`, `--extension` | Filter by file extension (jpg, png) |
|
||||||
| Global | `-V` / `--verbose`, `-v` / `--version` |
|
| `-o`, `--output` | Output directory for cleaned files |
|
||||||
|
| `-d`, `--dry-run` | Preview without making changes |
|
||||||
|
| `-w`, `--workers` | Number of concurrent workers |
|
||||||
|
| `-V`, `--verbose` | Show detailed debug logs |
|
||||||
|
| `-v`, `--version` | Show version |
|
||||||
|
|
||||||
## 🏗️ Architecture
|
## 🛠️ Development
|
||||||
|
|
||||||
|
### Setup
|
||||||
|
|
||||||
|
```bash
|
||||||
|
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/
|
src/
|
||||||
├── main.py # CLI entry point (Typer app)
|
├── main.py # CLI entry point (Typer app)
|
||||||
├── commands/
|
├── commands/
|
||||||
│ ├── read.py # Read metadata command
|
│ ├── read.py # Read metadata command
|
||||||
│ └── scrub.py # Scrub metadata command (batch processing)
|
│ └── scrub.py # Scrub metadata command
|
||||||
├── services/
|
├── services/
|
||||||
│ ├── metadata_factory.py # Factory for creating handlers
|
│ ├── metadata_factory.py # Factory for creating handlers
|
||||||
│ ├── metadata_handler.py # Abstract base class
|
|
||||||
│ ├── image_handler.py # JPEG/PNG handler
|
│ ├── image_handler.py # JPEG/PNG handler
|
||||||
│ └── batch_processor.py # Concurrent batch processing
|
│ └── batch_processor.py # Concurrent batch processing
|
||||||
├── core/
|
└── core/
|
||||||
│ ├── jpeg_metadata.py # JPEG EXIF processor (piexif)
|
├── jpeg_metadata.py # JPEG EXIF processor
|
||||||
│ └── png_metadata.py # PNG metadata processor (PIL)
|
└── png_metadata.py # PNG metadata processor
|
||||||
└── utils/
|
|
||||||
├── display.py # Rich output formatting
|
|
||||||
├── formatter.py # Value formatting helpers
|
|
||||||
├── exceptions.py # Custom exceptions
|
|
||||||
└── logger.py # Logging configuration
|
|
||||||
```
|
|
||||||
|
|
||||||
**Data Flow:**
|
|
||||||
```
|
|
||||||
CLI Command → MetadataFactory → Handler (read→wipe→save) → Output
|
|
||||||
↓
|
|
||||||
Format Detection
|
|
||||||
↓
|
|
||||||
JpegProcessor / PngProcessor
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## ⚠️ Security Considerations
|
## ⚠️ Security Considerations
|
||||||
|
|
||||||
- **Always backup files** before scrubbing in production
|
- **Original files are never modified** - processed copies are created
|
||||||
- **Use `--dry-run`** to preview changes before committing
|
- **Use `--dry-run`** to preview changes before committing
|
||||||
- **GPS coordinates** are completely stripped for privacy
|
- **GPS coordinates** are completely stripped for privacy
|
||||||
- **Original files are not modified** - processed copies are created
|
- **Always backup files** before scrubbing in production
|
||||||
|
|
||||||
## 📄 License
|
## 📄 License
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[project]
|
[project]
|
||||||
name = "metadata-scrubber"
|
name = "metadata-scrubber"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
description = "A privacy-focused CLI tool that removes sensitive metadata from image files"
|
description = "A privacy-focused CLI tool that removes sensitive metadata from image files"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.10"
|
requires-python = ">=3.10"
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ app = typer.Typer(no_args_is_help=True, pretty_exceptions_show_locals=False)
|
||||||
log = logging.getLogger("metadata-scrubber")
|
log = logging.getLogger("metadata-scrubber")
|
||||||
|
|
||||||
|
|
||||||
__version__ = "0.1.0"
|
__version__ = "0.1.1"
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue