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.
Metadata
Release files for pragyalint 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pragyalint-0.1.4.tar.gz | 158.2 kB | Without provenance | Details for pragyalint-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pragyalint-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for pragyalint-0.1.4-py3-none-any.whl |
Total release size: 202.7 kB
Release files / pragyalint-0.1.4.tar.gz
| Download URL | pragyalint-0.1.4.tar.gz |
|---|---|
| Size | 158.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6f18ce887e865a3070d823dcbc7cd1c69876ab480b5b8ec12851b325ebe9708f
|
|
BLAKE2b-256 checksum How to use checksums |
118945944e8de35f6d3e7f87dbe675c6e61c3589aabd1718c5011b400f23aa8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / pragyalint-0.1.4-py3-none-any.whl
| Download URL | pragyalint-0.1.4-py3-none-any.whl |
|---|---|
| Size | 44.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
70f19b6473547fa8dbedbfd8e68fc810dc2f4e2aeea4293725bf6d735b3c68b6
|
|
BLAKE2b-256 checksum How to use checksums |
c653fd4898728315f40af9b86c791d7cd44a4ec389b7c4191cdc5956f7e9ab79
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for pragyalint 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.