Skip to main content

loop-node

loop-node is the low-level runtime and wire protocol shared by Loop and loop-sdk. Most integrations should use loop-sdk directly; use loop-node when building a lower-level Node API or integration layer.

Installation

pip install loop-node

Published wheels support CPython 3.10–3.14 on Linux x86_64 (glibc 2.28+). They contain compiled implementation modules and type stubs; installation does not require a compiler.

Minimal example

import time

from loop_node import (
    EmptyConfig,
    FieldContract,
    LifecycleState,
    Node,
    NodeConnectionConfig,
    PayloadContract,
    ValueKind,
)

VALUE = PayloadContract(fields={"value": FieldContract(kind=ValueKind.SCALAR)})

node = Node(config_type=EmptyConfig)
output = node.declare_stream_output("value", payload_contract=VALUE)
node.start(
    node_id="example_node",
    connection=NodeConnectionConfig(loop_endpoint="tcp/127.0.0.1:7448"),
)

try:
    while node.is_running:
        node.process_control()
        if node.status.lifecycle is LifecycleState.ACTIVE:
            output.publish(timestamp_ns=time.time_ns(), payload={"value": 1.0})
        time.sleep(0.1)
finally:
    if node.status.lifecycle is not LifecycleState.FINALIZED:
        node.shutdown()
    node.close()

A Node declares its Config and Ports before connecting. Loop supplies the validated Config, Port bindings, and lifecycle operations. Call process_control() regularly to handle lifecycle requests from Loop. Use the Node lifecycle state to decide when your application should exchange Graph data. In most cases, only exchange data while the Node is ACTIVE.

Lifecycle

All Nodes use IDLE → Configure → CONFIGURED → Start → ACTIVE. Configure validates Config and calls optional on_configure(config) before Port binding. Start takes only bindings and calls optional on_start(). Stop and ResetFault return to IDLE; each restart requires Configure again. Configure may update existing payload contracts. The Orchestrator validates the resulting graph before starting Nodes. Port names and kinds stay fixed.

Describe returns the Config schema and current Port contracts for inspection. Loop uses Configure results for payload compatibility checks; contracts read through Describe are not treated as finalized for a run.

Port transport policy

Declare a transport policy on each Port, independently of the Node connection:

Policy Binding behavior
auto (default) Image contracts use SHM when every peer passes an actual SHM round trip; otherwise use ordinary Zenoh network transmission. Contracts without images use network transmission.
zenoh_network Require ordinary Zenoh transmission, including for local peers.
zenoh_shared_memory Require SHM for all payload types. An inaccessible peer or conflicting policy rejects binding before application Start.
from loop_node import TransportMode

# Optional policy; omitting transport is equivalent to AUTO.
image_output = node.declare_stream_output(
    "image", payload_contract=IMAGE_CONTRACT,
    transport=TransportMode.AUTO,
)
policy = node.declare_request_client(
    "action", request=OBSERVATION_CONTRACT, response=ACTION_CONTRACT,
    request_transport=TransportMode.AUTO,
    response_transport=TransportMode.ZENOH_NETWORK,
)

The examples assume the payload contracts have been declared. Both endpoints advertise policies and supported transports in their Port contracts. An explicit policy constrains an auto peer; contradictory policies fail. Request and reply are negotiated independently, so an observation with images can use SHM while its small action response uses the network path. TCP/UDP endpoint selection is still Zenoh session configuration, independent of these Port policies.

One provider Port currently uses one common mode for all its receivers. For image fanout, every receiver must pass the SHM probe; a remote receiver makes an automatic provider use network transmission for all receivers. SHM-only Ports instead reject an incompatible connection. Probes use dedicated control endpoints and never invoke a user handler or robot action.

A binding keeps its selected mode until it is released. Partial Node restarts retain the graph's common mode while any Node remains started. Stop all Nodes before renegotiating, changing contracts, or reconnecting peers. Configuration changes that preserve Port contracts and graph connections are allowed. Selected modes and reasons are logged when bindings are created. Probes check memory accessibility; later allocation exhaustion or transport loss is still an error, not a reason to resend a request or silently change mode.

