Skip to main content

AsyncIterator based connectable components

Project description

aiterio

tl;dr

aiterio is a minimal library to build asynchronous pipelines based on Python's asynchronous iterators.

It transforms a syntax like:

aiterator_3(aiterator_2(aiterator_1(source_data)))

or

aiterator_1 = fn_1(source_data)
aiterator_2 = fn_2(aiterator_1)
aiterator_3 = fn_3(aiterator_3)

async for item in aiterator_3:
    pass

into

await Component1().source(source_data).then(Component2()).then(Component3()).run()
# or
for item in Component1().source(source_data).then(Component2()).then(Component3()):
    pass

Why use this?

  • Minimal library without dependencies
  • Simplifies usage of asynchronous iterators
  • Makes it easy to create components with a single responsibility and to test them
  • Built-in shutdown logic

Alternatives / Inspiration

  • License: MIT

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

aiterio-0.1.6.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

aiterio-0.1.6-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file aiterio-0.1.6.tar.gz.

File metadata

  • Download URL: aiterio-0.1.6.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for aiterio-0.1.6.tar.gz
Algorithm Hash digest
SHA256 fbe0b43003c3c927858778d34e15461ffc6128e467f24ce5789bc54fd3f5e68a
MD5 3e7dfbe323599ebc5eaf6750c5a6fbe6
BLAKE2b-256 b82f669ecefe743134c1a2a5de12bb1262c262ef073f05263fd38cd34dd80eee

See more details on using hashes here.

File details

Details for the file aiterio-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: aiterio-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for aiterio-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a3de3616082b3b7c42fb2c78e287823ac365f4a4715440a56e9eb6753bebfd4f
MD5 34ad608aa8e87caac5ded735d27d1dc3
BLAKE2b-256 488dfc2015686d639983a3e1f8d6d25f13705b314282b5b9b75ed8e424964a04

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