The aioitertools.itertools module provides asynchronous versions of the standard itertools functions. These are used to perform complex manipulations on asynchronous iterables.
Available functions include:
accumulate(iterable, func=operator.add, *, initial=None)batched(iterable, n)chain(*iterables)combinations(iterable, r)combinations_with_replacement(iterable, r)compress(data, selectors)count(start=0, step=1)cycle(iterable)dropwhile(predicate, iterable)filterfalse(predicate, iterable)groupby(iterable, key=None)islice(iterable, stop)permutations(iterable, r=None)product(*iterables)repeat(object, times=None)starmap(func, iterable)takewhile(predicate, iterable)tee(iterable, n=2)zip_longest(*iterables, fillvalue=None)
from aioitertools.itertools import accumulate, batched, chain, combinations, combinations_with_replacement, compress, count, cycle, dropwhile, filterfalse, groupby, islice, permutations, product, repeat, starmap, takewhile, tee, zip_longest
# Example usage (assuming an async iterable 'async_iter')
# async for item in islice(async_iter, 5):
# print(item)