This release is a pre-release and may not be stable for production use.
SCP Python SDK
scp-python-- Shared Context Protocol for Python
Cryptographic identity, encrypted contexts, capability-based auth, and outlet invocation for AI agents. Built on Rust via PyO3.
Install
pip install scp-python
Quick Start
import asyncio
from scp_sdk import Identity, Context
async def main():
# Create a cryptographic identity (DID)
identity = await Identity.create(custody="platform")
print(f"DID: {identity.did}")
# Create an encrypted context
ctx = await Context.create(
identity=identity,
params={"ceiling": ["msg:send", "msg:receive"], "ttl": 3600},
)
# Send a message (MLS-encrypted, signed, provenance-tagged)
await ctx.send(b"Hello from SCP")
# Receive messages
async for msg in ctx.receive():
print(f"{msg.sender_did}: {msg.content}")
break
await ctx.close()
asyncio.run(main())
Requirements
- Python >= 3.12
- Rust toolchain (build only -- wheels are pre-built for Linux, macOS, Windows)
API Reference
Generated from source via pydoc. Build locally:
cd bindings/python
python -m pydoc scp_sdk
Published API docs are generated on every release by CI.
Type Checking
PEP 561 compliant. The package ships py.typed marker and _scp_core.pyi stubs for full IDE autocompletion and mypy/pyright support.
mypy your_code.py # type stubs resolve automatically
Examples
See examples/ for runnable scripts:
| File | Description |
|---|---|
basic_messaging.py |
Create identity, context, send/receive messages |
outlet_invocation.py |
Register and invoke a outlet with test vectors |
mcp_integration.py |
Expose SCP outlets via MCP JSON-RPC server |
multi_agent.py |
Coordinate multiple agents in a shared context |
Error Handling
All errors inherit from ScpError with a machine-readable code field:
from scp_sdk import ScpError, ContextError
try:
await ctx.send(b"data")
except ContextError as e:
print(f"[{e.code}] {e}")
Source
- Scaffold:
.docs/scaffold/python.md - Standards:
.docs/standards/python.md - API sketch:
.docs/sketch.md
Metadata
Release files for scp-python 0.1.0b3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| scp_python-0.1.0b3.tar.gz | 5.0 MB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| scp_python-0.1.0b3-cp312-cp312-win_amd64.whl | CPython 3.12 | CPython 3.12 | Windows x86-64 | Details |
| scp_python-0.1.0b3-cp312-cp312-manylinux_2_28_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.28+ x86-64 | Details |
| scp_python-0.1.0b3-cp312-cp312-manylinux_2_28_aarch64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.28+ ARM64 | Details |
| scp_python-0.1.0b3-cp312-cp312-macosx_11_0_arm64.whl | CPython 3.12 | CPython 3.12 | macOS 11.0+ ARM64 | Details |
| scp_python-0.1.0b3-cp312-cp312-macosx_10_12_x86_64.whl | CPython 3.12 | CPython 3.12 | macOS 10.12+ x86-64 | Details |
Total release size: 131.2 MB
Release files / scp_python-0.1.0b3.tar.gz
| Download URL | scp_python-0.1.0b3.tar.gz |
|---|---|
| Size | 5.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
74a20eb556330a49449c5d6a42c2bd71dcbf91a4dd90ef0479deacb42a53b291
|
|
BLAKE2b-256 checksum How to use checksums |
5458ec53be28b5b477aab5c6307d110f6572653973a502bf8b0400dab161e653
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 13, 2026.
Transparency logRelease files / scp_python-0.1.0b3-cp312-cp312-win_amd64.whl
| Download URL | scp_python-0.1.0b3-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 23.3 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
5722880dacdefac731494df6804b21c7fa00c9e35f588d65e90bdb98986d44dc
|
|
BLAKE2b-256 checksum How to use checksums |
13b5184fe2cc57603d1f6be550b9ef3d6cadce8c910c95f45f4285de44e81a9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 13, 2026.
Transparency logRelease files / scp_python-0.1.0b3-cp312-cp312-manylinux_2_28_x86_64.whl
| Download URL | scp_python-0.1.0b3-cp312-cp312-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 26.2 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
090dc3768a3ea844bd39775116339456a98be4ab47345d35071f9ef0e7a5dcc7
|
|
BLAKE2b-256 checksum How to use checksums |
37b87efe87723221d431cd19dcc75006dba360048dd869a55d779573970db1e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 13, 2026.
Transparency logRelease files / scp_python-0.1.0b3-cp312-cp312-manylinux_2_28_aarch64.whl
| Download URL | scp_python-0.1.0b3-cp312-cp312-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 27.2 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
babbe10e8729ff54814f308d230b3cdd112e04cbd2e6416b52059912aab2e1e4
|
|
BLAKE2b-256 checksum How to use checksums |
ce6e9b0800cac522045f678a8c54ee96c9bea5b17105215f9a5e6fd4492b54f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 13, 2026.
Transparency logRelease files / scp_python-0.1.0b3-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | scp_python-0.1.0b3-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 24.5 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c6e08f0581c0b674af5f7fb23e4433674762e62b097850069e1295b060bf63e6
|
|
BLAKE2b-256 checksum How to use checksums |
f6a342fe31087b0279773e18f45e4f2c018e91de7d2b8e117751706d236e8345
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 13, 2026.
Transparency logRelease files / scp_python-0.1.0b3-cp312-cp312-macosx_10_12_x86_64.whl
| Download URL | scp_python-0.1.0b3-cp312-cp312-macosx_10_12_x86_64.whl |
|---|---|
| Size | 25.1 MB |
| Tags | CPython 3.12 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
e21bf084eb8a56e561821b808d1ad22ba9d547bab8141190784995cc2a70d897
|
|
BLAKE2b-256 checksum How to use checksums |
467e4351bb7fc47aaa8b8a93d5c4e7b3f71df56e25145cded92f24a1b2c0985d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jul 13, 2026.
Transparency log