Description
<p align="center"> <a href="https://asyncer.tiangolo.com"><img src="https://asyncer.tiangolo.com/img/logo-margin/logo-margin-vector.svg" alt="Asyncer"></a> </p> <p align="center"> <em>Asyncer, async and await, focused on developer experience.</em> </p> <p align="center"> <a href="https://github.com/fastapi/asyncer/actions?query=workflow%3ATest+event%3Apush+branch%3Amain" target="_blank"> <img src="https://github.com/fastapi/asyncer/actions/workflows/test.yml/badge.svg?event=push&branch=main" alt="Test"> </a> <a href="https://github.com/fastapi/asyncer/actions?query=workflow%3APublish" target="_blank"> <img src="https://github.com/fastapi/asyncer/actions/workflows/publish.yml/badge.svg" alt="Publish"> </a> <a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/fastapi/asyncer" target="_blank"> <img src="https://coverage-badge.samuelcolvin.workers.dev/fastapi/asyncer.svg" alt="Coverage"> <a href="https://pypi.org/project/asyncer" target="_blank"> <img src="https://img.shields.io/pypi/v/asyncer?color=%2334D058&label=pypi%20package" alt="Package version"> </a> </p> --- **Documentation**: <a href="https://asyncer.tiangolo.com" target="_blank">https://asyncer.tiangolo.com</a> **Source Code**: <a href="https://github.com/fastapi/asyncer" target="_blank">https://github.com/fastapi/asyncer</a> --- **Asyncer** is a small library built on top of <a href="https://anyio.readthedocs.io/en/stable/" class="external-link" target="_blank">AnyIO</a>. **Asyncer** has a small number of utility functions that allow working with `async`, `await`, and concurrent code in a more convenient way under my (<a href="https://twitter.com/tiangolo" class="external-link" target="_blank">@tiangolo - SebastiΓ‘n RamΓrez</a>) very opinionated and subjective point of view. The main goal of **Asyncer** is to improve **developer experience** by providing better support for **autocompletion** and **inline errors** in the editor, and **more certainty** that the code is **bug-free** by providing better support for type checking tools like **mypy**. **Asyncer** also tries to improve **convenience** and simplicity when working with **async** code **mixed** with regular <abbr title="synchronous code, code that is not async">**blocking code**</abbr>, allowing to use them together in a simpler way... again, under my very **subjective** point of view. ## Can I Use It? Yes π (but continue reading). This is a very small library, there are things that can change and improve in the future. If you use it, **pin the exact Asyncer version** for your project, to make sure it all works. Have **tests** for your project (as you should, anyway). And **upgrade the version** once you know that the new version continues to work correctly. Still, it's **just 4 functions**, so there's not much to change, if you had to refactor your code to update something it would not be much. And if you don't want to add `asyncer` as a dependency to your project, you can also just copy the main file and try out those functions, it's quite small (but in that case you won't get updates easily). ## Requirements As **Asyncer** is based on **AnyIO** it will be also installed automatically when you install **Asyncer**. ## Installation <div class="termy"> ```console $ pip install asyncer ---> 100% Successfully installed asyncer anyio ``` </div> ## How to Use You can read more about each of the use cases and utility functions in **Asyncer** in the <a href="https://asyncer.tiangolo.com/tutorial/" class="external-link" target="_blank">tutorial</a>. As a sneak preview of one of the utilities, you can **call sync code from async code** using `asyncify()`: ```Python import time import anyio from asyncer import asyncify def do_sync_work(name: str): time.sleep(1) return f"Hello, {name}" async def main(): message = await asyncify(do_sync_work)(name="World") print(message) anyio.run(main) ``` **Asyncer**'s `asyncify()` will use AnyIO underneath to do *the smart thing*, avoid blocking the main **async** event loop, and run the **sync**/blocking function in a **worker thread**. ### Editor Support Everything in **Asyncer** is designed to get the best **developer experience** possible, with the best editor support. * **Autocompletion** for function arguments: <img class="shadow" src="https://asyncer.tiangolo.com/img/tutorial/asyncify/image01.png"> * **Autocompletion** for return values: <img class="shadow" src="https://asyncer.tiangolo.com/img/tutorial/asyncify/image02.png"> * **Inline errors** in editor: <img class="shadow" src="https://asyncer.tiangolo.com/img/tutorial/soonify/image02.png"> * Support for tools like **mypy**, that can help you verify that your **code is correct**, and prevent many bugs. ## License This project is licensed under the terms of the [MIT license](https://github.com/fastapi/asyncer/blob/main/LICENSE).
Release History
| Version | Changes | Urgency | Date |
|---|---|---|---|
| 0.0.17 | Imported from PyPI (0.0.17) | Low | 4/21/2026 |
| 0.0.15 | ### Breaking Changes * β Drop support for Python 3.9. PR [#476](https://github.com/fastapi/asyncer/pull/476) by [@tiangolo](https://github.com/tiangolo). ### Internal * π¨ Update script to generate source examples, migrate from Python 3.9 to Python 3.10. PR [#478](https://github.com/fastapi/asyncer/pull/478) by [@tiangolo](https://github.com/tiangolo). * π· Remove min-max testing of AnyIO, covered by uv resolution. PR [#477](https://github.com/fastapi/asyncer/pull/477) by [@tiangolo](h | Low | 2/20/2026 |
| 0.0.14 | ### Internal * π· Run tests with lower bound uv sync, upgrade `pytest` minimum dependency pin. PR [#464](https://github.com/fastapi/asyncer/pull/464) by [@YuriiMotov](https://github.com/YuriiMotov). * β¬ Bump prek from 0.3.2 to 0.3.3. PR [#471](https://github.com/fastapi/asyncer/pull/471) by [@dependabot[bot]](https://github.com/apps/dependabot). * β¬ Bump typer from 0.23.0 to 0.23.1. PR [#470](https://github.com/fastapi/asyncer/pull/470) by [@dependabot[bot]](https://github.com/apps/dependab | Low | 2/16/2026 |
| 0.0.13 | ### Docs * π Update management-tasks.md to be in line with management-tasks.md in FastAPI repo. PR [#462](https://github.com/fastapi/asyncer/pull/462) by [@YuriiMotov](https://github.com/YuriiMotov). * π Add contribution instructions about LLM generated code and comments and automated tools for PRs. PR [#449](https://github.com/fastapi/asyncer/pull/449) by [@alejsdev](https://github.com/alejsdev). * π Fix copy button in `custom.js`. PR [#448](https://github.com/fastapi/asyncer/pull/448) | Low | 2/11/2026 |
| 0.0.12 | ### Breaking Changes * β Drop support for Python 3.8. PR [#441](https://github.com/fastapi/asyncer/pull/441) by [@tiangolo](https://github.com/tiangolo). ### Docs * π Update code examples to Python 3.9. PR [#442](https://github.com/fastapi/asyncer/pull/442) by [@YuriiMotov](https://github.com/YuriiMotov). * π Relax the warnings as I have been using Asyncer in production for a while (and other teams as well). PR [#424](https://github.com/fastapi/asyncer/pull/424) by [@tiangolo](https: | Low | 12/26/2025 |
| 0.0.11 | ### Fixes * π Add `sniffio` dependency to project requirements. PR [#421](https://github.com/fastapi/asyncer/pull/421) by [@jujumilk3](https://github.com/jujumilk3). ### Docs * π Update docs to use `markdown-include-variants`. PR [#419](https://github.com/fastapi/asyncer/pull/419) by [@YuriiMotov](https://github.com/YuriiMotov). * π Update CSS to explicitly use emoji font. PR [#420](https://github.com/fastapi/asyncer/pull/420) by [@tiangolo](https://github.com/tiangolo). ### Inte | Low | 12/1/2025 |
| 0.0.10 | ### Upgrades * β¬οΈ Add support for Python 3.14. PR [#387](https://github.com/fastapi/asyncer/pull/387) by [@svlandeg](https://github.com/svlandeg). ### Internal * β¬ Bump astral-sh/setup-uv from 6 to 7. PR [#386](https://github.com/fastapi/asyncer/pull/386) by [@dependabot[bot]](https://github.com/apps/dependabot). * β¬ Bump ruff from 0.13.2 to 0.13.3. PR [#383](https://github.com/fastapi/asyncer/pull/383) by [@dependabot[bot]](https://github.com/apps/dependabot). * β¬ [pre-commit.ci] pre | Low | 10/20/2025 |
| 0.0.9 | ### Fixes * π½οΈ Ensure compatibility with AnyIO 4.11.0. PR [#381](https://github.com/fastapi/asyncer/pull/381) by [@svlandeg](https://github.com/svlandeg). ### Docs * π©Ί Take the GH badge only from pushes to the `main` branch. PR [#284](https://github.com/fastapi/asyncer/pull/284) by [@svlandeg](https://github.com/svlandeg). ### Internal * π₯ Remove unused Poetry config file. PR [#382](https://github.com/fastapi/asyncer/pull/382) by [@tiangolo](https://github.com/tiangolo). * β¬ B | Low | 10/1/2025 |
| 0.0.8 | ### Refactors * β»οΈ Deprecate `asyncify(cancellable=True)` in favor of `asyncify(abandon_on_cancel=True)`, following AnyIO 4.1.0. PR [#202](https://github.com/fastapi/asyncer/pull/202) by [@tiangolo](https://github.com/tiangolo). * β»οΈ Import `anyio.from_thread` and `anyio.to_thread` explicitly. PR [#201](https://github.com/fastapi/asyncer/pull/201) by [@tiangolo](https://github.com/tiangolo). * β»οΈ Update `asyncify` to wrap the function with `functools.wraps` like the other functions. PR [#84 | Low | 8/24/2024 |
| 0.0.7 | ### Internal * π§ Add configs for `asyncer-slim`. PR [#152](https://github.com/tiangolo/asyncer/pull/152) by [@tiangolo](https://github.com/tiangolo). In the future Asyncer can include the standard default recommended packages, and `asyncer-slim` can come without those recommended standard packages and with a group of optional dependencies `asyncer-slim[standard]`, equivalent to `asyncer`, for those that want to opt out of those packages. | Low | 4/30/2024 |
| 0.0.6 | ### Internal * β¬ [pre-commit.ci] pre-commit autoupdate. PR [#122](https://github.com/tiangolo/asyncer/pull/122) by [@pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci). * β¬ Bump dorny/paths-filter from 2 to 3. PR [#118](https://github.com/tiangolo/asyncer/pull/118) by [@dependabot[bot]](https://github.com/apps/dependabot). * β¬ Bump dawidd6/action-download-artifact from 2.28.0 to 3.1.4. PR [#137](https://github.com/tiangolo/asyncer/pull/137) by [@dependabot[bot]](https://github.com/a | Low | 4/30/2024 |
| 0.0.5 | ### Fixes * π Fix `syncify` with `raise_sync_error=False` on AnyIO 4.x.x, do not start new event loops unnecessarily. PR [#130](https://github.com/tiangolo/asyncer/pull/130) by [@tiangolo](https://github.com/tiangolo). ### Internal * π· Update Publish CI Python version to 3.11. PR [#120](https://github.com/tiangolo/asyncer/pull/120) by [@tiangolo](https://github.com/tiangolo). | Low | 2/22/2024 |
| 0.0.4 | ### Docs * π Update docstring for `syncify()`, fix name of parameter `raise_sync_error` (remove unused parameter name `check_called_from_async`). PR [#113](https://github.com/tiangolo/asyncer/pull/113) by [@giladsheffer](https://github.com/giladsheffer). ### Internal * π§ Add Ruff config. PR [#112](https://github.com/tiangolo/asyncer/pull/112) by [@tiangolo](https://github.com/tiangolo). * π§ Adopt Ruff for formatting and linting and upgrade internal tools. PR [#111](https://github.co | Low | 1/28/2024 |
| 0.0.3 | ### Features * β¨ Export (import and re-export) `TaskGroup` from `asyncer`. PR [#87](https://github.com/tiangolo/asyncer/pull/87) by [@MarkParker5](https://github.com/MarkParker5). * β¨ Add support for AnyIO 4.x, drop support for Python 3.7. PR [#90](https://github.com/tiangolo/asyncer/pull/90) by [@khiemdoan](https://github.com/khiemdoan). ### Fixes * π Add missing dependency `typing_extensions` for Python < 3.10. PR [#89](https://github.com/tiangolo/asyncer/pull/89) by [@ZhymabekRoman | Low | 1/23/2024 |
| 0.0.2 | ### Features * β¨ Add compatibility with the next (unreleased) version of AnyIO (4.x.x), with `get_asynclib` utility. PR [#48](https://github.com/tiangolo/asyncer/pull/48) by [@tiangolo](https://github.com/tiangolo). ### Docs * β Fix link to FastAPI and Friends newsletter. PR [#13](https://github.com/tiangolo/asyncer/pull/13) by [@JonasKs](https://github.com/JonasKs). * β Fix typo in `docs/tutorial/first-steps.md`, from `asyncio` to `anyio`. PR [#11](https://github.com/tiangolo/asyncer/ | Low | 11/4/2022 |
| 0.0.1 | * First release. π ### Docs * β Fix typo in index and README. PR [#4](https://github.com/tiangolo/asyncer/pull/4) by [@sanders41](https://github.com/sanders41). | Low | 1/4/2022 |