Cell Config bindings now contain only from; they do not store transfer modes. The appended collect_cell_config_2_0_0_auto_transport migration removes old binding profile fields from all saved revisions while preserving Node Config and other graph content. The low-level Graph Config has a shared_memory_pool_size_bytes limit (default 64 MiB per sending Port).

This protocol requires loop-node 0.3.x on Loop and external Nodes. Control protocol version 2 rejects older Node registrations. Existing publish, poll, request, Payload, ImageValue, and step APIs keep the same application data interface. Use the matching SDK update when importing through loop-sdk.

Image framing and SHM lifetime

Loop uses Zenoh 1.10.1. Image bytes are outside the Protobuf body for both network and SHM transmission. Protobuf metadata in the attachment describes one contiguous binary payload by field name, offset, and length. When a payload contains images, its tensor and audio fields share that buffer. Network payloads without images use ordinary Protobuf. Explicit SHM packs every payload, including scalar-only and empty payloads (one padding byte for an empty binary buffer).

Zenoh's implicit transport SHM optimization is disabled in Loop sessions so zenoh_network remains network transmission. Loop's auto policy negotiates explicit SHM instead. SHM support remains enabled. Physical transport changes are rejected by graph input and RPC bindings. Passive recorder previews are observers: they can also decode ordinary copies delivered outside the graph's negotiated SHM peers.

Each SHM sending Port owns a bounded pool. The limit must cover in-flight data, values retained by receivers, and allocation overhead. The receiver validates buffer ranges, layout, and sizes. Image/audio values retain their Zenoh payload and remain readable after the binding or session closes. Retaining request images does not keep their Query open. Releasing values allows the sender to reclaim allocations; retaining them can exhaust its pool. Request timeouts and client closure do not interrupt a handler already running on the server.

Zenoh Python 1.10.1 does not expose received SHM through the Python buffer protocol. Packed ranges share a lazy Python snapshot, and tensor decoding materializes it to preserve TensorValue.data as a read-only memoryview. This is not end-to-end zero-copy NumPy access.

On Linux, Zenoh locks mapped SHM into memory. Each process needs a sufficient RLIMIT_MEMLOCK limit for the pools it creates or maps, and containers need enough /dev/shm capacity for all participating processes. Wheel tests configure Docker with --shm-size=256m --ulimit=memlock=268435456:268435456 for their multi-process image requests and replies. Size these limits for the pools used by your application; a small limit can reject pool creation before any data is sent.

Metadata

Release files for loop-node 0.3.0

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

Built distributions (wheels)

Table of built distributions (wheels) for loop-node 0.3.0
File Actions
loop_node-0.3.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for loop_node-0.3.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
loop_node-0.3.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.17+ ARM64, Linux glibc 2.28+ ARM64 Details for loop_node-0.3.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
loop_node-0.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details for loop_node-0.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
loop_node-0.3.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ ARM64, Linux glibc 2.28+ ARM64 Details for loop_node-0.3.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
loop_node-0.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for loop_node-0.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
loop_node-0.3.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ ARM64, Linux glibc 2.28+ ARM64 Details for loop_node-0.3.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
loop_node-0.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.17+ x86-64 Details for loop_node-0.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
loop_node-0.3.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ ARM64, Linux glibc 2.28+ ARM64 Details for loop_node-0.3.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
loop_node-0.3.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for loop_node-0.3.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
loop_node-0.3.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ ARM64, Linux glibc 2.28+ ARM64 Details for loop_node-0.3.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl

Total release size: 10.7 MB

Release files / loop_node-0.3.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL loop_node-0.3.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 1.2 MB
Tags CPython 3.14 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
a05a3ca1c6ecf13b7f06373f90fa1e22bc967171ede940e303060d5823dceeae
BLAKE2b-256 checksum
How to use checksums
2d2be33791ac81812ede63594bac3c13d80bf9da68c6497e17e110bb45ae523c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 18, 2026.

