Skip to main content

PyO3-backed Manyfold RFC scaffolding and in-memory runtime.

Project description

manyfold

This repository now contains a first-pass implementation scaffold for the docs/rfc/wiregraph_rfc_rev2.md Manyfold RFC.

Layout

  • pyproject.toml: maturin/PyO3 Python packaging entrypoint
  • Cargo.toml: Rust crate for the native core and Python extension
  • src/: Rust in-memory runtime, typed refs, descriptors, envelopes, mailboxes, queries, and control-loop stubs
  • python/manyfold/: Python-facing ergonomic wrapper layer
  • python/manyfold/primitives.py: primary nouns and verbs for the Python API
  • python/manyfold/embedded.py: RFC 21 embedded device profile helpers and validation
  • python/manyfold/reference_examples.py: RFC 23 reference example suite registry
  • examples/: executable API examples that are also covered by the test suite
  • proto/manyfold/v1/wiregraph.proto: extracted protobuf schema scaffold from the RFC appendix

Status

This is an RFC stub implementation, not a production runtime. The current code focuses on:

  • typed namespace/route/schema identity objects,
  • explicit ReadablePort, WritablePort, WriteBinding, and Mailbox surfaces,
  • descriptor and envelope scaffolding,
  • catalog/latest/topology/validation query helpers,
  • a minimal ControlLoop epoch stub,
  • Python object-first routes and shared-stream ReadThenWriteNextEpochStep composition,
  • embedded device profile helpers for scalar and bulk sensors,
  • a named reference example suite that tracks the RFC examples and runs the supported subset,
  • Python bindings via PyO3 in the same layout as the referenced project style.

API Design Rules

The repository follows four implementation rules:

  • write both very small examples and deeper behavioral tests;
  • prefer extensive docstrings, targeted comments for non-obvious logic, and README-level guidance;
  • add types aggressively and shape APIs around understandable objects rather than stringly calls;
  • keep the top-level manyfold namespace narrow, with advanced helpers living under manyfold.graph and helper internals prefixed with _.

The intended Python wrapper surface is deliberately narrow:

  • build a TypedRoute with OwnerName, StreamFamily, StreamName, and Schema
  • build a ReadThenWriteNextEpochStep from a read stream and an output route
  • graph.latest(route) for snapshot reads
  • graph.observe(route) for Rx subscriptions
  • graph.publish(route, payload) for writes
  • graph.pipe(source, route) for wiring an Rx source into a route
  • graph.install(step) for attaching a ReadThenWriteNextEpochStep
  • graph.run_control_loop(name) for advancing a control loop once

These route inputs are object-based rather than ad hoc strings. Schema also owns payload encoding/decoding, so latest(route) and observe(route) can return typed values instead of raw payload bytes.

ReadThenWriteNextEpochStep lives in the primary primitives module because it is becoming a composition unit: it has one required input stream (read), one required output route (output), and one shared derived stream (write). Any subscriber to write observes the same emitted values that the graph sees when the step is installed and started.

The examples/ directory demonstrates these calls directly, and the examples are validated by the regular unittest run so they do not drift away from the API. examples/simple_latest.py is the smallest publish/read-back example; more involved query, join, transport, mesh, and security coverage stays in tests/test_graph_reactive.py.

Best Practices

When extending this repository, prefer a narrow, explicit, well-documented API over a broad convenience surface.

  • Write tests for every meaningful behavior change. Keep the smallest, easiest-to-understand examples close to the usage they demonstrate in examples/ and mirror them with straightforward assertions in tests/test_examples.py. Put more complex integration, reactive, and repository-level coverage in the rest of the tests/ directory.
  • Write extensive docstrings and supporting documentation for public modules, classes, and functions. If a section of code is non-obvious, add a concise comment that explains the invariant, constraint, or design reason behind it.
  • Always add types. Prefer signatures, return types, and data shapes that make the code self-describing, and keep pushing the API toward something a new reader can grok quickly without tracing through multiple layers of code.
  • Only elevate essential concepts into the primary API. Keep helper functions and intermediate building blocks semi-private by default, and use a leading underscore liberally for methods and functions that support the implementation but should not become part of the stable surface area.

