{"library":"anyio","type":"library","category":null,"description":"AnyIO is a high-level asynchronous networking and concurrency library that runs on top of either asyncio or Trio, implementing Trio-like structured concurrency on both backends. Code written against AnyIO's API runs unmodified on either backend, allowing incremental adoption. Current stable version is 4.13.0, with an active monthly-ish release cadence under Alex Grönholm (agronholm).","language":"python","status":"active","version":"4.13.0","tags":["async","concurrency","asyncio","trio","structured-concurrency","networking","threads","task-group"],"last_verified":"Tue Jun 09","install":[{"cmd":"pip install anyio","imports":["import anyio\nanyio.run(main)","from anyio import create_task_group\nasync with create_task_group() as tg:\n    tg.start_soon(fn)","from anyio import create_memory_object_stream\nsend, recv = create_memory_object_stream[int](max_buffer_size=10)","from anyio.from_thread import start_blocking_portal\nwith start_blocking_portal() as portal:\n    portal.call(async_fn)","from anyio import to_thread\nawait to_thread.run_sync(blocking_fn, abandon_on_cancel=True)","from anyio import CancelScope\nwith CancelScope(deadline=...) as scope:\n    ...","from anyio import Path\npath = Path('/tmp/file')\ncontent = await path.read_text()","from anyio import get_cancelled_exc_class\ntry:\n    await something()\nexcept get_cancelled_exc_class():\n    raise"]},{"cmd":"pip install anyio[trio]","imports":[]},{"cmd":"pip install anyio[trio] pytest-anyio","imports":[]}],"homepage":null,"github":"https://github.com/agronholm/anyio","docs":"https://anyio.readthedocs.io/en/latest/","changelog":"https://anyio.readthedocs.io/en/stable/versionhistory.html","pypi":"https://pypi.org/project/anyio/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":2.5,"avg_import_s":0.24,"wheel_type":"wheel"},"url":"https://checklist.day/v1/registry/anyio/compatibility"}}