freshcrate
Home > Databases > asyncer

asyncer

Asyncer, async and await, focused on developer experience.

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

VersionChangesUrgencyDate
0.0.17Imported from PyPI (0.0.17)Low4/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](hLow2/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/dependabLow2/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) Low2/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:Low12/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). ### InteLow12/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] preLow10/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). * ⬆ BLow10/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 [#84Low8/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.Low4/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/aLow4/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).Low2/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.coLow1/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 [@ZhymabekRomanLow1/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/Low11/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). Low1/4/2022

Dependencies & License Audit

Loading dependencies...

Similar Packages

azure-storage-blobMicrosoft Azure Blob Storage Client Library for Pythonazure-template_0.1.0b6187637
azure-storage-file-shareMicrosoft Azure Azure File Share Storage Client Library for Pythonazure-template_0.1.0b6187637
mirakuruProcess executor (not only) for tests.3.0.2
opentelemetry-instrumentation-qdrantOpenTelemetry Qdrant instrumentation0.60.0
django-modelclusterDjango extension to allow working with 'clusters' of models as a single unit, independently of the database6.4.1