--- id: asgiref version: "3.12.1" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # asgiref — ASGI specs, helper code, and adapters License: permissive · Maintenance: active · Popularity: top 1,000 on PyPI ## Install pip install asgiref uv add asgiref poetry add asgiref ## Description asgiref ======= .. image:: https://github.com/django/asgiref/actions/workflows/tests.yml/badge.svg :target: https://github.com/django/asgiref/actions/workflows/tests.yml .. image:: https://img.shields.io/pypi/v/asgiref.svg :target: https://pypi.python.org/pypi/asgiref ASGI is a standard for Python asynchronous web apps and servers to communicate with each other, and positioned as an asynchronous successor to WSGI. You can read more at https://asgi.readthedocs.io/en/latest/ This package includes ASGI base libraries, such as: * Sync-to-async and async-to-sync function wrappers, ``asgiref.sync`` * Server base classes, ``asgiref.server`` * A WSGI-to-ASGI adapter, in ``asgiref.wsgi`` Function wrappers ----------------- These allow you to wrap or decorate async or sync functions to call them from the other style (so you can call async functions from a synchronous thread, or vice-versa). In particular: * AsyncToSync lets a synchronous subthread stop and wait while the async function is called on the main thread's event loop, and then control is returned to the thread when the async function is finished. * SyncToAsync lets async code call a synchronous function,... ## AI interpretation — verify before relying asgiref provides ASGI base libraries for building asynchronous Python web applications, including sync-to-async and async-to-sync function wrappers, server base classes, and a WSGI-to-ASGI adapter for bridging synchronous and asynchronous code. Verdict: asgiref is a production-stable, actively maintained library essential for bridging synchronous and asynchronous Python code in ASGI applications. Its low install friction, permissive BSD license, zero known vulnerabilities, and broad Python version support make it a reliable choice for async-first web frameworks and middleware. [View on SkillFed](https://skillfed.io/packages/asgiref) · [View on PyPI](https://pypi.org/project/asgiref/)