Transparency log

Release files / loop_node-0.3.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl

Download URL loop_node-0.3.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Size 1.1 MB
Tags CPython 3.14 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
f97eeacabfb8a2f329f02afe77403dd5af637b65893b362772e2edb28e9bf711
BLAKE2b-256 checksum
How to use checksums
e1e99e93d5b64a9ce7d49c512cc527d3ed3a36da17ef2b1af9eafb1a06e7b0e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 18, 2026.

Transparency log

Release files / loop_node-0.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL loop_node-0.3.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 1.2 MB
Tags CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
5e5e56a1f618f6ee5efa7f7cfefe5f620b62d097e1ae5a45daa836be97dfde8b
BLAKE2b-256 checksum
How to use checksums
4c3d59f6bcb6a017827cd7bdf1a26a8e3866e04a04257ace82bcf96915a1d3cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 18, 2026.

Transparency log

Release files / loop_node-0.3.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl

Download URL loop_node-0.3.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Size 1.1 MB
Tags CPython 3.13 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
533f0ddda7daa23278fa80d6db3c71a124905357c853d6124af6086d293d0b1d
BLAKE2b-256 checksum
How to use checksums
f887aa8a4362e7a28756c76a5a85bf4ce01dea48a5809b75e5db8705c777393d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 18, 2026.

Transparency log

Release files / loop_node-0.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL loop_node-0.3.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 1.2 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
d79a9615a9dfe41ecbe0ef64a3137f04e479115483d6bbcba3ddfc6f70e0ae28
BLAKE2b-256 checksum
How to use checksums
8bbd238f38f2fdb9bc221e7f34e9e4afbbb982bc8eab1c54b22af155b863fd23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 18, 2026.

Transparency log

Release files / loop_node-0.3.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl

Download URL loop_node-0.3.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Size 1.1 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
cba027966f12dc11584cff6a572ec2a76e29b1239eb6fa79304d4c6fb3966255
BLAKE2b-256 checksum
How to use checksums
cdf7ad665fdb493ac475ed88dd5652ede22180b53efb4255c62c247c557bdb45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 18, 2026.

Transparency log

Release files / loop_node-0.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL loop_node-0.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 1.0 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
90c1f119763530a388b17380c2143697999f10e3e8dae4f0fb37b2138d230d2b
BLAKE2b-256 checksum
How to use checksums
8b95f512d778296f9bac2347f1c8a28e36f54078a93b466c32215631305ad4fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 18, 2026.

Transparency log

Release files / loop_node-0.3.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl

Download URL loop_node-0.3.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Size 943.4 kB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
0fddc598ae77a051474892b760d909fdf8b40d5e461b1d691304de39dd9388b6
BLAKE2b-256 checksum
How to use checksums
2fd85e01d72d7aeed3a19006ffe2a12e4bb749f1181e6dd20d29d6e63de45b78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 18, 2026.

Transparency log

Release files / loop_node-0.3.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL loop_node-0.3.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 978.1 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
b80a39b9751c14b986d0eff42d9a656376a229fb3df721cc25647055eb8918b1
BLAKE2b-256 checksum
How to use checksums
fec58c2d60494154959a0fb480f00ad127461c120e9da23de8523d066a7a6dab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 18, 2026.

Transparency log

Release files / loop_node-0.3.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl

Download URL loop_node-0.3.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Size 919.3 kB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
92b003ef18a6d28df9b71585fb6a842ec500ffc7fd51f27329ccdb887cc07165
BLAKE2b-256 checksum
How to use checksums
6abf4dcfa4cbfbf9efa01d8639d7b334e838f6ee249937cba9e95657c35490b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 18, 2026.

Transparency log

Security for loop-node 0.3.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 10 files in this release have been uploaded with provenance metadata.

Select from 10 files

Attestation for loop_node-0.3.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

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 Sep 18, 2026.

Transparency log

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.

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