img-sanitizer
Python library designed to sanitize images by removing sensitive metadata.
Features
- CLI tool to scan and sanitize images.
- Generates simple reports about findings.
- Designed to be used in scripts or as a developer tool.
Installation
Install from PyPI with:
pip install img-sanitizer
Or install from source in an editable virtual environment:
git clone https://github.com/6C656C65/img-sanitizer.git
cd img-sanitizer
python -m venv .venv
source .venv/bin/activate
pip install -e .
Usage
After installation the CLI command is img-sanitizer.
Sanitize a source directory (or files) and write sanitized images to a destination directory:
img-sanitizer sanitize SOURCE DESTINATION --worker 4
SOURCE: a directory containing images (or a file path).DESTINATION: directory where sanitized images will be written.--worker: number of worker threads (default: 4).
Global flags:
--debug: enable debug logging for more verbose output (global).
Other commands:
img-sanitizer version: print the installed package version.
Check --help for subcommand and flag details:
img-sanitizer --help
img-sanitizer sanitize --help
How it works
The project provides a small Python package (img_sanitizer) with a CLI entrypoint.
sanitizer.pycontains the core logic to inspect and sanitize image files.report.pybuilds a human-readable report from the sanitizer's findings.cli.pywires the command-line interface to the sanitizer and report generators.
Typical processing flow:
- CLI parses command-line arguments and file paths.
- The sanitizer opens each image, inspects metadata and content heuristics.
- Any sensitive items are removed (when requested) or recorded in a report.
- The report is printed to stdout or written to a file.
The tool is intentionally small and focused; it does not try to be a comprehensive forensic solution.
Testing
The project includes unit tests (in the tests/ directory). Run them with pytest:
pytest -q
Contributing
Contributions are welcome. Please open issues for bugs or feature requests and submit PRs with tests.
License
See the repository LICENSE for license details.# img-sanitizer
Metadata
Release files for img-sanitizer 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| img_sanitizer-0.1.3.tar.gz | 15.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| img_sanitizer-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.9 kB
Release files / img_sanitizer-0.1.3.tar.gz
| Download URL | img_sanitizer-0.1.3.tar.gz |
|---|---|
| Size | 15.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
22c498799f881b7ec21793658aef2c4df5c10e3841d21cda81f6123c83ebfbe0
|
|
BLAKE2b-256 checksum How to use checksums |
4c42a97d613ad89874cbdaf67b64d97833c5be3d4e906f95d0447427af1c4636
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 4, 2026.
Transparency logRelease files / img_sanitizer-0.1.3-py3-none-any.whl
| Download URL | img_sanitizer-0.1.3-py3-none-any.whl |
|---|---|
| Size | 9.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4f0be530d1fdf17a4d5a88f49dd2ebc781d1827893de00721c5813637c336e78
|
|
BLAKE2b-256 checksum How to use checksums |
e244d383cdc54b5d4fa8d629d0db696963b3b2a9e97160968e7513131bb4e0d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 4, 2026.
Transparency log