ship-score
SHIP Protocol — AI code reliability scoring for Python.
Score AI-generated commits, detect AI-written code, and gate commits via pre-commit hooks.
Install
pip install ship-score
CLI Usage
Score a commit
ship-score score --repo owner/repo --message "feat: add user auth" --language python
# SHIP Score: 73/100 (Grade: B) | Confidence: 0.82
Detect AI-generated code
ship-score detect --file main.py
# AI-Generated: Yes (89% confidence) | 174 features analyzed
Generate a report
ship-score report owner/repo
Check API health
ship-score health
# ✓ API reachable: https://ship-protocol.dhruvaapi.workers.dev
# Commits: 22,060
# Repos: 10,003
List AI tool rankings
ship-score tools
JSON output
Add --json to score or detect for machine-readable output:
ship-score score --repo owner/repo --message "fix: bug" --json
Library Usage
from ship_score import ShipClient
client = ShipClient()
# Score a commit
score = client.score(repo="owner/repo", message="feat: add auth", language="python")
print(score.score, score.grade) # 73, "B"
print(score.confidence) # 0.82
print(score.recommendations) # ["Add tests", ...]
# Detect AI-generated code
detection = client.detect(code=open("main.py").read(), language="python")
print(detection.is_ai, detection.confidence) # True, 0.89
# List AI tool rankings
tools = client.tools()
for tool in tools:
print(f"{tool.display_name}: {tool.grade}")
# Health check
health = client.health()
print(health.api_reachable, health.total_commits)
Custom API URL
client = ShipClient(base_url="https://your-instance.example.com")
Or set the SHIP_API_URL environment variable for the CLI.
Pre-commit Hook
Add to your .pre-commit-config.yaml:
repos:
- repo: https://github.com/vibeatlas/ship-score-python
rev: v1.0.0
hooks:
- id: ship-score
args: ['--min-score=60']
The hook:
- Extracts the staged commit message and changed file languages
- Scores via the SHIP API
- Blocks the commit if the score is below the threshold (default: 60)
- Prints recommendations on how to improve
API Reference
The package wraps the SHIP Protocol API:
| Endpoint | Method | Description |
|---|---|---|
/v2/score |
POST | Score an AI-generated commit |
/v2/detect |
POST | Detect AI-generated code |
/v2/tools |
GET | AI tool reliability rankings |
/v2/crawler-status |
GET | Data pipeline stats |
Development
git clone https://github.com/vibeatlas/ship-score-python.git
cd ship-score-python
pip install -e ".[dev]"
pytest
mypy ship_score/
ruff check .
License
MIT
Metadata
Release files for ship-score 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ship_score-1.0.0.tar.gz | 10.8 kB | Without provenance | Details for ship_score-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ship_score-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for ship_score-1.0.0-py3-none-any.whl |
Total release size: 20.8 kB
Release files / ship_score-1.0.0.tar.gz
| Download URL | ship_score-1.0.0.tar.gz |
|---|---|
| Size | 10.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
556038063c7a91b593a81e5709a0d7c234e67ed34ed28c4b1dd047310f8dc9f7
|
|
BLAKE2b-256 checksum How to use checksums |
5345936b01ebf0eb9151b336279f98e00b5420baa5c2d5a1b6bac7e66e0912fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / ship_score-1.0.0-py3-none-any.whl
| Download URL | ship_score-1.0.0-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
53e3e0a707134bb605c3af252059bdd727c9f2c5d362172d25c03240104965c3
|
|
BLAKE2b-256 checksum How to use checksums |
2b65d170547463eca1be461cde16ca1a082fc2e1b6f9ae054f0cb2e7cd796d53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Security for ship-score 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.