PragyaLint
Static dead-code analysis for Python that gets rid of the code, too.
PragyaLint builds a module graph from your entry points, traces what is actually reachable, and reports — then removes — unused files, exports, functions, imports, and circular imports. Pure Python. Zero dependencies. One command.
Why PragyaLint?
- Reachability, not regex. A real module graph from your entry points decides what is dead — the way a human would.
- Finds more than imports. Unreachable modules, unused exports, dead functions/classes, unused imports, and circular imports.
- Confidence-graded. Every finding is rated
high/medium/lowso you know what to trust and what to double-check. - Fixes what it finds.
--fixactually removes dead code, gated by confidence, with a--dry-runpreview. Always commit first. - Zero runtime deps. Only the standard library (
ast). No parser to install, nothing to break. - Native binaries. Windows EXE, Linux, and macOS executables on every release — no Python required at runtime.
What it catches
| Rule | Confidence | It reports… |
|---|---|---|
unused_file |
high | modules unreachable from any entry point |
unused_import |
high | imports never used in their module |
unused_export |
medium | public names never imported anywhere |
unused_local |
medium/low | functions, classes, variables defined but never used |
cycle |
low | circular import cycles |
Demo
$ pragyalint
src/service.py
:12 ⚠ [MEDIUM] export 'format_report' of module 'src.service' is never imported
:31 ✖ [HIGH ] import 'os' is never used
src/legacy/api.py
✖ [HIGH ] module 'src.legacy.api' is not reachable from any entry point
11 findings in 24 files (20 reachable).
6 high | 3 medium | 2 low
pragyalint analyzes the current directory by default. That's it.
Installation
pip install pragyalint # or: pipx install pragyalint
Requires Python 3.11+. On Windows use py -m pragyalint to run it as a module.
No Python / no hassle? Grab a prebuilt executable from the
Releases page —
Windows, Linux, and macOS binaries are built and attached automatically on every
release: commit.
Visual Studio Code extension
Find and fix dead code without leaving the editor — findings land in the Problems panel, colored by confidence, plus commands to preview and apply fixes.
code --install-extension IndianCoder3.sks-pragyalint
It shells out to the pragyalint CLI; set pragyalint.binaryPath if it can't
find the binary.
In your CI
Gate your pipeline on dead code:
- uses: actions/checkout@v4
- run: pip install pragyalint
- run: pragyalint --fail-on high --sarif > sarif.json
--fail-on high exits non-zero when any high-confidence finding exists.
--sarif (or --json) feeds GitHub code scanning and anything else that
speaks the format.
Docs
- Overview — how the analysis works under the hood
- CLI reference — every flag, one table
- Configuration —
pragyalint.toml,pyproject.toml, env-friendly defaults - Fixes — dry runs, confidence gates,
--force - Errors & troubleshooting — Windows/Linux/macOS PATH fixes included
- Full API — Python-level usage
Development
git clone https://github.com/Sanskriti-Studios/PragyaLint
cd PragyaLint
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev]"
pytest
License
GPL-3.0-or-later — free software, keep it that way.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pragyalint-0.1.4.tar.gz.
File metadata
- Download URL: pragyalint-0.1.4.tar.gz
- Upload date:
- Size: 158.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f18ce887e865a3070d823dcbc7cd1c69876ab480b5b8ec12851b325ebe9708f
|
|
| MD5 |
41772aeecb45c783beb753f6c4226f72
|
|
| BLAKE2b-256 |
118945944e8de35f6d3e7f87dbe675c6e61c3589aabd1718c5011b400f23aa8f
|
File details
Details for the file pragyalint-0.1.4-py3-none-any.whl.
File metadata
- Download URL: pragyalint-0.1.4-py3-none-any.whl
- Upload date:
- Size: 44.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70f19b6473547fa8dbedbfd8e68fc810dc2f4e2aeea4293725bf6d735b3c68b6
|
|
| MD5 |
749f6cc3093bc5237b8bd90377129de1
|
|
| BLAKE2b-256 |
c653fd4898728315f40af9b86c791d7cd44a4ec389b7c4191cdc5956f7e9ab79
|