Name | aioitertools JSON |
Version |
0.12.0
JSON |
| download |
home_page | None |
Summary | itertools and builtins for AsyncIO and mixed iterables |
upload_time | 2024-09-02 03:33:40 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | None |
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.8 or newer.
You can install it from PyPI:
```sh
$ 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": null,
"name": "aioitertools",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Amethyst Reese <amethyst@n7.gg>",
"download_url": "https://files.pythonhosted.org/packages/06/de/38491a84ab323b47c7f86e94d2830e748780525f7a10c8600b67ead7e9ea/aioitertools-0.12.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.8 or newer.\nYou can install it from PyPI:\n\n```sh\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\n",
"bugtrack_url": null,
"license": null,
"summary": "itertools and builtins for AsyncIO and mixed iterables",
"version": "0.12.0",
"project_urls": {
"Documentation": "https://aioitertools.omnilib.dev",
"Github": "https://github.com/omnilib/aioitertools"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "851358b70a580de00893223d61de8fea167877a3aed97d4a5e1405c9159ef925",
"md5": "cbc1b3a35f71f371c3e8dc6b78e78373",
"sha256": "fc1f5fac3d737354de8831cbba3eb04f79dd649d8f3afb4c5b114925e662a796"
},
"downloads": -1,
"filename": "aioitertools-0.12.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cbc1b3a35f71f371c3e8dc6b78e78373",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 24345,
"upload_time": "2024-09-02T03:34:59",
"upload_time_iso_8601": "2024-09-02T03:34:59.454421Z",
"url": "https://files.pythonhosted.org/packages/85/13/58b70a580de00893223d61de8fea167877a3aed97d4a5e1405c9159ef925/aioitertools-0.12.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "06de38491a84ab323b47c7f86e94d2830e748780525f7a10c8600b67ead7e9ea",
"md5": "16916c7da11f5d66ff2f0ddafc35e063",
"sha256": "c2a9055b4fbb7705f561b9d86053e8af5d10cc845d22c32008c43490b2d8dd6b"
},
"downloads": -1,
"filename": "aioitertools-0.12.0.tar.gz",
"has_sig": false,
"md5_digest": "16916c7da11f5d66ff2f0ddafc35e063",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 19369,
"upload_time": "2024-09-02T03:33:40",
"upload_time_iso_8601": "2024-09-02T03:33:40.349269Z",
"url": "https://files.pythonhosted.org/packages/06/de/38491a84ab323b47c7f86e94d2830e748780525f7a10c8600b67ead7e9ea/aioitertools-0.12.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-02 03:33:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "omnilib",
"github_project": "aioitertools",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "aioitertools"
}