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.2.tar.gz (12.7 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.2-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytomlcleaner-0.1.2.tar.gz
  • Upload date:
  • Size: 12.7 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.2.tar.gz
Algorithm Hash digest
SHA256 4c30e4d1524880cacbe793902e47759fa99077a24c9ad94723dd5c6aec3161b7
MD5 ff3d6b32acb57fd3640c7c9a69e58172
BLAKE2b-256 23d2c9cc191f6e6e51628ed2def6e38ee21e7301cd8fbb05e1c4afc303a6f674

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pytomlcleaner-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 12.9 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bbe2e9be58de9e993c2f533b70526e78fa0cf8b00cd3d2e33a18e711f6d7c85c
MD5 2fe17ed074cbfb06a1730a1c5dbe2d75
BLAKE2b-256 a226ffa8a76111e28d1d8c03d0ca84e38935f2ce2529d87ac34f6829fd356b8a

See more details on using hashes here.

Provenance

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