Verification

Use cargo test for native verification.

Use uv sync to provision the Python environment and build the extension into the local .venv. Then run Python verification with uv run.

Typical Python commands:

  • uv run python -m unittest discover -s tests -p 'test_*.py'
  • uv run python -m manyfold.rfc_checklist_gen --check

Generate PyO3 .pyi stubs with cargo run --features stub-gen --bin stub_gen. If the default interpreter is older than Python 3.10, set PYO3_PYTHON to a 3.10+ interpreter first, for example PYO3_PYTHON=/opt/homebrew/Cellar/python@3.14/3.14.3_1/Frameworks/Python.framework/Versions/3.14/bin/python3.14 cargo run --features stub-gen --bin stub_gen. Regenerate the RFC implementation checklist with uv run manyfold-rfc-checklist (or uv run python -m manyfold.rfc_checklist_gen).

The Python package now targets Python 3.10+ because reactivex==5.0.0a2 requires it.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

manyfold-0.1.0.tar.gz (110.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

manyfold-0.1.0-cp310-abi3-win_amd64.whl (331.4 kB view details)

Uploaded CPython 3.10+Windows x86-64

manyfold-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (493.4 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

manyfold-0.1.0-cp310-abi3-macosx_11_0_arm64.whl (447.8 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

manyfold-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl (454.4 kB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file manyfold-0.1.0.tar.gz.

File metadata

  • Download URL: manyfold-0.1.0.tar.gz
  • Upload date:
  • Size: 110.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for manyfold-0.1.0.tar.gz
Algorithm Hash digest
SHA256 89cd09f3ad536f2b39239ac4616afd4e5dde3e4e7b8c1ec1c6938b145429e481
MD5 7b25ab0596df607bdfc502cabaa52e94
BLAKE2b-256 832317f9841b6a0eec314bf304b096369b06f31e95e000b977befa28da53440a

See more details on using hashes here.

Provenance

The following attestation bundles were made for manyfold-0.1.0.tar.gz:

Publisher: pypi.yml on Organization5762/manyfold

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file manyfold-0.1.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: manyfold-0.1.0-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 331.4 kB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for manyfold-0.1.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f394004dc86cd46fcb74fe4cc2a7aec385c187cec7b9aae7fe31a214d05a5d88
MD5 c73122e7aeeb56b4dc699c23a79857c7
BLAKE2b-256 469009f93ef38b27082ae6b430772328196320b2a12bef73e4f713cec07ae126

See more details on using hashes here.

Provenance

The following attestation bundles were made for manyfold-0.1.0-cp310-abi3-win_amd64.whl:

Publisher: pypi.yml on Organization5762/manyfold

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file manyfold-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for manyfold-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3edaae857c18883ac86052cfb1670f56fd653b555f5c65411ee48c29b9eef5e1
MD5 68511f97fef9335a82ea69f5ec792e80
BLAKE2b-256 ca0353373a63c43f642ec958d0da2c6d40b243c283e36225df6b61ad7e4db7c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for manyfold-0.1.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: pypi.yml on Organization5762/manyfold

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file manyfold-0.1.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for manyfold-0.1.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3377fbd24ffc774acabf45af176be850071f0805ad54eb9ae1e0fddd28ff7488
MD5 3f0fcaeb714ce188d674f2867f234089
BLAKE2b-256 d4d28ed65de404cc1f812d9683810c61d771c553289ae28024ccd019e5007c49

See more details on using hashes here.

Provenance

The following attestation bundles were made for manyfold-0.1.0-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: pypi.yml on Organization5762/manyfold

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file manyfold-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for manyfold-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 00450f34e4252566b76f1a0e43f842590a79025ddecf2fb770458f250554abc2
MD5 67b0f550e216b5583871ab94c1d6bb49
BLAKE2b-256 6b247eaf900f005ca7b11f9f763d2c46b8d6a8fc5a9ecf0eb97f8dbb2953b5d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for manyfold-0.1.0-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: pypi.yml on Organization5762/manyfold

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page