noaio
Run (some) coroutine functions synchronously.
Usage
Coroutine functions can be checked for syncifiability with can_syncify. Functions that contain any await, async with, or async for expression are not syncifiable. If they are, wrap them in syncify to run them as regular synchronous functions.
from noaio import syncify, can_syncify
async def func_without_await():
return 1
can_syncify(func_without_await) == True
syncify(func_without_await)() == 1
async def func_with_await():
await asyncio.sleep(0)
return 1
can_syncify(func_with_await) == False
syncify(func_with_await) ## ValueError
How can I break it?
can_syncify checks the AST of the function you provide it. If it contains any await, async with or async for opcodes at the root level (immediately executed), it will return False.
syncify wraps the provided async function in a synchronous one that drives the coroutine to completion using .send, catching the iteration error and returning the result.
The library is typed, and expects you to use it in compliance with its type signatures.
Metadata
Release files for noaio 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 | Provenance | Actions |
|---|---|---|---|---|
| noaio-1.0.0.tar.gz | 2.5 kB | Without provenance | Details for noaio-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| noaio-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for noaio-1.0.0-py3-none-any.whl |
Total release size: 5.4 kB
Release files / noaio-1.0.0.tar.gz
| Download URL | noaio-1.0.0.tar.gz |
|---|---|
| Size | 2.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f4916adc504f9f7fac7edc377741c0c1ad637e10d4807688dd24c1f8fe9c6826
|
|
BLAKE2b-256 checksum How to use checksums |
bafacfc62a90486cf12b3234946d73aa69af70978855a3e35cf74b4f79ef6cb5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / noaio-1.0.0-py3-none-any.whl
| Download URL | noaio-1.0.0-py3-none-any.whl |
|---|---|
| Size | 2.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
71da8d2f1e78993085c5a85e8e6e1c24a9bec80c6ac74e3de6f1e2d1d7819567
|
|
BLAKE2b-256 checksum How to use checksums |
11e4e4a5047b361e56790865da539ad88cb550b096b1656e64632fbd6579253d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for noaio 1.0.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.
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.