Skip to main content

noio

noio brings together two big ideas: that many IO operations can support callers waiting on multiple things at once without compromise, and that IO can be abstracted across ordinary functions and coroutines.

Use select to wait for the first of several selectable operations to complete. Use routine to support ordinary and coroutine calls with one interface.

Wait for the first operation to complete

Queues provide selectable get and put methods. Ordinary calls wait for values from each queue in turn:

from noio import Queue

primary = Queue[str]()
secondary = Queue[str]()

# Producers in other threads or tasks put values into these queues.
primary_value = primary.get()
secondary_value = secondary.get()

The first call waits for primary, even if secondary already has data available. Use select to get a value from whichever queue can deliver first:

from noio.select import select

index, value = select(
    primary.get.select(),
    secondary.get.select(),
)

If primary wins, index is 0 and value comes from primary. If secondary wins, index is 1 and value comes from secondary. The other queue keeps its values for a later get. See selection and queues for usage.

Support ordinary and coroutine calls

Coroutines are an advanced feature that should be avoided wherever reasonable. When writing a new library, start with regular functions, which are able to support threads and green threads. It might look something like this:

import noio

def greeting(name: str) -> str:
    noio.sleep(0.1)
    return f"Hello, {name}!"

assert greeting("world") == "Hello, world!"

When it's important for your function to also support coroutine libraries like asyncio, trio and anyio, update it to look like something like this:

import asyncio
import noio

@noio.routine
async def greeting(name: str) -> str:
    await noio.sleep.a(0.1)
    return f"Hello, {name}!"

@noio.routine
async def introduction(name: str) -> str:
    return await greeting.a(name)

assert greeting("world") == "Hello, world!"
assert introduction("world") == "Hello, world!"
assert asyncio.run(introduction.a("world")) == "Hello, world!"

When existing callers call your function the same way they used to, it will work without modification because it will drive the coroutine implementation to completion directly. Other routines will await a new .a() version that allows the run loop to handle scheduling.

Finding all the places to convert can be tricky, so noio will raise an error if a routine implementation calls another routine with a regular function call.

See routines for usage and customization.

Contributing

Before making changes, read CONTRIBUTING.md.

Metadata

Release files for noio 0.3

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

Source distribution (sdist)

Source distribution for noio 0.3
File Size Uploaded Provenance Actions
noio-0.3.tar.gz 78.7 kB With provenance Details for noio-0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for noio 0.3
File Interpreter ABI Platform Actions
noio-0.3-py3-none-any.whl Python 3 none any Details for noio-0.3-py3-none-any.whl

Total release size: 174.5 kB

Release files / noio-0.3.tar.gz

Download URL noio-0.3.tar.gz
Size 78.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3f8645b6f501178fa3ea6759e1600e7a56d0abe8959b70420bbcbf39524e18bf
BLAKE2b-256 checksum
How to use checksums
777aa8ccba4ef60c3839d2c8cbd03a54ed99968879d3a25d57ee4f61771bbe55
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 Nov 3, 2026.

Transparency log

Release files / noio-0.3-py3-none-any.whl

Download URL noio-0.3-py3-none-any.whl
Size 95.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de2e82677a4bfcfa90a3a5614f20b37920a24732ac1203060359ef885cf19daf
BLAKE2b-256 checksum
How to use checksums
0f7293d4a4d456ce3f5fd546cbb13740e642bec0d8e6508485a24a3d846b9385
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 Nov 3, 2026.

Transparency log

Security for noio 0.3

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for noio-0.3.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 3, 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