Getting started
import asyncio
from nodina import AsyncNodinaAgent, Scope, scalar_node
@scalar_node
class Hello:
@classmethod
async def __compose__(cls) -> str:
return "Hello,"
@scalar_node
class World:
@classmethod
async def __compose__(cls) -> str:
return "World!"
async def main() -> None:
agent = AsyncNodinaAgent.build({Hello, World})
mapped_scopes = {}
async with Scope(detail="local") as local_scope:
await agent.run(local_scope, mapped_scopes)
print(local_scope[Hello], local_scope[World])
asyncio.run(main())
How it works
nodina is a small DAG scheduler for nodnod
graphs, built as a Cython extension over a tiny native pthread work
pool. It ships two agents:
AsyncNodinaAgentresolves the dependency graph on the running asyncio event loop — one task per node, so independentasyncnodes (and any node that awaits real I/O) run concurrently.NodinaAgentresolves it synchronously, dispatching independent nodes onto a shared pthread pool (nodina/core/nodina_pool.c). The pool's queueing and waiting run without the GIL — theGILis held only inside each__compose__call. A lone ready node with nothing else in flight composes inline to skip a thread hand-off.
Both pick the first successful SequentialEither / ConcurrentEither
candidate in declared order; ConcurrentEither composes all of its candidates
concurrently, SequentialEither composes them lazily. Neither cancels losing
candidates.
Performance & the GIL, honestly
backend_name() returns "cython". The thread pool overlaps nodes that
release the GIL (blocking I/O, time.sleep, C extensions). On a normal
CPython build, CPU-bound __compose__ work still serializes on the GIL —
that is a property of the interpreter, not of nodina.
On a free-threaded build (python3.14t, PEP 703) the GIL is gone and the
pool runs CPU-bound nodes truly in parallel. The extension declares
freethreading_compatible, so importing it does not re-enable the GIL:
# 8 independent CPU nodes, 8-node graph, 11-core machine
python3.14 (GIL): 8 nodes = 206 ms speedup vs serial 1.0x
python3.14t (no GIL): 8 nodes = 40 ms speedup vs serial 5.1x
python -m benchmarks.bench # vs a pure-Python reference
python3.14t -m benchmarks.freethreading_demo # CPU parallelism with the GIL off
The benchmark suite in benchmarks/ measures nodina against a
~150-line pure-Python reference scheduler. nodina ties or beats it on every case
(deep chains and small graphs 3-4x faster); see
benchmarks/RESULTS.md and
benchmarks/BASELINE.md.
Metadata
Release files for nodina 1.0.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 | |
|---|---|---|---|
| nodina-1.0.0.tar.gz | 170.8 kB | Details |
Built distributions (wheels)
Total release size: 3.5 MB
Release files / nodina-1.0.0.tar.gz
| Download URL | nodina-1.0.0.tar.gz |
|---|---|
| Size | 170.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
730c061c762935fa054da16459f4852e5e78177b47ab1a7d42a96d43c825e278
|
|
BLAKE2b-256 checksum How to use checksums |
048d72af5b430f2c4c2ad46a2fcfb4895098376cf6ac18db89583d1ad007421c
|
| 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 Jun 27, 2026.
Transparency logRelease files / nodina-1.0.0-cp314-cp314-win_amd64.whl
| Download URL | nodina-1.0.0-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 257.8 kB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
783f15497eb507251b78818934b752bf4d198f7d8a70e8d46a0becc924943fea
|
|
BLAKE2b-256 checksum How to use checksums |
a0e4c731b46dc05b8648662444c22f54b45cd35c648d5cfee00bb202108bb974
|
| 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 Jun 27, 2026.
Transparency logRelease files / nodina-1.0.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | nodina-1.0.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 873.6 kB |
| Tags | CPython 3.14 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
cad4810402bbd834238e9cb86bc6720e207001b8053741f7f5ad25e5b2cc12d0
|
|
BLAKE2b-256 checksum How to use checksums |
53bcd4570ac1f2d05ed4369b22990313e6a3fe934980cd55285d8ad8f90a716d
|
| 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 Jun 27, 2026.
Transparency logRelease files / nodina-1.0.0-cp314-cp314-macosx_11_0_arm64.whl
| Download URL | nodina-1.0.0-cp314-cp314-macosx_11_0_arm64.whl |
|---|---|
| Size | 272.1 kB |
| Tags | CPython 3.14 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
9d56820295b414df24e3bdc8160c27b87995b81ef3a422c293bb31568a8a8a8b
|
|
BLAKE2b-256 checksum How to use checksums |
6d101102275c18a7e8fa2b8646db39abff405994fcaa47279b93eeaf53b9be4e
|
| 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 Jun 27, 2026.
Transparency logRelease files / nodina-1.0.0-cp314-cp314-macosx_10_15_x86_64.whl
| Download URL | nodina-1.0.0-cp314-cp314-macosx_10_15_x86_64.whl |
|---|---|
| Size | 276.6 kB |
| Tags | CPython 3.14 macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
b8c9fabe7916e46224e656c86386e981c59470c615749de5d7e73c0bae31fa3b
|
|
BLAKE2b-256 checksum How to use checksums |
9d92cb8c7fa07f2ba952f616e4be08d6ccef2028704de82185b9f1f928a422b9
|
| 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 Jun 27, 2026.
Transparency logRelease files / nodina-1.0.0-cp313-cp313-win_amd64.whl
| Download URL | nodina-1.0.0-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 254.7 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
46d4fda9ed2948290bfe7a269607f31c8fe266db87c13c0cede17ba88bb57494
|
|
BLAKE2b-256 checksum How to use checksums |
779aeec91b3293d40b6fe58c150febfbfa18d38b4550bf0bafa469376479b443
|
| 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 Jun 27, 2026.
Transparency logRelease files / nodina-1.0.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | nodina-1.0.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 883.3 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
604519cccf84bdc847a6e1afb18f8785280918bcfb61dd2ef420a6a2f1460858
|
|
BLAKE2b-256 checksum How to use checksums |
ec09c7aac21906b7356f697ae8648afb99212fcc21fb9e00bf37c413c304c49e
|
| 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 Jun 27, 2026.
Transparency logRelease files / nodina-1.0.0-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | nodina-1.0.0-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 268.7 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
07964ed435415f0c859a7515b728131da726a7e1b15e25dbe2e93f4b84719725
|
|
BLAKE2b-256 checksum How to use checksums |
e96925e54a394291822a0617c476c012e2b64d41009317e0c3952db10be3c5d4
|
| 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 Jun 27, 2026.
Transparency logRelease files / nodina-1.0.0-cp313-cp313-macosx_10_13_x86_64.whl
| Download URL | nodina-1.0.0-cp313-cp313-macosx_10_13_x86_64.whl |
|---|---|
| Size | 273.3 kB |
| Tags | CPython 3.13 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
209401ff98babcb6e4cc10a44139eb1d7148a7667d5d8a332404a13b73f74281
|
|
BLAKE2b-256 checksum How to use checksums |
08e4680c807cc04b94f8992afa203a89a3e5d83fb04e2a37e376ea7f762c7f4d
|
| 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 Jun 27, 2026.
Transparency log