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.4.tar.gz (7.1 kB view hashes)

Uploaded Source

Built Distribution

aiterio-0.1.4-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

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