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-0.1.3.tar.gz (13.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-0.1.3-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pytomlcleaner-0.1.3.tar.gz
Algorithm Hash digest
SHA256 980eda872b5e004c3bdf45a084e48ea3f350975d025234ca34b1e9e460ccb69e
MD5 327746444414520858305e0905e6b8cd
BLAKE2b-256 47a666b2812d7c87ffd62b726297709350f29f204f28dd8c63d9839c602b806c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytomlcleaner-0.1.3.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-0.1.3-py3-none-any.whl.

File metadata

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

File hashes

Hashes for pytomlcleaner-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5079632d43ccec2b0910a0f164abde0d19b6089a63c7c5112e156447963684dd
MD5 a2b8efef93277efba6b81f1d0fdc8820
BLAKE2b-256 914cdc18fc687384c1cca885de1e3fbb034aabaa5335618f5dc292ff157b6f20

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytomlcleaner-0.1.3-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