Pymetrica

Architecture-aware code metrics for Python codebases

A CLI and Python API that parses Python with the AST and reports classical metrics (logical lines, cyclomatic complexity, Halstead volume, primitive obsession, maintainability cost) grouped by layers derived from the directory tree, with cross-layer coupling, instability and Mermaid diagrams.

Trade-offs

  • Layers come from the directory structure, so the architecture view needs no configuration but is only as meaningful as the folder layout.
  • Thresholds in pyproject.toml can turn reports into a non-zero exit for CI or pre-commit, while the default run only prints.

Q&A2

Those compute complexity per file or function; Pymetrica groups metrics by layer and adds cross-layer coupling and instability, with diagrams alongside.

Reviews

Loading reviews

    More in Ruff

    See all 4 →
    • polyOne Rust binary that lints and formats about 30 languages
    • codehoundPython static analyzer for async and correctness bugs that pass review
    • CytoScnPyRust static analyzer for Python dead code, security issues and quality metrics
    • colablinterIPython magics that run Ruff on Jupyter and Colab cells

    More in Linters & formatters

    See all 19 →
    • MigrationPilotPostgreSQL migration linter that blocks unsafe DDL before merge
    • augurPolicy-based linter for OpenTelemetry Collector configurations
    • alintLinter for repository structure, files and config values
    • jev-specCLI that fails the build when code drifts from its Markdown spec
    • CatalystOpsEditor extension that catches PySpark performance problems before they run
    • ArityLanguage server, formatter and linter for R

    More in Python

    See all 162 →
    • jobdGPU-aware job broker for a few personal machines, with an MCP server
    • RaspiMIDIHubRaspberry Pi as a plug-and-play USB MIDI hub with virtual instruments
    • blitcpFile copier that reads in disk order, dedupes and streams over raw SSH
    • gnss_gpuGPU GNSS positioning for urban canyons with particle filters and ray-traced NLOS
    • Active GraphEvent-sourced graph runtime for long-running, auditable agents
    • SnitchPer-app network monitor and outbound firewall for the desktop