asyncio-anywhere
Python package that makes it easy to run fast asyncio code
Are you trying to run async code in Python and getting the error
asyncio.run() cannot be called from a running event loop?
This package makes it easy to run asyncio-based async code in tricky execution environments:
- IPython-based notebooks (JupyterLab, AWS Sagemaker, Databricks, etc)
- trio applications
- curio applications
Other Features:
- Use uvloop for faster i/o - but without permanently changing the asyncio event loop policy
- Run any code which uses asyncio I/O.
- Type hints to support type-aware IDEs
Non-Features:
- asyncio-anywhere does not monkey-patch the asyncio module. This avoids unexpected side-effects and potential future bugs.
Usage
pip install asyncio-anywhere
import asyncio
from asyncio_anywhere import asyncio_run
async def myfunc():
await asyncio.sleep(0.01)
return "OK"
result = asyncio_run(myfunc())
print(result)
Use asyncio_run() anywhere where you would normally have run asyncio.run(). Note that it also accepts a boolean debug parameter as the second parameter.
Metadata
Release files for asyncio-anywhere 0.2.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 |
|---|---|---|---|---|
| asyncio_anywhere-0.2.0.tar.gz | 3.6 kB | Without provenance | Details for asyncio_anywhere-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| asyncio_anywhere-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for asyncio_anywhere-0.2.0-py3-none-any.whl |
Total release size: 7.9 kB
Release files / asyncio_anywhere-0.2.0.tar.gz
| Download URL | asyncio_anywhere-0.2.0.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5edcf2299978571c35e1b108d8b319a94192bd033037725a191ff317ca0da3c0
|
|
BLAKE2b-256 checksum How to use checksums |
ddb73f112a13354727538147119987dcb77bc619b46c325ea6c96c30c48f0a69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.9.18 Darwin/22.6.0
|
Release files / asyncio_anywhere-0.2.0-py3-none-any.whl
| Download URL | asyncio_anywhere-0.2.0-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9cd0b9c5408dfb1334509f881f027ab118847b55bfd6226377531fbfe144c8be
|
|
BLAKE2b-256 checksum How to use checksums |
5c01533fb8dfb1933676450fb4a8746ad929dcbeebe20faf916870942527c02e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.9.18 Darwin/22.6.0
|
Security for asyncio-anywhere 0.2.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.