Skip to main content

CapDAG for Python

This public package is the Python mirror of CapDAG. It provides Tagged, Media, and Cap URNs; capability definitions; registry resolution; Machine Notation; planning and execution; Bifaci; and the Python cartridge runtime and CLI.

Rust is the behavioral reference. Shared numbered tests carry the same meaning across mirrors, so current test catalogues—not a prose count—record parity.

Install the package

Python 3.11 or newer is required.

python3 -m pip install capdag

For a source checkout:

python3 -m pip install -e '.[dev]'

Parse and build Cap URNs

from capdag import CapUrn, CapUrnBuilder

parsed = CapUrn.from_string(
    'cap:disbind;in="media:document;ext=pdf";out="media:enc=utf8;page"'
)
built = (
    CapUrnBuilder()
    .in_spec("media:document;ext=pdf")
    .out_spec("media:enc=utf8;page")
    .marker("disbind")
    .build()
)

assert parsed.to_string() == built.to_string()

Treat URNs as opaque parsed values. Use their predicates for equivalence, conformance, dispatch, and ranking rather than splitting or comparing their serialized strings.

Find the relevant API

The package follows the boundaries in the CapDAG specification:

  • capdag.urn contains Tagged, Media, and Cap URNs;
  • capdag.cap contains definitions, argument sources, schema validation, and callers;
  • capdag.machine and capdag.planner contain notation, planning, and execution structures;
  • capdag.bifaci contains frames, streaming, flow control, cartridge and host runtimes, and relay components; and
  • registry modules resolve versioned fabric and cartridge data.

Docstrings beside public Python objects are the language-specific API reference. Language-neutral rules belong to the canonical specification.

Scaffold a Python cartridge

capdag dev new sentiment-tagger --lang python
cd sentiment-tagger
capdag dev install
echo "I love this" | capdag run sentiment-tagger

The generated project demonstrates a manifest, canonical URNs, handler registration, typed input and output, a model-backed peer call, and progress forwarding. See Build and Run a Cartridge.

Verify changes

python3 -m pytest

Run python3 -m pytest --cov=capdag when you also need a coverage report. Shared behavior changes require the applicable reference test with the same substantive number and assertions.

License

MIT

Metadata

Release files for capdag 1.593.89

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for capdag 1.593.89
File Size Uploaded Provenance Actions
capdag-1.593.89.tar.gz 1.2 MB Without provenance Details for capdag-1.593.89.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for capdag 1.593.89
File Interpreter ABI Platform Actions
capdag-1.593.89-cp312-cp312-macosx_12_0_arm64.whl CPython 3.12 CPython 3.12 macOS 12.0+ ARM64 Details for capdag-1.593.89-cp312-cp312-macosx_12_0_arm64.whl

Total release size: 2.2 MB

Release files / capdag-1.593.89.tar.gz

Download URL capdag-1.593.89.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
65bd5b206d716ec8a6b7dd58f12acf26a82fe5bf828f8cf0194a45b1f6752396
BLAKE2b-256 checksum
How to use checksums
0035e94db1a992f864334c1f28b87cecef02a22e0d4c9270ba654959102b10e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.20

Release files / capdag-1.593.89-cp312-cp312-macosx_12_0_arm64.whl

Download URL capdag-1.593.89-cp312-cp312-macosx_12_0_arm64.whl
Size 1.0 MB
Tags CPython 3.12 macOS 12.0+ ARM64
SHA-256 checksum
How to use checksums
abb41e050bca17acd0a7841553de08f6bf336fa78c253b9f91e3ea620c2f1ef1
BLAKE2b-256 checksum
How to use checksums
95fbd5571febf4c8a1573be591d4e0b38a01f1930b27e6212bd8c0f5317edd8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.20

Security for capdag 1.593.89

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.

Release history Release notifications | RSS feed

This release

1.593.89 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page