scopio
Code metrics auditor with SQLite history, diffs and quality gates.
Features
- Audits code metrics (lines, complexity, warnings, languages) across multiple projects.
- Stores audit history in SQLite with diffs and quality gates.
- Exports results as JSON, CSV and Markdown.
- Compares audits and detects regressions for CI (
--fail-on-regression).
Install
pip install scopio
Requirements
- Python >= 3.11
lizard>= 1.24.0 (required for CSV parsing mode)scc>= 3.3.0 (optional, used for language/line counting)git(optional, used for metadata)
Quick Start
scopio --config scopio.toml run
All output artifacts (database, JSON, CSV, Markdown) are stored in the .scopio/ directory by default. Use --output-dir to override.
If scc or lizard versions differ from the expected range, a non-blocking tool_version_diverge warning is emitted in the logs.
Usage
Run audit
scopio --config scopio.toml run
scopio --config scopio.toml run --verbose
scopio --config scopio.toml run --incremental
Report history
scopio report --project my-project --limit 10
Diff between audits
scopio diff --project my-project
Diff report with file-level detail
scopio diff-report --project my-project --files --threshold-ccn 6
CI integration
scopio ci --project my-project --fail-on-regression
Clean old audits
scopio clean --keep 50
Archive old data
scopio archive --older-than 2026-01-01 --format csv
Initialize config
scopio init
Configuration
[discovery]
ignore_hidden = true
projects = ["my-project"]
[filters]
global_dirs = ["node_modules", "target", "dist", "build"]
minified_files = ["*.min.js", "*.min.css"]
ignored_langs = ["JSON", "Markdown", "TOML"]
[quality_gates]
max_ccn = 10.0
max_warnings = 10
max_ccn_trend_increase = 0.2
trend_sensitive_projects = []
[quality_gates.per_project]
# "my-project" = { max_ccn = 12.0, max_warnings = 15 }
[quality_gates.per_language]
# Python = { max_ccn = 12.0, max_warnings = 20 }
Audit behavior
- Each audit run creates/updates a single row per
(project, branch, commit_hash). - Same commit, same branch: metrics are upserted (updated) and
runs_countis incremented. This avoids data staleness when re-running on the same commit (e.g. after changing.scopio.tomlfilters). - Different commit: a new row is created with
runs_count = 1. - The
runs_countfield is exposed inreport, CSV, JSON and Markdown exports. - Quality gates and diff comparisons use the last audited run for each project. Trend gate compares against the previous historical audit (before the current one).
GitHub Actions
name: Scopio
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
scopio:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v10.0.1
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Install Python
run: uv python install 3.11
- name: Install scopio
run: pip install scopio
- name: Run scopio
run: scopio ci --project my-project --fail-on-regression
Development
This project uses uv as the Python toolchain.
# Sync dependencies and create a virtual environment
uv sync
# Run tests
uv run pytest
# Run a lint check
uv run ruff check
# Run scopio locally
uv run scopio --help
Semantic Versioning
This project adheres to Semantic Versioning.
License
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 scopio-0.2.2.tar.gz.
File metadata
- Download URL: scopio-0.2.2.tar.gz
- Upload date:
- Size: 77.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
660ade835d8e5d33de7505b4ad2cc7db6333a2b60fb41d8ca7383d73c94c323e
|
|
| MD5 |
70a1a0c134ebc50526f99636b0b6a6e5
|
|
| BLAKE2b-256 |
b79becbf80553c42a5925e4a2ad2cfad0ae0669a9ce31aed6523e2724da77353
|
Provenance
The following attestation bundles were made for scopio-0.2.2.tar.gz:
Publisher:
publish.yml on ImGabe/scopio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scopio-0.2.2.tar.gz -
Subject digest:
660ade835d8e5d33de7505b4ad2cc7db6333a2b60fb41d8ca7383d73c94c323e - Sigstore transparency entry: 2640013080
- Sigstore integration time:
-
Permalink:
ImGabe/scopio@5ebc58dfaf4b6adc01809977cf86aebaa33d7c72 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/ImGabe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5ebc58dfaf4b6adc01809977cf86aebaa33d7c72 -
Trigger Event:
push
-
Statement type:
File details
Details for the file scopio-0.2.2-py3-none-any.whl.
File metadata
- Download URL: scopio-0.2.2-py3-none-any.whl
- Upload date:
- Size: 21.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
744ef4d38d0fcaff28b09bf3908aca474b7fd1bf4d298d18c778a8b01bc0ea84
|
|
| MD5 |
e037a41513776707e284e72a887babda
|
|
| BLAKE2b-256 |
28df7dd8526c4bae7406b32f678121f49b2c399d49ee07b2dbbaf6a2696220fa
|
Provenance
The following attestation bundles were made for scopio-0.2.2-py3-none-any.whl:
Publisher:
publish.yml on ImGabe/scopio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scopio-0.2.2-py3-none-any.whl -
Subject digest:
744ef4d38d0fcaff28b09bf3908aca474b7fd1bf4d298d18c778a8b01bc0ea84 - Sigstore transparency entry: 2640013127
- Sigstore integration time:
-
Permalink:
ImGabe/scopio@5ebc58dfaf4b6adc01809977cf86aebaa33d7c72 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/ImGabe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5ebc58dfaf4b6adc01809977cf86aebaa33d7c72 -
Trigger Event:
push
-
Statement type: