Supply chain health metrics: a CLI for analysing OSS package health, maintainer burnout, and supply-chain risk
Project description
suphm — Supply Chain Health Metrics
A command-line tool that scores OSS package health, maintainer sustainability, and supply-chain risk across npm, PyPI, Cargo, Maven, Go, and direct GitHub repositories. Pulls metrics from registry APIs, GitHub, and the source repository itself; outputs structured JSON for downstream consumption.
Features
- Multi-Ecosystem Support: Analyze packages from npm, PyPI, Cargo, Maven, and Go
- Health Scoring: Comprehensive package health assessment (0-100 score)
- Burnout Detection: Identify maintainer sustainability risks
- CHAOSS Metrics: Bus factor, pony factor, elephant factor analysis
- Company Affiliation Enrichment: Automatic contributor company detection via GitHub API (when token provided)
- Tarball Inspection: License detection (via osslili), copyright extraction, binary-file detection by extension and magic bytes, hardened against zip-slip and decompression bombs
- GitHub Integration: Stars, forks, issues, PRs, and release metrics
- Flexible Output: JSON reports for integration with other tools
How It Works
suphm runs a comprehensive 7-step analysis pipeline:
- Discovery - Fetch package metadata from deps.dev, ecosyste.ms, and package registries
- Clone - Download the source repository for deep analysis
- Git Metrics - Calculate CHAOSS metrics (bus factor, contributors, companies)
- GitHub API - Gather community health indicators (stars, forks, issues, PRs)
- Tarball Scan - Analyze package contents for licenses, copyrights, and binary files
- Health Score - Compute overall package health across multiple dimensions
- Burnout Score - Assess maintainer sustainability and stress indicators
Installation
Requirements
- Python 3.10+
- The
gitcommand-line binary onPATH(used to clone source repositories for git-history analysis) - Optional: a GitHub personal access token (
GITHUB_TOKENorSUPHM_GITHUB_TOKEN) to lift the unauthenticated 60 req/hr cap to 5 000 req/hr. See docs/github-token-setup.md.
From PyPI
pip install suphm
From source
git clone https://github.com/SemClone/suphm.git
cd suphm
pip install -e ".[dev]"
Quick Start
# Analyze a package
suphm analyze pkg:npm/express
# Save results to file
suphm analyze pkg:pypi/requests --output report.json
# Analyze different ecosystems
suphm analyze pkg:cargo/serde
suphm analyze pkg:maven/org.opensearch/opensearch
suphm analyze pkg:go/github.com/hashicorp/terraform
# Discovery only (no deep analysis)
suphm discover pkg:npm/lodash
Usage
CLI Commands
# Full package analysis
suphm analyze pkg:npm/express --output analysis.json
# Metadata discovery only
suphm discover pkg:pypi/requests
# View cache information
suphm cache info
# Clear cache
suphm cache clear --all
# Check version
suphm --version
Supported Package URL (PURL) Formats
# npm packages
pkg:npm/express
pkg:npm/@babel/core@7.24.0
# PyPI packages
pkg:pypi/requests
pkg:pypi/requests@2.31.0
# Cargo (Rust) packages
pkg:cargo/serde
pkg:cargo/tokio@1.32.0
# Maven packages
pkg:maven/org.opensearch/opensearch
pkg:maven/org.apache.commons/commons-lang3@3.12.0
# Go modules
pkg:go/github.com/hashicorp/terraform
# GitHub repositories
pkg:github/expressjs/express
Output Format
The tool outputs JSON reports with the following metrics:
Health Score (0-100)
- Commit activity and release frequency
- Contributor diversity (bus factor, pony factor)
- Issue/PR responsiveness
- License compliance
- Branch protection and security
Burnout Score (0-100)
- Issue backlog pressure
- Response time gaps
- Triage overhead
- Workload concentration
- Activity decline trends
Additional Metrics
- CHAOSS metrics (bus/pony/elephant factors)
- GitHub community health (stars, forks, issues, PRs)
- License information
- Binary file detection (by extension and magic bytes)
Documentation
- Getting Started - Installation and first steps
- Command Reference - All available commands
- API Integrations - Discovery sources and rate limits
- GitHub Token Setup - Increase rate limits (5000/hr)
- SerpAPI Setup - Optional fallback for discovery
Using as a Python Library
suphm can also be used as a library in your Python applications:
from pathlib import Path
from suphm.metrics.git import GitMetricsAnalyzer
# Analyze a git repository
analyzer = GitMetricsAnalyzer(Path("/path/to/repo"))
result = analyzer.analyze()
# Access metrics for different time windows
metrics_90d = result.time_windows["90_days"]
print(f"Commits (90d): {metrics_90d.total_commits}")
print(f"Bus factor: {metrics_90d.bus_factor}")
print(f"License: {result.license_changes.current_license}")
See the API Reference for complete documentation.
Migration from older versions: See API Migration Guide
Configuration
GitHub Token (Recommended)
Set up a GitHub token for higher rate limits:
export GITHUB_TOKEN=ghp_your_token_here
See GitHub Token Setup for detailed instructions.
Cache Configuration
# Via environment variable
export SUPHM_CACHE_DIR=/custom/path
# Or in ~/.suphm/config.yaml
cache:
directory: /custom/path
Contributing
We welcome contributions! Please see CONTRIBUTING.md for details on:
- Code of conduct
- Development setup
- Submitting pull requests
- Reporting issues
Support
For support and questions:
- GitHub Issues - Bug reports and feature requests
- Documentation - Complete project documentation
License
GNU Affero General Public License v3.0 - see LICENSE file for details.
Authors
See AUTHORS.md for a list of contributors.
Part of the SEMCL.ONE ecosystem for comprehensive OSS compliance and code analysis.
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
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 suphm-0.3.0.tar.gz.
File metadata
- Download URL: suphm-0.3.0.tar.gz
- Upload date:
- Size: 184.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
157676771de71aff65aa5f14516241f7ed3ff1e1dcee361a5d2e4c22f1463432
|
|
| MD5 |
0d3f82eb9e45a631413b42be84afe177
|
|
| BLAKE2b-256 |
f609dba259e317cfe3ae942e9c3db015cdfd02d5c81bd1027425867d116e766e
|
Provenance
The following attestation bundles were made for suphm-0.3.0.tar.gz:
Publisher:
python-publish.yml on SemClone/suphm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
suphm-0.3.0.tar.gz -
Subject digest:
157676771de71aff65aa5f14516241f7ed3ff1e1dcee361a5d2e4c22f1463432 - Sigstore transparency entry: 1475545078
- Sigstore integration time:
-
Permalink:
SemClone/suphm@190d110d3a23422b076d0be60fb52bed63f08958 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/SemClone
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@190d110d3a23422b076d0be60fb52bed63f08958 -
Trigger Event:
release
-
Statement type:
File details
Details for the file suphm-0.3.0-py3-none-any.whl.
File metadata
- Download URL: suphm-0.3.0-py3-none-any.whl
- Upload date:
- Size: 92.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5488c614c2326e96f29a7e291cd4a4a624911c97f8f0ca3708f8450f080b127
|
|
| MD5 |
9cdb911dd43f5dd530da38bc75603a7d
|
|
| BLAKE2b-256 |
546b43562181fe3a5cf4c5bbf550ae96cee07e6ee1611322f2ca0bed68368af1
|
Provenance
The following attestation bundles were made for suphm-0.3.0-py3-none-any.whl:
Publisher:
python-publish.yml on SemClone/suphm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
suphm-0.3.0-py3-none-any.whl -
Subject digest:
a5488c614c2326e96f29a7e291cd4a4a624911c97f8f0ca3708f8450f080b127 - Sigstore transparency entry: 1475545163
- Sigstore integration time:
-
Permalink:
SemClone/suphm@190d110d3a23422b076d0be60fb52bed63f08958 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/SemClone
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@190d110d3a23422b076d0be60fb52bed63f08958 -
Trigger Event:
release
-
Statement type: