Debian Codegraph @

docs/source/awesome-trio-libraries.rst

raw
1 Awesome Trio Libraries
2 ======================
3
4 .. List of Trio Libraries
5
6 A list of libraries that support Trio, similar to the awesome-python
7 list here: https://github.com/vinta/awesome-python/
8
9
10 .. currentmodule:: trio
11
12 You have completed the tutorial, and are enthusiastic about building
13 great new applications and libraries with async functionality.
14 However, to get much useful work done you will want to use some of
15 the great libraries that support Trio-flavoured concurrency. This list
16 is not complete, but gives a starting point. Another great way to find
17 Trio-compatible libraries is to search on PyPI for the ``Framework :: Trio``
18 tag -> `PyPI Search <https://pypi.org/search/?c=Framework+%3A%3A+Trio>`__
19
20
21 Getting Started
22 ---------------
23 * `cookiecutter-trio <https://github.com/python-trio/cookiecutter-trio>`__ - This is a cookiecutter template for Python projects that use Trio. It makes it easy to start a new project, by providing a bunch of preconfigured boilerplate.
24 * `pytest-trio <https://github.com/python-trio/pytest-trio>`__ - Pytest plugin to test async-enabled Trio functions.
25 * `sphinxcontrib-trio <https://github.com/python-trio/sphinxcontrib-trio>`__ - Make Sphinx better at documenting Python functions and methods. In particular, it makes it easy to document async functions.
26
27
28 Web and HTML
29 ------------
30 * `httpx <https://www.python-httpx.org/>`__ - HTTPX is a fully featured HTTP client for Python 3, which provides sync and async APIs, and support for both HTTP/1.1 and HTTP/2.
31 * `trio-websocket <https://github.com/HyperionGray/trio-websocket>`__ - A WebSocket client and server implementation striving for safety, correctness, and ergonomics.
32 * `quart-trio <https://github.com/pgjones/quart-trio>`__ - Like Flask, but for Trio. A simple and powerful framework for building async web applications and REST APIs. Tip: this is an ASGI-based framework, so you'll also need an HTTP server with ASGI support.
33 * `hypercorn <https://github.com/pgjones/hypercorn>`__ - An HTTP server for hosting your ASGI apps. Supports HTTP/1.1, HTTP/2, HTTP/3, and Websockets. Can be run as a standalone server, or embedded in a larger Trio app. Use it with ``quart-trio``, or any other Trio-compatible ASGI framework.
34 * `DeFramed <https://github.com/smurfix/deframed>`__ - DeFramed is a Web non-framework that supports a 99%-server-centric approach to Web coding, including support for the `Remi <https://github.com/dddomodossola/remi>`__ GUI library.
35 * `pura <https://github.com/groove-x/pura>`__ - A simple web framework for embedding realtime graphical visualization into Trio apps, enabling inspection and manipulation of program state during development.
36 * `pyscalpel <https://scalpel.readthedocs.io/en/latest/>`__ - A fast and powerful webscraping library.
37 * `muffin <https://github.com/klen/muffin>`_ - Muffin is a fast, simple ASGI web-framework
38 * `asgi-tools <https://github.com/klen/asgi-tools>`_ - Tools to quickly build lightest ASGI apps (also contains a test client with lifespan, websocket support)
39 * `starlette <https://github.com/encode/starlette>`_ - The little ASGI framework that shines.
40
41
42 Database
43 --------
44
45 * `triopg <https://github.com/python-trio/triopg>`__ - PostgreSQL client for Trio based on asyncpg.
46 * `trio-mysql <https://github.com/python-trio/trio-mysql>`__ - Pure Python MySQL Client.
47 * `sqlalchemy_aio <https://github.com/RazerM/sqlalchemy_aio>`__ - Add asyncio and Trio support to SQLAlchemy core, derived from alchimia.
48 * `redio <https://github.com/Tronic/redio>`__ - Redis client, pure Python and Trio.
49 * `trio_redis <https://github.com/omnidots/trio_redis>`__ - A Redis client for Trio. Depends on hiredis-py.
50 * `asyncakumuli <https://github.com/M-o-a-T/asyncakumuli>`__ - Client for the `Akumuli <https://akumuli.org/>`__ time series database.
51 * `aio-databases <https://github.com/klen/aio-databases>`_ - Async Support for various databases (triopg, trio-mysql)
52 * `peewee-aio <https://github.com/klen/peewee-aio>`_ - Peewee Async ORM with trio support (triopg, trio-mysql).
53 * `coredis <https://github.com/alisaifee/coredis>`_ - Fast, async, fully-typed Redis client with support for cluster and sentinel
54
55
56 IOT
57 ---
58 * `DistMQTT <https://github.com/M-o-a-T/distmqtt>`__ - DistMQTT is an open source MQTT client and broker implementation. It is a fork of hbmqtt with support for anyio and DistKV.
59 * `asyncgpio <https://github.com/python-trio/trio-gpio>`__ - Allows easy access to the GPIO pins on your Raspberry Pi or similar embedded computer.
60 * `asyncowfs <https://github.com/M-o-a-T/asyncowfs>`__ - High-level, object-oriented access to 1wire sensors and actors.
61 * `DistKV <https://github.com/M-o-a-T/distkv>`__ - a persistent, distributed, master-less key/value storage with async notification and some IoT-related plug-ins.
62
63
64 Building Command Line Apps
65 --------------------------
66 * `trio-click <https://github.com/python-trio/trio-click>`__ - Python composable command line utility, trio-compatible version.
67 * `urwid <https://github.com/urwid/urwid>`__ - Urwid is a console user interface library for Python.
68
69
70 Building GUI Apps
71 -----------------
72 * `QTrio <https://qtrio.readthedocs.io/en/stable/>`__ - Integration between Trio and either the PyQt or PySide Qt wrapper libraries. Uses Trio's :ref:`guest mode <guest-mode>`.
73
74
75 Multi-Core/Multiprocessing
76 --------------------------
77 * `tractor <https://github.com/goodboy/tractor>`__ - An experimental, trionic (aka structured concurrent) "actor model" for distributed multi-core Python.
78 * `Trio run_in_process <https://github.com/ethereum/trio-run-in-process>`__ - Trio based API for running code in a separate process.
79 * `trio-parallel <https://trio-parallel.readthedocs.io/>`__ - CPU parallelism for Trio
80
81
82 Stream Processing
83 -----------------
84 * `Slurry <https://github.com/andersea/slurry>`__ - Slurry is a microframework for building reactive, data processing applications with Trio.
85
86
87 Distributed Task Queue
88 ----------------------
89 * `streaQ <https://github.com/tastyware/streaq>`_ - Fast, async, fully-typed distributed task queue via Redis streams
90
91
92 RPC
93 ---
94 * `purepc <https://github.com/python-trio/purerpc>`__ - Native, async Python gRPC client and server implementation using anyio.
95
96
97 Testing
98 -------
99 * `pytest-trio <https://github.com/python-trio/pytest-trio>`__ - Pytest plugin for trio.
100 * `hypothesis-trio <https://github.com/python-trio/hypothesis-trio>`__ - Hypothesis supports Trio out of the box for
101 ``@given(...)`` tests; this extension provides Trio-compatible stateful testing.
102 * `trustme <https://github.com/python-trio/trustme>`__ - #1 quality TLS certs while you wait, for the discerning tester.
103 * `pytest-aio <https://github.com/klen/pytest-aio>`_ - Pytest plugin with support for trio, curio, asyncio
104 * `logot <https://github.com/etianen/logot>`_ - Test whether your async code is logging correctly.
105
106
107 Tools and Utilities
108 -------------------
109 * `trio-util <https://github.com/groove-x/trio-util>`__ - An assortment of utilities for the Trio async/await framework.
110 * `flake8-async <https://github.com/python-trio/flake8-async>`__ - Highly opinionated linter for various sorts of problems in Trio, AnyIO and/or asyncio. Can run as a flake8 plugin, or standalone with support for autofixing some errors.
111 * `tricycle <https://github.com/oremanj/tricycle>`__ - This is a library of interesting-but-maybe-not-yet-fully-proven extensions to Trio.
112 * `tenacity <https://github.com/jd/tenacity>`__ - Retrying library for Python with async/await support.
113 * `perf-timer <https://github.com/belm0/perf-timer>`__ - A code timer with Trio async support (see ``TrioPerfTimer``). Collects execution time of a block of code excluding time when the coroutine isn't scheduled, such as during blocking I/O and sleep. Also offers ``trio_perf_counter()`` for low-level timing.
114 * `aiometer <https://github.com/florimondmanca/aiometer>`__ - Execute lots of tasks concurrently while controlling concurrency limits
115 * `triotp <https://linkdd.github.io/triotp>`__ - OTP framework for Python Trio
116 * `aioresult <https://github.com/arthur-tacca/aioresult>`__ - Get the return value of a background async function in Trio or anyio, along with a simple Future class and wait utilities
117 * `aiologic <https://github.com/x42005e1f/aiologic>`__ - Thread-safe synchronization and communication primitives: locks, capacity limiters, queues, etc.
118 * `culsans <https://github.com/x42005e1f/culsans>`__ - Janus-like sync-async queue with Trio support. Unlike aiologic queues, provides API compatible interfaces.
119
120
121 Trio/Asyncio Interoperability
122 -----------------------------
123 * `anyio <https://github.com/agronholm/anyio>`__ - AnyIO is a asynchronous compatibility API that allows applications and libraries written against it to run unmodified on asyncio or trio.
124 * `sniffio <https://github.com/python-trio/sniffio>`__ - This is a tiny package whose only purpose is to let you detect which async library your code is running under.
125 * `trio-asyncio <https://github.com/python-trio/trio-asyncio>`__ - Trio-Asyncio lets you use many asyncio libraries from your Trio app.