python-aiostream
Port variant py310
Summary Asynchronous iteration operators (3.10)
Package version 0.4.5
Homepage https://github.com/vxgmichel/aiostream
Keywords python
Maintainer Python Automaton
License Not yet specified
Other variants v11
Ravenports Buildsheet | History
Ravensource Port Directory | History
Last modified 23 JAN 2023, 06:04:31 UTC
Port created 10 DEC 2022, 14:08:04 UTC
Subpackage Descriptions
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:
Configuration Switches (platform-specific settings discarded)
PY310 ON Build using Python 3.10 PY311 OFF Build using Python 3.11
Package Dependencies by Type
Build (only) python-pip:single:py310
autoselect-python:single:standard
Build and Runtime python310:single:standard
Download groups
main mirror://PYPIWHL/4a/29/d94dc724b543d0ff16e177a3ce4eaa6253afb6350aa7ba372a8fe7e01f20
Distribution File Information
25b7c2d9c83570d78c0ef5a20e949b7d0b8ea3b0b0a4f22c49d3f721105a6057 35632 aiostream-0.4.5-py3-none-any.whl
Ports that require python-aiostream:py310
python-vdirsyncer:py310 Synchronize calendars and contacts (3.10)