skillfed

creosote

Identify unused dependencies and avoid a bloated virtual environment.

creosote v5.2.0 860.7K downloads/30d#4,874 on PyPI380
Permissive license Active released

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 creosote

uv

uv add creosote

poetry

poetry add creosote

Installing 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

License :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Tags

find unused dependenciesdetect unused importsclean up bloated venvdependency audit toolremove unused packagesdependency analyzervenv cleanup
dependency-auditci-integrationvenv-cleanup

More Quality Assurance packages