anyio

High level asynchronous concurrency and networking framework that works on top of either Trio or asyncio

Latest version: 4.10.0 registry icon
Maintenance score
100
Safety score
100
Popularity score
74
Check your open source dependency risks. Get immediate insight about security, stability and licensing risks.
Security
  Vulnerabilities
Version Suggest Low Medium High Critical
4.10.0 0 0 0 0 0
4.9.0 0 0 0 0 0
4.8.0 0 0 0 0 0
4.7.0 0 0 0 0 0
4.6.2.post1 0 0 0 0 0
4.6.2 0 0 0 0 0
4.6.1 0 0 0 0 0
4.6.0 0 0 0 0 0
4.5.2 0 0 0 0 0
4.5.1 0 0 0 0 0
4.5.0 0 0 0 0 0
4.4.0 0 0 0 0 0
4.3.0 0 0 0 0 0
4.2.0 0 0 0 0 0
4.1.0 0 0 0 0 0
4.0.0rc1 0 0 0 0 0
4.0.0 0 0 0 0 0
3.7.1 0 0 0 0 0
3.7.0rc1 0 0 0 0 0
3.7.0 0 0 0 0 0
3.6.2 0 0 0 0 0
3.6.1 0 0 0 0 0
3.6.0 0 0 0 0 0
3.5.0 0 0 0 0 0
3.4.0 0 0 0 0 0
3.3.4 0 0 0 0 0
3.3.3 0 0 0 0 0
3.3.2 0 0 0 0 0
3.3.1 0 0 0 0 0
3.3.0 0 0 0 0 0
3.2.1 0 0 0 0 0
3.2.0 0 0 0 0 0
3.1.0 0 0 0 0 0
3.0.1 0 0 0 0 0
3.0.0rc4 0 0 0 0 0
3.0.0rc3 0 0 0 0 0
3.0.0rc2 0 0 0 0 0
3.0.0rc1 0 0 0 0 0
3.0.0 0 0 0 0 0
2.2.0 0 0 0 0 0
2.1.0 0 0 0 0 0
2.0.2 0 0 0 0 0
2.0.1 0 0 0 0 0
2.0.0rc2 0 0 0 0 0
2.0.0rc1 0 0 0 0 0
2.0.0b2 0 0 0 0 0
2.0.0b1 0 0 0 0 0
2.0.0 0 0 0 0 0
1.4.0 0 0 0 0 0
1.3.1 0 0 0 0 0
1.3.0 0 0 0 0 0
1.2.3 0 0 0 0 0
1.2.2 0 0 0 0 0
1.2.1 0 0 0 0 0
1.2.0 0 0 0 0 0
1.1.0 0 0 0 0 0
1.0.0rc2 0 0 0 0 0
1.0.0rc1 0 0 0 0 0
1.0.0b2 0 0 0 0 0
1.0.0b1 0 0 0 0 0
1.0.0a2 0 0 0 0 0
1.0.0a1 0 0 0 0 0
1.0.0 0 0 0 0 0

Stability
Latest release:

4.10.0 - This version is safe to use because it has no known security vulnerabilities at this time. Find out if your coding project uses this component and get notified of any reported security vulnerabilities with Meterian-X Open Source Security Platform

Licensing

Maintain your licence declarations and avoid unwanted licences to protect your IP the way you intended.

MIT   -   MIT License

Not a wildcard

Not proprietary

OSI Compliant



.. image:: https://github.com/agronholm/anyio/actions/workflows/test.yml/badge.svg :target: https://github.com/agronholm/anyio/actions/workflows/test.yml :alt: Build Status .. image:: https://coveralls.io/repos/github/agronholm/anyio/badge.svg?branch=master :target: https://coveralls.io/github/agronholm/anyio?branch=master :alt: Code Coverage .. image:: https://readthedocs.org/projects/anyio/badge/?version=latest :target: https://anyio.readthedocs.io/en/latest/?badge=latest :alt: Documentation .. image:: https://badges.gitter.im/gitterHQ/gitter.svg :target: https://gitter.im/python-trio/AnyIO :alt: Gitter chat

AnyIO is an asynchronous networking and concurrency library that works on top of either asyncio_ or Trio_. It implements Trio-like structured concurrency_ (SC) on top of asyncio and works in harmony with the native SC of Trio itself.

Applications and libraries written against AnyIO's API will run unmodified on either asyncio_ or Trio_. AnyIO can also be adopted into a library or application incrementally – bit by bit, no full refactoring necessary. It will blend in with the native libraries of your chosen backend.

To find out why you might want to use AnyIO's APIs instead of asyncio's, you can read about it here <https://anyio.readthedocs.io/en/stable/why.html>_.

Documentation

View full documentation at: https://anyio.readthedocs.io/

Features

AnyIO offers the following functionality:

  • Task groups (nurseries_ in trio terminology)

  • High-level networking (TCP, UDP and UNIX sockets)

    • Happy eyeballs_ algorithm for TCP connections (more robust than that of asyncio on Python 3.8)
    • async/await style UDP sockets (unlike asyncio where you still have to use Transports and Protocols)
  • A versatile API for byte streams and object streams

  • Inter-task synchronization and communication (locks, conditions, events, semaphores, object streams)

  • Worker threads

  • Subprocesses

  • Asynchronous file I/O (using worker threads)

  • Signal handling

AnyIO also comes with its own pytest_ plugin which also supports asynchronous fixtures. It even works with the popular Hypothesis_ library.

.. _asyncio: https://docs.python.org/3/library/asyncio.html .. _Trio: https://github.com/python-trio/trio .. _structured concurrency: https://en.wikipedia.org/wiki/Structured_concurrency .. _nurseries: https://trio.readthedocs.io/en/stable/reference-core.html#nurseries-and-spawning .. _Happy eyeballs: https://en.wikipedia.org/wiki/Happy_Eyeballs .. _pytest: https://docs.pytest.org/en/latest/ .. _Hypothesis: https://hypothesis.works/