creosote
Identify unused dependencies and avoid a bloated virtual environment.
What it is and what it does
Creosote is a command-line tool that identifies unused dependencies in your Python project by scanning source code for imports and comparing them against your declared dependencies. It works by parsing Python files for import statements, reading your dependency specification (pyproject.toml, requirements.txt, Poetry, Pipenv, or PDM formats), and determining which declared packages are never actually imported. The tool can also scan Django settings files for INSTALLED_APPS and MIDDLEWARE references.
You run it as a standalone tool (typically via `uv tool install creosote` to avoid polluting your project's venv) and configure it with command-line arguments or a `[tool.creosote]` section in pyproject.toml. It supports multiple venv paths, source directories, and dependency sections, and can optionally scan for deferred imports inside functions and conditional blocks. The output identifies which dependencies are unused so you can remove them, reducing virtual environment bloat and dependency maintenance burden.
Use it for:
- Run in CI to catch developers forgetting to remove unused dependencies during refactorings
- Audit a legacy project to identify and remove accumulated unused packages before deployment
- Integrate with pre-commit hooks to prevent unused dependencies from being committed
- Scan Django projects to verify all INSTALLED_APPS and MIDDLEWARE entries are actually used
- Reduce noise from dependency update bots by removing packages that won't actually break anything if dropped
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Creosote scans your Python project's source code and dependency specifications to identify which declared dependencies are actually unused, helping you clean up bloated virtual environments.
Yes. Creosote solves a real problem—unused dependencies create security and maintenance burden—with low friction (pure Python, six lightweight deps) and active maintenance. It supports multiple dependency formats and integrates well into CI/pre-commit workflows. No known vulnerabilities and permissive MIT license. Install as a standalone tool to keep your project venv clean.
Install
creosote on PyPI
pip
pip install creosoteuv
uv add creosotepoetry
poetry add creosoteInstalling creosote
Before you install
Low install friction with a pure Python wheel and six runtime dependencies. The project is actively maintained with a recent release and moderate popularity (top 5000 on PyPI), suggesting stable ongoing support.
License in practice
Licensed under MIT (permissive), so you can use and modify creosote freely in both open-source and commercial projects without significant legal constraints.
Quickstart
# Install in a separate venv
uv tool install creosote
# Run from your project root
creosote --venv .venv --path src --deps-file pyproject.toml --section project.dependencies
# Or configure in pyproject.toml:
# [tool.creosote]
# venvs = [".venv"]
# paths = ["src"]
# deps-file = "pyproject.toml"
# sections = ["project.dependencies"]
Requires Python 3.10 or later; you must have an activated virtual environment or site-packages folder path to scan, and a dependency specification file (pyproject.toml, requirements.txt, etc.) that creosote can parse.
Verify before relying
- Whether importlib-based dynamic imports can be detected (documentation notes this as a known limitation)
- Performance characteristics when scanning large codebases or complex dependency graphs
- Accuracy of deferred import detection when enabled via --include-deferred flag
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — dotty-dict, loguru, nbconvert, nbformat, pip-requirements-parser, tomli |
| Maintenance | actively maintained — 139 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 860,726/month — #4,874 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: creosote-5.2.0-py3-none-any.whl
Tags
More Quality Assurance packages
Coverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
ruffRuff is a Python linter and code formatter…
permissive · top 1,000 on PyPI
pexpectPexpect spawns and controls interactive console…
permissive · top 1,000 on PyPI
blackBlack reformats Python source code to a…
permissive · top 1,000 on PyPI
pytest-xdistpytest-xdist distributes pytest tests across…
permissive · top 1,000 on PyPI
cfn-lintValidates AWS CloudFormation templates in YAML…
permissive · top 1,000 on PyPI
pip-check-reqsAudits Python project imports against…
permissive · top 15,000 on PyPI
pip-autoremoveA command-line tool that uninstalls a package…
permissive · top 15,000 on PyPI
fawltydepsFawltydeps identifies undeclared dependencies…
permissive · top 15,000 on PyPI
uv-sortAlphabetically sorts dependencies in uv's…
permissive · top 15,000 on PyPI
deptryScans Python projects to detect unused,…
permissive · top 5,000 on PyPI
autoflakeautoflake removes unused imports and unused…
permissive · top 5,000 on PyPI
pytest-unused-fixturesA pytest plugin that identifies and reports…
permissive · top 15,000 on PyPI
deadcodeScans Python codebases to find and optionally…
agpl · top 15,000 on PyPI
pyclnPycln finds and removes unused import…
permissive · top 15,000 on PyPI
pipreqsScans Python project source code to detect…
permissive · top 5,000 on PyPI