Skip to main content

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.py contains the core logic to inspect and sanitize image files.
  • report.py builds a human-readable report from the sanitizer's findings.
  • cli.py wires the command-line interface to the sanitizer and report generators.

Typical processing flow:

  1. CLI parses command-line arguments and file paths.
  2. The sanitizer opens each image, inspects metadata and content heuristics.
  3. Any sensitive items are removed (when requested) or recorded in a report.
  4. 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.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for img-sanitizer 0.1.4
File Size Uploaded Provenance Actions
img_sanitizer-0.1.4.tar.gz 14.7 kB With provenance Details for img_sanitizer-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for img-sanitizer 0.1.4
File Interpreter ABI Platform Actions
img_sanitizer-0.1.4-py3-none-any.whl Python 3 none any Details for img_sanitizer-0.1.4-py3-none-any.whl

Total release size: 25.9 kB

Release files / img_sanitizer-0.1.4.tar.gz

Download URL img_sanitizer-0.1.4.tar.gz
Size 14.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b931d694daf606d2bd119581d1b5caa026daeb3cfcc11b3eb3c402069d5efd8d
BLAKE2b-256 checksum
How to use checksums
721e6dde123f3089090b7a8bdb2983778cde743bf83b9347b2ad7dadcf2c2b51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

Release files / img_sanitizer-0.1.4-py3-none-any.whl

Download URL img_sanitizer-0.1.4-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5622587a7654fda703a3c40dd50bc83d68a9ce7d84ee47d134f868a547d5920c
BLAKE2b-256 checksum
How to use checksums
751d8cf75d8814ff80a85b9f44aeee17444f9d2c24dd676d45d377505a911699
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 19, 2026.

Transparency log

Security for img-sanitizer 0.1.4

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for img_sanitizer-0.1.4.tar.gz

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 Nov 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page