Skip to main content

๐Ÿฉบ 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.

CI Status PyPI version Python versions License Code style: black

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

Apache License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydoctor_cli-0.1.1.tar.gz (52.7 kB view details)

Uploaded Source

Built Distribution

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

pydoctor_cli-0.1.1-py3-none-any.whl (62.5 kB view details)

Uploaded Python 3

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

Hashes for pydoctor_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1655e196d4a9fd900d8cbe4bbbcc5f45beef1c5c6f282d1229f3e53d764fa9b8
MD5 a0a9d89b75907d1bdf0d83d374472087
BLAKE2b-256 fba2c0be6e76ce6b0ee315ad80415abe43b346441fd0df64249dead915f3c577

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydoctor_cli-0.1.1.tar.gz:

Publisher: publish.yml on iamAgbaCoder/pydoctor-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for pydoctor_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f0b855d0658e783593c8ab005fc70ee6a305d244aa23eb97b7885c7e3ca1aff4
MD5 6a8da0fae808e76b9009247f22ed0ac8
BLAKE2b-256 76c962a55fb51e583a56af4e2f7cc04af864978b4f1662cf2363180ef6f8dd2d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydoctor_cli-0.1.1-py3-none-any.whl:

Publisher: publish.yml on iamAgbaCoder/pydoctor-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page