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.1.tar.gz (5.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.1-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytomlcleaner-0.1.1.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for pytomlcleaner-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6ac3b5217e11b55223c684e1969d7842b17225bf6781473820ed1372ecb0b416
MD5 757618be3ad55345389a21a086ef9f07
BLAKE2b-256 d2684c16b03abd13413b1d4457b174db4bdc22ad8f67e6d3d2909d3fab8df198

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pytomlcleaner-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for pytomlcleaner-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ad7becf7300c39933fdbb24f263b3c9be67f41f779ab9f0e09ba87be5638875c
MD5 31385b25403add5a85994cabd2b518fa
BLAKE2b-256 b95f4a719f790fd7b1bdf24212d6e30a42f23b1582e72f5a551bb51dcd7c8dc6

See more details on using hashes here.

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