SCP SDK
Python SDK for the System Capability Protocol (SCP) - programmatic access to manifests and graphs, plus a framework for building integrations.
Features
- Core Models: Type-safe Pydantic models for SCP v0.1 manifests
- Graph Abstraction: Efficient querying and traversal of system dependencies
- Integration Framework: Reusable base classes and utilities for building integrations (60-80% code reduction)
- Fully Tested: Comprehensive test suite with pytest
Documentation
- API Reference: Detailed API documentation for all modules.
- Integration Guide: Step-by-step tutorial for building custom integrations.
- Examples: Common usage patterns and code snippets.
Architecture
The SDK is composed of three main layers:
- Core (
scp_sdk.core): Defines the data models (SCPManifest,System,Dependency) and theGraphabstraction for analyzing architecture. - Integrations (
scp_sdk.integrations): Provides a framework (IntegrationBase,IntegrationConfig) for syncing SCP data to external tools (PagerDuty, ServiceNow, etc.). - Utilities (
scp_sdk.utils): Helper functions for tier handling and common tasks.
Installation
# Using uv (recommended)
cd /path/to/scp-sdk
uv sync
# Or with pip
pip install -e .
Quick Start
Load and Query Manifests
from scp_sdk import Manifest
# Load from file
manifest = Manifest.from_file("scp.yaml")
# Or from YAML string
yaml_str = """
scp: "0.1.0"
system:
urn: "urn:scp:payment-service"
name: "Payment Service"
classification:
tier: 1
"""
manifest = Manifest.from_yaml(yaml_str)
# Query
print(manifest.urn) # urn:scp:payment-service
print(manifest.tier) # 1
print(manifest.team) # team name
# Get specific dependency
dep = manifest.get_dependency("urn:scp:user-service")
print(dep.criticality) # required
Build and Query Graphs
from scp_sdk import Graph
# Load from unified JSON (from scp-cli scan --export json)
graph = Graph.from_file("graph.json")
# Or build from manifests
graph = Graph.from_manifests([manifest1, manifest2])
# Query
for system in graph.systems():
print(system.name)
# Find system
payment_svc = graph.find_system("urn:scp:payment-service")
# Get dependencies
deps = graph.dependencies_of(payment_svc)
# Get blast radius (what depends on this system)
dependents = graph.dependents_of(payment_svc)
Build Custom Integrations
The SDK makes building integrations incredibly simple:
from scp_sdk.core.graph import SystemNode, DependencyEdge
from scp_sdk.integrations.base import IntegrationBase
from scp_sdk.integrations.registry import register_integration
@register_integration("pagerduty")
class PagerDutyIntegration(IntegrationBase):
"""Sync SCP systems to PagerDuty services."""
def sync_system(self, system: SystemNode) -> None:
"""Create/update PagerDuty service."""
service_data = {
"name": system.name,
"description": f"SCP System: {system.urn}",
"escalation_policy": self.get_policy(system.team),
}
# Call PagerDuty API...
def sync_dependency(self, edge: DependencyEdge) -> None:
"""Sync dependency (optional for PagerDuty)."""
pass
# Usage
from scp_sdk.integrations.config import IntegrationConfig
config = IntegrationConfig(name="pagerduty", auth={...})
integration = PagerDutyIntegration(config)
result = integration.sync(graph)
The SDK handles:
- Graph iteration
- Error handling & retries
- Logging
- Dry-run mode
- ID caching
- Field mapping utilities
Development
# Install dependencies
make setup
# Run tests
make test
# Run linter
make lint
# Format code
make format
# Type check
make typecheck
# Run all checks
make check
# Run examples
make examples
Examples
See the examples/ directory:
basic_usage.py- Loading and querying manifests/graphscustom_integration.py- Building a PagerDuty integration
Run them with:
uv run python examples/basic_usage.py
uv run python examples/custom_integration.py
Related Projects
- scp-definition - SCP specification and JSON schema
- scp-integrations - CLI tools for scanning and exporting
- scp-viewer - Web dashboard for visualizing architectures
- scp-demo - Demo project for example models
License
MIT
Metadata
Release files for scp-sdk 0.2.2
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 | |
|---|---|---|---|---|
| scp_sdk-0.2.2.tar.gz | 92.7 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| scp_sdk-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 125.5 kB
Release files / scp_sdk-0.2.2.tar.gz
| Download URL | scp_sdk-0.2.2.tar.gz |
|---|---|
| Size | 92.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
15f163e9a64d2f4f3eefd2bc88b9662eee1bbab912b7f1d4f3fc3755f3553115
|
|
BLAKE2b-256 checksum How to use checksums |
9a7afb960ba168083af314e0edd80136c94f24adf0da03ee649dad4ed3a653bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 19, 2026.
Transparency logRelease files / scp_sdk-0.2.2-py3-none-any.whl
| Download URL | scp_sdk-0.2.2-py3-none-any.whl |
|---|---|
| Size | 32.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
209443b9d236080323da4ab1a6bc33f2e3981ae2aadb69af7647380cc219891c
|
|
BLAKE2b-256 checksum How to use checksums |
d2c6d710ae28b53cef57db71185c3cb93df21c5614a5524d3f1de07cb9e5f1a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 19, 2026.
Transparency logSecurity for scp-sdk 0.2.2
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for scp_sdk-0.2.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 19, 2026.
Transparency logA 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.