# asgiref

> ASGI base libraries for Python: sync-to-async wrappers, a WSGI-to-ASGI adapter and server base classes

Source: https://talira.ai/catalog/asgiref-q1gs1sw3
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / concurrency](https://talira.ai/categories/libraries/concurrency), [languages / python](https://talira.ai/categories/languages/python)
- Licence: BSD-3-Clause[^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Supports: [ASGI](https://talira.ai/standards/asgi.md)[^3]
- Backed by: [Django Software Foundation](https://talira.ai/orgs/django-software-foundation.md)
- Funding: non-profit[^4]

asgiref is the Django project's package of ASGI base libraries. ASGI is the standard for Python asynchronous web apps and servers to talk to each other, the async successor to WSGI, and asgiref's repository also holds its specification. The package has the AsyncToSync and SyncToAsync wrappers that let synchronous code call async functions and the other way round ([Django Channels](https://talira.ai/catalog/django-channels-xjrcjsp5.md) uses SyncToAsync to run Django's synchronous views inside an ASGI server), a thread-sensitive context, a drop-in replacement for threading.local that works across both styles, a WSGI-to-ASGI adapter and base classes for ASGI servers.

## Links

- GitHub: https://github.com/django/asgiref
- Docs: https://asgi.readthedocs.io/en/latest/

## Problems it solves

- call a synchronous Django ORM function from async Python code
- run my old WSGI app inside an ASGI server
- call an async function from synchronous Python code without blocking the event loop

## Features

- async_to_sync and sync_to_async function wrappers
- thread-sensitive contexts for grouping synchronous calls
- Local: a threading.local replacement that works with async code
- WsgiToAsgi adapter to run a WSGI app as an ASGI app
- base classes for ASGI servers

## Limitations

- The WSGI-to-ASGI adapter may not support every extended WSGI feature, such as file handles for incoming POST bodies[^1]

## Trust

Overall: 0.51 out of 1.
Signals: maintenance 0.52, adoption 0.64, momentum 0.34, community 0.84, backing 0.55, extensibility 0.00.

- last commit 38 days ago
- 10 commits in the last 90 days
- 1.6k GitHub stars
- 123 contributors
- backed by Django Software Foundation
- funding: non-profit

## Related

- Works with [Django Channels](https://talira.ai/catalog/django-channels-xjrcjsp5.md)

## Sources

[^1]: https://github.com/django/asgiref#readme (checked 28 Nov 2026)
[^2]: https://github.com/django/asgiref/blob/main/LICENSE (checked 28 Nov 2026)
[^3]: https://github.com/django/asgiref (checked 28 Nov 2026)
[^4]: https://www.djangoproject.com/foundation/ (checked 20 Nov 2026)
