Skip to main content

Miscellaneous extensions for Trio, the friendly async I/O library

Project description

Latest PyPI version Automated test status Documentation status Test coverage Code style: black Checked with mypy

This is a library of extensions to Trio, the friendly Python library for async concurrency and I/O.

Currently we have:

  • a readers-writer lock (tricycle.RWLock)

  • slightly higher-level stream wrappers (tricycle.BufferedReceiveStream and tricycle.TextReceiveStream)

  • some tools for managing cancellation (tricycle.open_service_nursery() and tricycle.MultiCancelScope)

  • a way to make objects that want to keep background tasks running during the object’s lifetime (tricycle.BackgroundObject and the more general tricycle.ScopedObject)

  • an analog of ContextVar that is inherited through the task tree rather than across start_soon() calls, and thus provides more safety for accessing a resource that is being managed by a parent task (tricycle.TreeVar)

While we won’t release known-broken code, and we strive for cleanliness and good test coverage, please be advised that tricycle is mostly one person’s box of tools and has not necessarily been reviewed or tested to Trio’s standards. It is being used in production, and API churn has been minimal thus far although we’re not making any firm stability guarantees. If you find that it doesn’t meet your needs, feel free to let us know and we’ll endeavor to improve things.

tricycle is tested on Linux, Windows, and macOS, on CPython versions 3.8 through 3.12. It will probably work on PyPy as well.

License and history

tricycle is licensed under your choice of the MIT or Apache 2.0 license. See LICENSE for details.

This library has its origins in a package of utilities that the author wrote at Hudson River Trading while building things for them with Trio. Many thanks to HRT for supporting open source in this way!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tricycle-0.4.1.tar.gz (41.6 kB view details)

Uploaded Source

Built Distribution

tricycle-0.4.1-py3-none-any.whl (35.3 kB view details)

Uploaded Python 3

File details

Details for the file tricycle-0.4.1.tar.gz.

File metadata

  • Download URL: tricycle-0.4.1.tar.gz
  • Upload date:
  • Size: 41.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for tricycle-0.4.1.tar.gz
Algorithm Hash digest
SHA256 f56edb4b3e1bed3e2552b1b499b24a2dab47741e92e9b4d806acc5c35c9e6066
MD5 5264812acedfba45af02421727144a6c
BLAKE2b-256 f88efdd7bc467b40eedd0a5f2ed36b0d692c6e6f2473be00c8160e2e9f53adc1

See more details on using hashes here.

File details

Details for the file tricycle-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: tricycle-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 35.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for tricycle-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 67900995a73e7445e2c70250cdca04a778d9c3923dd960a97ad4569085e0fb3f
MD5 a9a107ac1dafb7b23e63d921e92be551
BLAKE2b-256 d7c67cc05d60e21c683df99167db071ce5d848f5063c2a63971a8443466f603e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page