Skip to main content
PragyaLint logo — a gear-and-chain that prunes dead code

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.


version python platform downloads dependencies build license


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 / low so you know what to trust and what to double-check.
  • Fixes what it finds. --fix actually removes dead code, gated by confidence, with a --dry-run preview. 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

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

pragyalint-0.1.4.tar.gz (158.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pragyalint-0.1.4-py3-none-any.whl (44.5 kB view details)

Uploaded Python 3

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

Hashes for pragyalint-0.1.4.tar.gz
Algorithm Hash digest
SHA256 6f18ce887e865a3070d823dcbc7cd1c69876ab480b5b8ec12851b325ebe9708f
MD5 41772aeecb45c783beb753f6c4226f72
BLAKE2b-256 118945944e8de35f6d3e7f87dbe675c6e61c3589aabd1718c5011b400f23aa8f

See more details on using hashes here.

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

Hashes for pragyalint-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 70f19b6473547fa8dbedbfd8e68fc810dc2f4e2aeea4293725bf6d735b3c68b6
MD5 749f6cc3093bc5237b8bd90377129de1
BLAKE2b-256 c653fd4898728315f40af9b86c791d7cd44a4ec389b7c4191cdc5956f7e9ab79

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page