Skip to main content

Asyncer

Asyncer, async and await, focused on developer experience.

Test Coverage Package version


Documentation: https://asyncer.tiangolo.com

Source Code: https://github.com/fastapi/asyncer


Asyncer is a small library built on top of AnyIO.

Asyncer has a small number of utility functions that allow working with async, await, and concurrent code in a more convenient way under my (@tiangolo - Sebastián Ramírez) 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 blocking code, 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

First, install uv, and then add Asyncer to your project:

$ uv add asyncer
---> 100%

If you prefer to use pip, install asyncer inside a virtual environment. See the installation guide for the alternative steps.

How to Use

You can read more about each of the use cases and utility functions in Asyncer in the tutorial.

As a sneak preview of one of the utilities, you can call sync code from async code using asyncify():

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:
  • Autocompletion for return values:
  • Inline errors in editor:
  • 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.

Metadata

Release files for asyncer 0.0.19

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asyncer 0.0.19
File Size Uploaded Provenance Actions
asyncer-0.0.19.tar.gz 24.5 kB Without provenance Details for asyncer-0.0.19.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for asyncer 0.0.19
File Interpreter ABI Platform Actions
asyncer-0.0.19-py3-none-any.whl Python 3 none any Details for asyncer-0.0.19-py3-none-any.whl

Total release size: 36.7 kB

Release files / asyncer-0.0.19.tar.gz

Download URL asyncer-0.0.19.tar.gz
Size 24.5 kB
Tags Source
SHA-256 checksum
How to use checksums
fac6af37829fce28fab77a5ce5930ea01331c9bd4ed20df0822f59e200bcc386
BLAKE2b-256 checksum
How to use checksums
ae9679e267240ba87a4332551aba788a11372041eb6826d1d7a8a7d075c4545a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / asyncer-0.0.19-py3-none-any.whl

Download URL asyncer-0.0.19-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
602b4ae1e78af697d3fafd3f8e1ca55b4e94419ca05919b5a72f905bd933da7b
BLAKE2b-256 checksum
How to use checksums
66252ef67627bbd34bab5dc6f0637fbac2c43116a9b2ad4103d4e92f72e53be8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for asyncer 0.0.19

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page