pyclean
Pure Python cross-platform pyclean. Clean up your Python bytecode.
Decision gist · record as of 2026-08-14
Yes. PyClean solves a genuine cross-platform problem with zero dependencies, active maintenance, and a clear safety-first design. The copyleft license is a minor consideration for development tools but not a blocker for most projects. Install it if you work in multi-version Python environments or want a safer alternative to shell commands for bytecode cleanup.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later.
- Git must be installed if using the --git-clean feature.
- Low friction install with no runtime dependencies.
License · maintenance · safety
GPL-3.0-or-later (copyleft) — Licensed under GPL-3.0-or-later (copyleft). Requires derivative works and modifications to be distributed under the same license; suitable for development tools but check your project's licensing compatibility before integrating.
last release 2026-05-23 (83 days) · last repo commit 2026-05-23 · 91 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 645,611 downloads/mo, #5,598 on PyPI
Alternatives
Verify before relying
pip install pyclean
pyclean --help
pyclean -v .- Whether the --erase option's safety constraints (no recursive deletion by default, interactive confirmation) are sufficient for production use cases.
- Performance characteristics when cleaning very large project trees or deeply nested directory structures.
What it is and what it does
PyClean is a command-line utility that removes Python bytecode artifacts (.pyc files and __pycache__ directories) from your project tree in a single, cross-platform command. It addresses the common problem of bytecode clutter that accumulates during development, especially when switching between Python versions or working across different operating systems. Unlike shell commands like `rm` or `find`, PyClean provides a safe, intentional interface with options for dry-run preview, verbose output, and interactive confirmation.
Beyond bytecode cleanup, PyClean can optionally remove debris from popular development tools (pytest, coverage, ruff, mypy, tox, and others) in their default locations, detect and remove empty directories left after refactoring, and integrate with Git's `git clean` command. It supports globbing for arbitrary file deletion with safety constraints to prevent accidental data loss. The tool is actively maintained, supports modern Python versions (3.9–3.14), runs on both CPython and PyPy, and has no runtime dependencies.
Use it for
- Clean bytecode before committing to version control to avoid merge conflicts from .pyc file changes.
- Remove accumulated __pycache__ directories and tool caches after switching Python versions or development environments.
- Integrate into tox or CI/CD pipelines as a pre-test cleanup step via the --debris flag.
- Safely delete arbitrary project files using glob patterns with the --erase option and dry-run preview.
- Detect and remove empty directories left behind after code refactoring with the --folders flag.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
PyClean solves a genuine cross-platform problem with zero dependencies, active maintenance, and a clear safety-first design. The copyleft license is a minor consideration for development tools but not a blocker for most projects. Install it if you work in multi-version Python environments or want a safer alternative to shell commands for bytecode cleanup.
Install
pyclean on PyPI
Before you install
Low friction install with no runtime dependencies. Actively maintained as of 2026-05-23 with 91 repository stars. Supports Python 3.9 through 3.14 and both CPython and PyPy implementations.
Requires Python 3.9 or later. Git must be installed if using the --git-clean feature.
License in practice
Licensed under GPL-3.0-or-later (copyleft). Requires derivative works and modifications to be distributed under the same license; suitable for development tools but check your project's licensing compatibility before integrating.
Quickstart
pip install pyclean
pyclean --help
pyclean -v .
Verify before relying
- Whether the --erase option's safety constraints (no recursive deletion by default, interactive confirmation) are sufficient for production use cases.
- Performance characteristics when cleaning very large project trees or deeply nested directory structures.
Package facts
| License | GPL-3.0-or-later copyleft |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 83 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 645,611 / month, #5,598 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Utilities |
Evidence: pyclean-3.7.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “remove pyc files”
- pycleanRemoves Python bytecode files (.pyc) and __pycache__ directories…
- pyc-wheelCompiles all Python source files (.py) in a wheel to bytecode (.pyc)…
- pycnitePycnite provides pure Python parsers for Python bytecode (.pyc files)…
Give your agent the search over MCP, or paste the wish link into any chat.
More Utilities packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.
Install it if you need to display or transform source code.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
See also uncompyle6 · pyc-wheel · pycnite · django-cleanup · decompyle3 · bytecode · pip-autoremove · nb-clean · check-wheel-contents · pyct