ncp-runtime
Python SDK for the Neural Computation Protocol (NCP) runtime.
This Python distribution is the SDK, not the Rust executable. It is a thin Python layer that spawns and talks to the ncp runtime binary (produced by the Rust ncp-runtime crate), returns structured per-terminal results, and exposes an iterator over the execution trace.
Use it to run NCP graphs from any Python application. For LangGraph adapters see ncp-langgraph; for MCP hosts see the Rust crate ncp-mcp-server. All three sit on top of the same runtime.
Quick start
Replace the paths below with your own graph and brick directory:
from ncp_runtime import NCP
ncp = NCP()
result = ncp.run(
graph="/abs/path/to/your-graph.yaml",
brick_dir="/abs/path/to/your-bricks",
inputs={"company_url": "https://example.com"},
)
if result.result_type == "Success":
print(result.terminals[0].output)
else:
print(result.result_type, result.terminals[0].error)
for record in result.trace():
print(record)
Prefer deterministic cleanup? Use the context-manager form:
with ncp.run(graph="...", brick_dir="...", inputs={...}) as result:
...
Graph-level Failure is a normal return, not an exception. Subprocess-side problems raise an NCPSDKError subclass. See docs/PYTHON_SDK.md for the full contract.
Install
On supported platforms (Linux x86-64 glibc 2.28+, macOS 11+ ARM64 / 10.13+ x86-64, Windows x86-64)
python -m pip install ncp-runtime
The installed wheel bundles a verified copy of the ncp runtime binary. No Rust toolchain required.
Everywhere else (Python-only fallback)
pip install ncp-runtime still succeeds, but the wheel ships without a bundled binary. Install the runtime separately and either keep ncp on PATH or pass an absolute path to NCP(binary=...):
cargo install ncp-runtime --locked
Pin to a specific version for reproducibility:
python -m pip install ncp-runtime==0.1.0
After install, verify end-to-end with the bundled smoke:
python -m ncp_runtime.demo
Resolves the ncp binary, runs a tiny bundled graph, and prints result_type plus a one-line summary per terminal. Exit 0 on Success.
Requirements
- Python 3.10+
- Compatible
ncpruntime binary. v0.1.0 of this SDK pinsSUPPORTED_RUNTIME_VERSIONS = ("0.3.6",). - No runtime Python dependencies.
v0.1.0 scope and limitations (honest)
- Sync only.
NCP().run(...)is a synchronous call. Native async support is a future version. - One subprocess per call. Each
run()starts a newncpprocess. Persistent execution and process pooling are outside v0.1.0. - No brick authoring. This SDK runs graphs; authoring remains the domain of the Rust brick crates.
- No MCP in the critical path. Direct
ncp run --all-terminalsinvocation; no MCP stdio dialog.
See docs/PYTHON_SDK.md §13 for the full non-goals list.
Not to be confused with
Aviz Networks publishes an unrelated package named ncp-sdk that also uses an ncp import namespace. This package publishes under the distribution name ncp-runtime and imports as ncp_runtime to avoid any collision.
License
Apache-2.0. See LICENSE and NOTICE.
Links
Metadata
Release files for ncp-runtime 0.1.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 |
|---|---|---|---|---|
| ncp_runtime-0.1.0.tar.gz | 66.6 kB | With provenance | Details for ncp_runtime-0.1.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| ncp_runtime-0.1.0-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details for ncp_runtime-0.1.0-py3-none-win_amd64.whl |
| ncp_runtime-0.1.0-py3-none-manylinux_2_28_x86_64.whl | Python 3 | none | Linux glibc 2.28+ x86-64 | Details for ncp_runtime-0.1.0-py3-none-manylinux_2_28_x86_64.whl |
| ncp_runtime-0.1.0-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details for ncp_runtime-0.1.0-py3-none-macosx_11_0_arm64.whl |
| ncp_runtime-0.1.0-py3-none-macosx_10_13_x86_64.whl | Python 3 | none | macOS 10.13+ x86-64 | Details for ncp_runtime-0.1.0-py3-none-macosx_10_13_x86_64.whl |
| ncp_runtime-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for ncp_runtime-0.1.0-py3-none-any.whl |
Total release size: 13.3 MB
Release files / ncp_runtime-0.1.0.tar.gz
| Download URL | ncp_runtime-0.1.0.tar.gz |
|---|---|
| Size | 66.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
31d3edea4bad539d526500d18b40c644cfa5641344a08aa2e94456bf62f4962d
|
|
BLAKE2b-256 checksum How to use checksums |
1c7a8d193d32533320af912e8924dde9bbee769497e1ffcfe9d59f0868424ff1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 2, 2026.
Transparency logRelease files / ncp_runtime-0.1.0-py3-none-win_amd64.whl
| Download URL | ncp_runtime-0.1.0-py3-none-win_amd64.whl |
|---|---|
| Size | 3.3 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
559385d3faae2ea42e0d5cdd57000f2770c7ceec95e984388daa2077c0ad5b42
|
|
BLAKE2b-256 checksum How to use checksums |
e5f5efafe7c6bc4a3b38b4917147c3ce398946774b36f7cb61a4293494dd0ea3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 2, 2026.
Transparency logRelease files / ncp_runtime-0.1.0-py3-none-manylinux_2_28_x86_64.whl
| Download URL | ncp_runtime-0.1.0-py3-none-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 3.6 MB |
| Tags | Linux glibc 2.28+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
a10e6e791676421ae0ac16f9d3cdac601d62e7245371e7e995032c6a8e064b61
|
|
BLAKE2b-256 checksum How to use checksums |
e73a84d4c723d11ccd2db7b6c2658443c294c40e52ac1a60228bdccbd5c89e5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 2, 2026.
Transparency logRelease files / ncp_runtime-0.1.0-py3-none-macosx_11_0_arm64.whl
| Download URL | ncp_runtime-0.1.0-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.9 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
d9115b57d8ef13034c84c99b8ba3f7a2ec670254aba8714528ce2e2c6f6cb0ea
|
|
BLAKE2b-256 checksum How to use checksums |
40a207d65da3cd0eb82ed275f3e38c72f8902bfc37572f93b6d07374dedc0e1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 2, 2026.
Transparency logRelease files / ncp_runtime-0.1.0-py3-none-macosx_10_13_x86_64.whl
| Download URL | ncp_runtime-0.1.0-py3-none-macosx_10_13_x86_64.whl |
|---|---|
| Size | 3.4 MB |
| Tags | Python 3 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
b0d75d4ff236c966a606a07536c10ea8f60872e2cb25ad0429e7b8397c3bce35
|
|
BLAKE2b-256 checksum How to use checksums |
b6f8d4a32a3f0326473bd288a331e0d73bed9d89aec37c6da476373b0dbf1676
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 2, 2026.
Transparency logRelease files / ncp_runtime-0.1.0-py3-none-any.whl
| Download URL | ncp_runtime-0.1.0-py3-none-any.whl |
|---|---|
| Size | 41.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7e40c62610a66a250c725f2d27d0b3cb6c206279f2acbe1841922a1baa6499ca
|
|
BLAKE2b-256 checksum How to use checksums |
aedb2c5d9dbdfabc36ec268ea7c677e2ee0dbc43f6841fda9791fc10df2ba891
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 2, 2026.
Transparency logSecurity for ncp-runtime 0.1.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.
Full provenance
All 6 files in this release have been uploaded with provenance metadata.
Attestation for ncp_runtime-0.1.0.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 Nov 2, 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.