aioitertools


Nameaioitertools JSON
Version 0.11.0 PyPI version JSON
download
home_pagehttps://aioitertools.omnilib.dev
Summaryitertools and builtins for AsyncIO and mixed iterables
upload_time2022-09-18 02:04:01
maintainerNone
docs_urlNone
authorAmethyst Reese
requires_python>=3.6
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            aioitertools
============

Implementation of itertools, builtins, and more for AsyncIO and mixed-type iterables.

[![documentation](https://readthedocs.org/projects/aioitertools/badge/?version=latest)](https://aioitertools.omnilib.dev)
[![version](https://img.shields.io/pypi/v/aioitertools.svg)](https://pypi.org/project/aioitertools)
[![changelog](https://img.shields.io/badge/change-log-blue)](https://aioitertools.omnilib.dev/en/latest/changelog.html)
[![license](https://img.shields.io/pypi/l/aioitertools.svg)](https://github.com/omnilib/aioitertools/blob/master/LICENSE)


Install
-------

aioitertools requires Python 3.6 or newer.
You can install it from PyPI:

    $ pip install aioitertools


Usage
-----

aioitertools shadows the standard library whenever possible to provide
asynchronous version of the modules and functions you already know.  It's
fully compatible with standard iterators and async iterators alike, giving
you one unified, familiar interface for interacting with iterable objects:

```python
from aioitertools import iter, next, map, zip

something = iter(...)
first_item = await next(something)

async for item in iter(something):
    ...


async def fetch(url):
    response = await aiohttp.request(...)
    return response.json

async for value in map(fetch, MANY_URLS):
    ...


async for a, b in zip(something, something_else):
    ...
```


aioitertools emulates the entire `itertools` module, offering the same
function signatures, but as async generators.  All functions support
standard iterables and async iterables alike, and can take functions or
coroutines:

```python
from aioitertools import chain, islice

async def generator1(...):
    yield ...

async def generator2(...):
    yield ...

async for value in chain(generator1(), generator2()):
    ...

async for value in islice(generator1(), 2, None, 2):
    ...
```


See [builtins.py][], [itertools.py][], and [more_itertools.py][] for full
documentation of functions and abilities.


License
-------

aioitertools is copyright [Amethyst Reese](https://noswap.com), and licensed under
the MIT license.  I am providing code in this repository to you under an open
source license.  This is my personal repository; the license you receive to
my code is from me and not from my employer. See the `LICENSE` file for details.


[builtins.py]: https://github.com/omnilib/aioitertools/blob/master/aioitertools/builtins.py
[itertools.py]: https://github.com/omnilib/aioitertools/blob/master/aioitertools/itertools.py
[more_itertools.py]: https://github.com/omnilib/aioitertools/blob/master/aioitertools/more_itertools.py

            

Raw data

            {
    "_id": null,
    "home_page": "https://aioitertools.omnilib.dev",
    "name": "aioitertools",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Amethyst Reese",
    "author_email": "amy@noswap.com",
    "download_url": "https://files.pythonhosted.org/packages/4a/e6/888e1d726f0846c84e14a0f2f57873819eff9278b394d632aed979c98fbd/aioitertools-0.11.0.tar.gz",
    "platform": null,
    "description": "aioitertools\n============\n\nImplementation of itertools, builtins, and more for AsyncIO and mixed-type iterables.\n\n[![documentation](https://readthedocs.org/projects/aioitertools/badge/?version=latest)](https://aioitertools.omnilib.dev)\n[![version](https://img.shields.io/pypi/v/aioitertools.svg)](https://pypi.org/project/aioitertools)\n[![changelog](https://img.shields.io/badge/change-log-blue)](https://aioitertools.omnilib.dev/en/latest/changelog.html)\n[![license](https://img.shields.io/pypi/l/aioitertools.svg)](https://github.com/omnilib/aioitertools/blob/master/LICENSE)\n\n\nInstall\n-------\n\naioitertools requires Python 3.6 or newer.\nYou can install it from PyPI:\n\n    $ pip install aioitertools\n\n\nUsage\n-----\n\naioitertools shadows the standard library whenever possible to provide\nasynchronous version of the modules and functions you already know.  It's\nfully compatible with standard iterators and async iterators alike, giving\nyou one unified,\u00a0familiar interface for interacting with iterable objects:\n\n```python\nfrom aioitertools import iter, next, map, zip\n\nsomething = iter(...)\nfirst_item = await next(something)\n\nasync for item in iter(something):\n    ...\n\n\nasync def fetch(url):\n    response = await aiohttp.request(...)\n    return response.json\n\nasync for value in map(fetch, MANY_URLS):\n    ...\n\n\nasync for a, b in zip(something, something_else):\n    ...\n```\n\n\naioitertools emulates the entire `itertools` module, offering the same\nfunction signatures, but as async generators.  All functions support\nstandard iterables and async iterables alike, and can take functions or\ncoroutines:\n\n```python\nfrom aioitertools import chain, islice\n\nasync def generator1(...):\n    yield ...\n\nasync def generator2(...):\n    yield ...\n\nasync for value in chain(generator1(), generator2()):\n    ...\n\nasync for value in islice(generator1(), 2, None, 2):\n    ...\n```\n\n\nSee [builtins.py][], [itertools.py][], and [more_itertools.py][] for full\ndocumentation of functions and abilities.\n\n\nLicense\n-------\n\naioitertools is copyright [Amethyst Reese](https://noswap.com), and licensed under\nthe MIT license.  I am providing code in this repository to you under an open\nsource license.  This is my personal repository; the license you receive to\nmy code is from me and not from my employer. See the `LICENSE` file for details.\n\n\n[builtins.py]: https://github.com/omnilib/aioitertools/blob/master/aioitertools/builtins.py\n[itertools.py]: https://github.com/omnilib/aioitertools/blob/master/aioitertools/itertools.py\n[more_itertools.py]: https://github.com/omnilib/aioitertools/blob/master/aioitertools/more_itertools.py\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "itertools and builtins for AsyncIO and mixed iterables",
    "version": "0.11.0",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "md5": "55a1c40739034559096cc8b3f59d1ccf",
                "sha256": "04b95e3dab25b449def24d7df809411c10e62aab0cbe31a50ca4e68748c43394"
            },
            "downloads": -1,
            "filename": "aioitertools-0.11.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "55a1c40739034559096cc8b3f59d1ccf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 23683,
            "upload_time": "2022-09-18T02:03:58",
            "upload_time_iso_8601": "2022-09-18T02:03:58.969642Z",
            "url": "https://files.pythonhosted.org/packages/45/66/d1a9fd8e6ff88f2157cb145dd054defb0fd7fe2507fe5a01347e7c690eab/aioitertools-0.11.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "md5": "a1e9708ecf5416b89f0c8e7b097fa72a",
                "sha256": "42c68b8dd3a69c2bf7f2233bf7df4bb58b557bca5252ac02ed5187bbc67d6831"
            },
            "downloads": -1,
            "filename": "aioitertools-0.11.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a1e9708ecf5416b89f0c8e7b097fa72a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 32053,
            "upload_time": "2022-09-18T02:04:01",
            "upload_time_iso_8601": "2022-09-18T02:04:01.924664Z",
            "url": "https://files.pythonhosted.org/packages/4a/e6/888e1d726f0846c84e14a0f2f57873819eff9278b394d632aed979c98fbd/aioitertools-0.11.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-09-18 02:04:01",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "aioitertools"
}
        
Elapsed time: 0.01163s