Skip to main content

A utility to find and remove unused dependencies in pyproject.toml.

Project description

🧹 pytomlcleaner

A command-line utility for identifying and optionally removing unused dependencies in your pyproject.toml file by statically analyzing your Python codebase. Keep your project dependencies lean and maintainable!

✨ Features

  • Static Code Analysis: Scans your Python source files (.py) using the Abstract Syntax Tree (AST) to accurately detect imports.
  • TOML Support: Correctly parses dependencies specified in pyproject.toml (supporting both PEP 621 [project.dependencies] and Poetry/Hatch [tool.*.dependencies]).
  • Safe Modification: Uses tomlkit to modify the pyproject.toml file, preserving existing comments, formatting, and indentation.
  • Python Compatibility: Supports Python 3.9+.
  • Standard Library Filtering: Uses stdlib-list to accurately ignore built-in Python modules.

📥 Installation

pytomlcleaner is available on PyPI.

pip install pytomlcleaner
uv add pytomlcleaner

🚀 Usage

To use pytomlcleaner, simply run the following command in your terminal:

pytomlcleaner 
pytomlcleaner --fix

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

pytomlcleaner-1.0.0.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytomlcleaner-1.0.0-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file pytomlcleaner-1.0.0.tar.gz.

File metadata

  • Download URL: pytomlcleaner-1.0.0.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pytomlcleaner-1.0.0.tar.gz
Algorithm Hash digest
SHA256 72ff98e7ebfe72ccde2cc43417945e90f4fef88388fc2f5b11c1dfce9b339d4b
MD5 00fbfa80f42ab1ad85306f794614b376
BLAKE2b-256 611db28dc6cd0d3499a0e4bfcf949b9a06b02d32be54108879dd3d7e682462c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytomlcleaner-1.0.0.tar.gz:

Publisher: publish.yml on t3an/pytomlcleaner

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytomlcleaner-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pytomlcleaner-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pytomlcleaner-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 896d457d4c1eea33f98dce62a69f981982bdfc5b564d8aa3af04d167807ff242
MD5 464686d8031d10cc2630e49c83dbe977
BLAKE2b-256 0710fac648c222d259e7051d3790413d95dbda9fe97d32064e85bba28702fd8b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytomlcleaner-1.0.0-py3-none-any.whl:

Publisher: publish.yml on t3an/pytomlcleaner

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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