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.0.tar.gz (5.3 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.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytomlcleaner-0.1.0.tar.gz
  • Upload date:
  • Size: 5.3 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.0.tar.gz
Algorithm Hash digest
SHA256 f201adae234cb6b82ce02e2d63965c336697c4bcc0dc355dcbc31f56dbff9cc3
MD5 ec5d1d501119580a9cfdc4649a263264
BLAKE2b-256 c0be37428f81fdd825fcb91d6e14ba3e2952d89c54fed063e9a40322ed027393

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pytomlcleaner-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.8 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 67e875e53d2fe7f3b06df7cfdc5fadd4d8a17013ee41491b36457ffec4803943
MD5 1a158728e29a807443374b1e9f9581d6
BLAKE2b-256 7be45cd77b9dfa6907a241f2a12faba754ee1b1468a4272b817dbb40d54a14e8

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