# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= python-aiostream VERSION= 0.5.2 KEYWORDS= python VARIANTS= v11 v12 SDESC[v11]= Asynchronous iteration operators (3.11) SDESC[v12]= Asynchronous iteration operators (3.12) HOMEPAGE= https://github.com/vxgmichel/aiostream CONTACT= Python_Automaton[python@ironwolf.systems] DOWNLOAD_GROUPS= main SITES[main]= PYPIWHL/b3/2a/4140da24a81adce23b79e4fdc3fc722c9ff698460c1b9f8f7bd3742eb02e DISTFILE[1]= aiostream-0.5.2-py3-none-any.whl:main DF_INDEX= 1 SPKGS[v11]= single SPKGS[v12]= single OPTIONS_AVAILABLE= PY311 PY312 OPTIONS_STANDARD= none VOPTS[v11]= PY311=ON PY312=OFF VOPTS[v12]= PY311=OFF PY312=ON DISTNAME= aiostream-0.5.2.dist-info GENERATED= yes [PY311].RUN_DEPENDS_ON= python-typing-extensions:single:v11 [PY311].USES_ON= python:v11,wheel [PY312].RUN_DEPENDS_ON= python-typing-extensions:single:v12 [PY312].USES_ON= python:v12,wheel [FILE:3643:descriptions/desc.single] aiostream ========= :alt: :alt: :alt: :alt: :alt: Generator-based operators for asynchronous iteration Synopsis -------- aiostream_ provides a collection of stream operators that can be combined to create asynchronous pipelines of operations. It can be seen as an asynchronous version of itertools_, although some aspects are slightly different. Essentially, all the provided operators return a unified interface called a stream. A stream is an enhanced asynchronous iterable providing the following features: - **Operator pipe-lining** - using pipe symbol ``|`` - **Repeatability** - every iteration creates a different iterator - **Safe iteration context** - using async with and the stream method - **Simplified execution** - get the last element from a stream using await - **Slicing and indexing** - using square brackets ``[]`` - **Concatenation** - using addition symbol ``+`` Requirements ------------ The stream operators rely heavily on asynchronous generators (`PEP 525`_): - python >= 3.6 Stream operators ---------------- The `stream operators`_ are separated in 7 categories: +--------------------+---------------------------------------------------------------------------------------+ | **creation** | iterate_, preserve_, just_, call_, empty_, throw_, never_, repeat_, count_, range_ | +--------------------+---------------------------------------------------------------------------------------+ | **transformation** | map_, enumerate_, starmap_, cycle_, chunks_ | +--------------------+---------------------------------------------------------------------------------------+ | **selection** | take_, takelast_, skip_, skiplast_, getitem_, filter_, until_, takewhile_, dropwhile_ | +--------------------+---------------------------------------------------------------------------------------+ | **combination** | map_, zip_, merge_, chain_, ziplatest_ | +--------------------+---------------------------------------------------------------------------------------+ | **aggregation** | accumulate_, reduce_, list_ | +--------------------+---------------------------------------------------------------------------------------+ | **advanced** | concat_, flatten_, switch_, concatmap_, flatmap_, switchmap_ | +--------------------+---------------------------------------------------------------------------------------+ | **timing** | spaceout_, timeout_, delay_ | +--------------------+---------------------------------------------------------------------------------------+ | **miscellaneous** | action_, print_ | +--------------------+---------------------------------------------------------------------------------------+ Demonstration ------------- The following example demonstrates most of the streams capabilities: .. sourcecode:: python import asyncio from aiostream import stream, pipe async def main(): # Create a counting stream with a 0.2 seconds interval xs = stream.count(interval=0.2) # Operators can be piped using '|' ys = xs | pipe.map(lambda x: x**2) # Streams can be sliced zs = ys[1:10:2] # Use a stream context for proper resource management async with zs.stream() as streamer: # Asynchronous iteration async for z in streamer: [FILE:111:distinfo] 054660370be9d37f6fe3ece3851009240416bd082e469fd90cc8673d3818cf71 39486 aiostream-0.5.2-py3-none-any.whl