๐ฉบ Python environment diagnostic CLI โ your project's doctor.
Project description
๐ฉบ PyDoctor
PyDoctor is a premium, developer-friendly diagnostic assistant for Python environments. It acts like a personal physician for your code โ scanning your project and environment to prescribe fixes for misconfigurations, dependencies, and security vulnerabilities.
Features โข Quick Start โข Usage โข Configuration โข Architecture
๐ธ How it looks
PyDoctor provides a beautiful, color-coded interface powered by Rich.
๐ฉบ PyDoctor Diagnosis Report
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Results โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Environment โ 1 issue detected
Dependencies โ Healthy
Outdated Packages โ 3 detected
Security โ 2 vulnerabilities Found
Unused Packages โ 5 detected
โค๏ธ Project Health Score
โโโโโโโโโโโโโโโโโโโโ 60%
๐ฉบ Doctor's Verdict
Your project contains severe risks that should be fixed before production.
โจ Features
PyDoctor isn't just a scanner; it's a complete remediation tool.
- ๐ Env Analysis: Detects missing virtualenvs, outdated pip, or deprecated Python versions.
- ๐๏ธ Dependency Fix: Automatically resolves conflicts and installs missing packages.
- ๐ก๏ธ Security: Integrates with OSV.dev API to check against known CVEs/GHSAs.
- ๐งน Unused Detection: Uses AST analysis to identify declared packages that are never imported.
- ๐ Multi-Manager: Intelligent support for pip, Poetry, uv, and pdm.
- ๐จ Rich UI: Beautiful progress spinners, icons, and color-coded severities.
- ๐ค CI/CD Ready: Structured JSON output and non-zero exit codes for failing health scores.
๐ฆ Installation
PyDoctor requires Python 3.10+. For the best experience, we recommend using pipx.
# Recommended: Install globally in an isolated environment
pipx install pydoctor-cli
# Standard pip installation
pip install pydoctor-cli
โก Usage
Full Diagnosis
Run a comprehensive check-up on your project.
pydoctor diagnose
Targeted Scans
Need a second opinion on a specific area?
pydoctor check-env # Check Python, venv, and pip
pydoctor scan-deps # Scan dependency constraints
pydoctor scan-security # Check for security vulnerabilities
pydoctor scan-unused # Identify imports that aren't used
๐จ The Surgeon: Automated Fixes
Let PyDoctor perform the heavy lifting. It will offer to install missing packages, upgrade outdated ones, and clean up your environment.
pydoctor fix
โ๏ธ Configuration
PyDoctor works out of the box with zero configuration. For advanced control, add a [tool.pydoctor] section to your pyproject.toml:
[tool.pydoctor]
# Packages to ignore during unused dependency scanning
ignored_packages = ["ruff", "mypy", "pytest"]
# Minimum health score required for CI to pass (0-100)
min_health_score = 80
๐ฌ Architecture
PyDoctor is built with a clean, modular engine designed for extensibility. It uses a Project Context to share metadata across specialized scanners for environment, dependencies, security, and usage.
๐ Project Structure
pydoctor/cli/: Typer command handlers.pydoctor/core/: The core engine (Analyzer, Context, logic).pydoctor/scanners/: Individual diagnostic modules.pydoctor/reports/: Visual and JSON formatting.pydoctor/utils/: High-performance pip, subprocess, and AST helpers.
๐ ๏ธ Development Setup
We welcome contributions! Setting up the environment is simple:
git clone https://github.com/iamAgbaCoder/pydoctor-cli.git
cd pydoctor-cli
python -m venv .venv
# Activate venv, then:
pip install -e ".[dev]"
# Verify with tests
pytest
Developed with โค๏ธ by Favour Bamgboye
Project details
Release history Release notifications | RSS feed
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 pydoctor_cli-0.1.1.tar.gz.
File metadata
- Download URL: pydoctor_cli-0.1.1.tar.gz
- Upload date:
- Size: 52.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1655e196d4a9fd900d8cbe4bbbcc5f45beef1c5c6f282d1229f3e53d764fa9b8
|
|
| MD5 |
a0a9d89b75907d1bdf0d83d374472087
|
|
| BLAKE2b-256 |
fba2c0be6e76ce6b0ee315ad80415abe43b346441fd0df64249dead915f3c577
|
Provenance
The following attestation bundles were made for pydoctor_cli-0.1.1.tar.gz:
Publisher:
publish.yml on iamAgbaCoder/pydoctor-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydoctor_cli-0.1.1.tar.gz -
Subject digest:
1655e196d4a9fd900d8cbe4bbbcc5f45beef1c5c6f282d1229f3e53d764fa9b8 - Sigstore transparency entry: 1056666902
- Sigstore integration time:
-
Permalink:
iamAgbaCoder/pydoctor-cli@7057c07c8c5e9903767a45fe1c665d14c654f88f -
Branch / Tag:
refs/heads/release - Owner: https://github.com/iamAgbaCoder
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7057c07c8c5e9903767a45fe1c665d14c654f88f -
Trigger Event:
push
-
Statement type:
File details
Details for the file pydoctor_cli-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pydoctor_cli-0.1.1-py3-none-any.whl
- Upload date:
- Size: 62.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0b855d0658e783593c8ab005fc70ee6a305d244aa23eb97b7885c7e3ca1aff4
|
|
| MD5 |
6a8da0fae808e76b9009247f22ed0ac8
|
|
| BLAKE2b-256 |
76c962a55fb51e583a56af4e2f7cc04af864978b4f1662cf2363180ef6f8dd2d
|
Provenance
The following attestation bundles were made for pydoctor_cli-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on iamAgbaCoder/pydoctor-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pydoctor_cli-0.1.1-py3-none-any.whl -
Subject digest:
f0b855d0658e783593c8ab005fc70ee6a305d244aa23eb97b7885c7e3ca1aff4 - Sigstore transparency entry: 1056666968
- Sigstore integration time:
-
Permalink:
iamAgbaCoder/pydoctor-cli@7057c07c8c5e9903767a45fe1c665d14c654f88f -
Branch / Tag:
refs/heads/release - Owner: https://github.com/iamAgbaCoder
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7057c07c8c5e9903767a45fe1c665d14c654f88f -
Trigger Event:
push
-
Statement type: