# aioplus
[![PyPI Version][shields/pypi/version]][pypi/homepage]
[![PyPI Downloads][shields/pypi/downloads]][pypi/homepage]
[![License][shields/pypi/license]][github/license]
[![Python Version][shields/python/version]][pypi/homepage]
[![Documentation][shields/readthedocs]][docs/aioplus]
## Key Features
* `builtins`, `itertools` and `more-itertools` - but asynchronous;
* Seamless *sync*-*async* bridging (`awaitify`, `anextify`, etc.);
* Early returns never cause unawaited coroutine warnings.
## Getting Started
### Installation
The library is available as [`aioplus`][pypi/homepage] on PyPI:
```shell
pip install aioplus
```
### Usage
#### *CallerThreadExecutor*
For more, see the [documentation][docs/aioplus/CallerThreadExecutor].
```python
>>> executor = CallerThreadExecutor()
>>> loop = asyncio.new_event_loop()
>>> loop.set_default_executor(executor)
```
#### *aall*
For more, see the [documentation][docs/aioplus/aall].
```python
>>> aiterable = arange(23)
>>> await aall(aiterable)
False
```
#### *aany*
For more, see the [documentation][docs/aioplus/aany].
```python
>>> aiterable = arange(23)
>>> await aany(aiterable)
True
```
#### *abatched*
For more, see the [documentation][docs/aioplus/abatched].
```python
>>> aiterable = arange(23)
>>> [batch async for batch in abatched(aiterable, n=3)]
[(0, 1, 2), (3, 4, 5), ..., (18, 19, 20), (21, 22)]
```
#### *acount*
For more, see the [documentation][docs/aioplus/acount].
```python
>>> [num async for num in acount(start=23, step=4)]
[23, 27, 31, 35, 39, 43, 47, ...]
```
#### *acycle*
For more, see the [documentation][docs/aioplus/acycle].
```python
>>> aiterable = arange(23)
>>> [num async for num in acycle(aiterable)]
[0, 1, ..., 22, 23, 0, 1, ..., 22, 23, ...]
```
#### *aempty*
For more, see the [documentation][docs/aioplus/aempty].
```python
>>> aiterable = arange(23)
>>> await aempty(aiterable)
False
```
#### *aenumerate*
For more, see the [documentation][docs/aioplus/aenumerate].
```python
>>> aiterable = arange(4, 23)
>>> [(index, num) async for index, num in aenumerate(aiterable)]
[(0, 4), (1, 5), (2, 6), (3, 7), ..., (17, 21), (18, 22)]
```
#### *afirst*
For more, see the [documentation][docs/aioplus/afirst].
```python
>>> aiterable = arange(23)
>>> await afirst(aiterable)
0
```
#### *ahead*
For more, see the [documentation][docs/aioplus/ahead].
```python
>>> aiterable = arange(23)
>>> [num async for num in ahead(aiterable, n=4)]
[0, 1, 2, 3]
```
#### *aislice*
For more, see the [documentation][docs/aioplus/aislice].
```python
>>> aiterable = arange(2003)
>>> [num async for num in aislice(aiterable, 4, 23)]
[4, 5, 6, 7, 8, ..., 20, 21, 22]
```
#### *alast*
For more, see the [documentation][docs/aioplus/alast].
```python
>>> aiterable = arange(23)
>>> await alast(aiterable)
22
```
#### *alen*
For more, see the [documentation][docs/aioplus/alen].
```python
>>> aiterable = arange(23)
>>> await alen(aiterable)
23
```
#### *amax*
For more, see the [documentation][docs/aioplus/amax].
```python
>>> aiterable = arange(23)
>>> await amax(aiterable)
22
```
#### *amin*
For more, see the [documentation][docs/aioplus/amin].
```python
>>> aiterable = arange(23)
>>> await amin(aiterable)
0
```
#### *aminmax*
For more, see the [documentation][docs/aioplus/aminmax].
```python
>>> aiterable = arange(23)
>>> await aminmax(aiterable)
(0, 22)
```
#### *anextify*
For more, see the [documentation][docs/aioplus/anextify].
```python
>>> iterable = [0, 1, 2, 3, 4, 5]
>>> aiterable = anextify(iterable)
>>> [num async for num in aiterable]
[0, 1, 2, 3, 4, 5]
```
#### *anth*
For more, see the [documentation][docs/aioplus/anth].
```python
>>> aiterable = arange(23)
>>> await anth(aiterable, n=4)
4
```
#### *apairwise*
For more, see the [documentation][docs/aioplus/apairwise].
```python
>>> aiterable = arange(23)
>>> [pair async for pair in apairwise(aiterable)]
[(0, 1), (1, 2), (2, 3), ..., (20, 21), (21, 22)]
```
#### *arange*
For more, see the [documentation][docs/aioplus/arange].
```python
>>> [num async for num in arange(23)]
[0, 1, 2, 3, 4, ..., 19, 20, 21, 22]
```
#### *arepeat*
For more, see the [documentation][docs/aioplus/arepeat].
```python
>>> [num async for num in arepeat(23, times=4)]
[23, 23, 23, 23]
```
#### *areversed*
For more, see the [documentation][docs/aioplus/areversed].
```python
>>> aiterable = arange(23)
>>> [num async for num in areversed(aiterable)]
[22, 21, 20, 19, 18, ..., 4, 3, 2, 1, 0]
```
#### *asum*
For more, see the [documentation][docs/aioplus/asum].
```python
>>> aiterable = arange(23)
>>> await asum(aiterable)
253
```
#### *atail*
For more, see the [documentation][docs/aioplus/atail].
```python
>>> aiterable = arange(23)
>>> [num async for num in atail(aiterable, n=4)]
[19, 20, 21, 22]
```
#### atriplewise
For more, see the [documentation][docs/aioplus/atriplewise].
```python
>>> aiterable = arange(23)
>>> [triplet async for triplet in atriplewise(aiterable)]
[(0, 1, 2), (1, 2, 3), ..., (19, 20, 21), (20, 21, 22)]
```
#### *awaitify*
For more, see the [documentation][docs/aioplus/awaitify].
```python
>>> aprint = awaitify(print)
>>> await aprint("4 -> 23")
4 -> 23
```
#### awindowed
For more, see the [documentation][docs/aioplus/awindowed].
```python
>>> aiterable = arange(23)
>>> [window async for window in awindowed(aiterable, n=3)]
[(0, 1, 2), (1, 2, 3), ..., (19, 20, 21), (20, 21, 22)]
```
## License
MIT License, Copyright (c) 2025 Sergei Y. Bogdanov. See [LICENSE][github/license] file.
<!-- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -->
[docs/aioplus]: https://aioplus.readthedocs.io/
[docs/aioplus/CallerThreadExecutor]: https://aioplus.readthedocs.io/en/latest/CallerThreadExecutor.html
[docs/aioplus/aall]: https://aioplus.readthedocs.io/en/latest/aall.html
[docs/aioplus/aany]: https://aioplus.readthedocs.io/en/latest/aany.html
[docs/aioplus/abatched]: https://aioplus.readthedocs.io/en/latest/abatched.html
[docs/aioplus/acount]: https://aioplus.readthedocs.io/en/latest/acount.html
[docs/aioplus/acycle]: https://aioplus.readthedocs.io/en/latest/acycle.html
[docs/aioplus/aempty]: https://aioplus.readthedocs.io/en/latest/aempty.html
[docs/aioplus/aenumerate]: https://aioplus.readthedocs.io/en/latest/aenumerate.html
[docs/aioplus/afirst]: https://aioplus.readthedocs.io/en/latest/afirst.html
[docs/aioplus/ahead]: https://aioplus.readthedocs.io/en/latest/ahead.html
[docs/aioplus/aislice]: https://aioplus.readthedocs.io/en/latest/aislice.html
[docs/aioplus/alast]: https://aioplus.readthedocs.io/en/latest/alast.html
[docs/aioplus/alen]: https://aioplus.readthedocs.io/en/latest/alen.html
[docs/aioplus/amax]: https://aioplus.readthedocs.io/en/latest/amax.html
[docs/aioplus/amin]: https://aioplus.readthedocs.io/en/latest/amin.html
[docs/aioplus/aminmax]: https://aioplus.readthedocs.io/en/latest/aminmax.html
[docs/aioplus/anextify]: https://aioplus.readthedocs.io/en/latest/anextify.html
[docs/aioplus/anth]: https://aioplus.readthedocs.io/en/latest/anth.html
[docs/aioplus/apairwise]: https://aioplus.readthedocs.io/en/latest/apairwise.html
[docs/aioplus/arange]: https://aioplus.readthedocs.io/en/latest/arange.html
[docs/aioplus/arepeat]: https://aioplus.readthedocs.io/en/latest/arepeat.html
[docs/aioplus/areversed]: https://aioplus.readthedocs.io/en/latest/areversed.html
[docs/aioplus/asum]: https://aioplus.readthedocs.io/en/latest/asum.html
[docs/aioplus/atail]: https://aioplus.readthedocs.io/en/latest/atail.html
[docs/aioplus/atriplewise]: https://aioplus.readthedocs.io/en/latest/atriplewise.html
[docs/aioplus/awaitify]: https://aioplus.readthedocs.io/en/latest/awaitify.html
[docs/aioplus/awindowed]: https://aioplus.readthedocs.io/en/latest/awindowed.html
[github/license]: https://github.com/syubogdanov/aioplus/tree/main/LICENSE
[pypi/homepage]: https://pypi.org/project/aioplus/
[shields/pypi/downloads]: https://img.shields.io/pypi/dm/aioplus.svg?color=green
[shields/pypi/license]: https://img.shields.io/pypi/l/aioplus.svg?color=green
[shields/pypi/version]: https://img.shields.io/pypi/v/aioplus.svg?color=green
[shields/python/version]: https://img.shields.io/pypi/pyversions/aioplus.svg?color=green
[shields/readthedocs]: https://img.shields.io/readthedocs/aioplus?style=flat&color=green
Raw data
{
"_id": null,
"home_page": "https://github.com/syubogdanov/aioplus",
"name": "aioplus",
"maintainer": "Sergei Y. Bogdanov",
"docs_url": null,
"requires_python": "<3.14,>=3.11",
"maintainer_email": "syubogdanov@outlook.com",
"keywords": "async, asyncio, builtins, concurrency, concurrent, executor, futures, iteration, iterator, itertools, python, python3, stdlib",
"author": "Sergei Y. Bogdanov",
"author_email": "syubogdanov@outlook.com",
"download_url": "https://files.pythonhosted.org/packages/85/17/cbf4c46f13f59cbc0118e68ab4bf7872854c89512d64fcf619d08ed390ef/aioplus-0.6.0.tar.gz",
"platform": null,
"description": "# aioplus\n\n[![PyPI Version][shields/pypi/version]][pypi/homepage]\n[![PyPI Downloads][shields/pypi/downloads]][pypi/homepage]\n[![License][shields/pypi/license]][github/license]\n[![Python Version][shields/python/version]][pypi/homepage]\n[![Documentation][shields/readthedocs]][docs/aioplus]\n\n## Key Features\n\n* `builtins`, `itertools` and `more-itertools` - but asynchronous;\n* Seamless *sync*-*async* bridging (`awaitify`, `anextify`, etc.);\n* Early returns never cause unawaited coroutine warnings.\n\n## Getting Started\n\n### Installation\n\nThe library is available as [`aioplus`][pypi/homepage] on PyPI:\n\n```shell\npip install aioplus\n```\n\n### Usage\n\n#### *CallerThreadExecutor*\n\nFor more, see the [documentation][docs/aioplus/CallerThreadExecutor].\n\n```python\n>>> executor = CallerThreadExecutor()\n>>> loop = asyncio.new_event_loop()\n>>> loop.set_default_executor(executor)\n```\n\n#### *aall*\n\nFor more, see the [documentation][docs/aioplus/aall].\n\n```python\n>>> aiterable = arange(23)\n>>> await aall(aiterable)\nFalse\n```\n\n#### *aany*\n\nFor more, see the [documentation][docs/aioplus/aany].\n\n```python\n>>> aiterable = arange(23)\n>>> await aany(aiterable)\nTrue\n```\n\n#### *abatched*\n\nFor more, see the [documentation][docs/aioplus/abatched].\n\n```python\n>>> aiterable = arange(23)\n>>> [batch async for batch in abatched(aiterable, n=3)]\n[(0, 1, 2), (3, 4, 5), ..., (18, 19, 20), (21, 22)]\n```\n\n#### *acount*\n\nFor more, see the [documentation][docs/aioplus/acount].\n\n```python\n>>> [num async for num in acount(start=23, step=4)]\n[23, 27, 31, 35, 39, 43, 47, ...]\n```\n\n#### *acycle*\n\nFor more, see the [documentation][docs/aioplus/acycle].\n\n```python\n>>> aiterable = arange(23)\n>>> [num async for num in acycle(aiterable)]\n[0, 1, ..., 22, 23, 0, 1, ..., 22, 23, ...]\n```\n\n#### *aempty*\n\nFor more, see the [documentation][docs/aioplus/aempty].\n\n```python\n>>> aiterable = arange(23)\n>>> await aempty(aiterable)\nFalse\n```\n\n#### *aenumerate*\n\nFor more, see the [documentation][docs/aioplus/aenumerate].\n\n```python\n>>> aiterable = arange(4, 23)\n>>> [(index, num) async for index, num in aenumerate(aiterable)]\n[(0, 4), (1, 5), (2, 6), (3, 7), ..., (17, 21), (18, 22)]\n```\n\n#### *afirst*\n\nFor more, see the [documentation][docs/aioplus/afirst].\n\n```python\n>>> aiterable = arange(23)\n>>> await afirst(aiterable)\n0\n```\n\n#### *ahead*\n\nFor more, see the [documentation][docs/aioplus/ahead].\n\n```python\n>>> aiterable = arange(23)\n>>> [num async for num in ahead(aiterable, n=4)]\n[0, 1, 2, 3]\n```\n\n#### *aislice*\n\nFor more, see the [documentation][docs/aioplus/aislice].\n\n```python\n>>> aiterable = arange(2003)\n>>> [num async for num in aislice(aiterable, 4, 23)]\n[4, 5, 6, 7, 8, ..., 20, 21, 22]\n```\n\n#### *alast*\n\nFor more, see the [documentation][docs/aioplus/alast].\n\n```python\n>>> aiterable = arange(23)\n>>> await alast(aiterable)\n22\n```\n\n#### *alen*\n\nFor more, see the [documentation][docs/aioplus/alen].\n\n```python\n>>> aiterable = arange(23)\n>>> await alen(aiterable)\n23\n```\n\n#### *amax*\n\nFor more, see the [documentation][docs/aioplus/amax].\n\n```python\n>>> aiterable = arange(23)\n>>> await amax(aiterable)\n22\n```\n\n#### *amin*\n\nFor more, see the [documentation][docs/aioplus/amin].\n\n```python\n>>> aiterable = arange(23)\n>>> await amin(aiterable)\n0\n```\n\n#### *aminmax*\n\nFor more, see the [documentation][docs/aioplus/aminmax].\n\n```python\n>>> aiterable = arange(23)\n>>> await aminmax(aiterable)\n(0, 22)\n```\n\n#### *anextify*\n\nFor more, see the [documentation][docs/aioplus/anextify].\n\n```python\n>>> iterable = [0, 1, 2, 3, 4, 5]\n>>> aiterable = anextify(iterable)\n>>> [num async for num in aiterable]\n[0, 1, 2, 3, 4, 5]\n```\n\n#### *anth*\n\nFor more, see the [documentation][docs/aioplus/anth].\n\n```python\n>>> aiterable = arange(23)\n>>> await anth(aiterable, n=4)\n4\n```\n\n#### *apairwise*\n\nFor more, see the [documentation][docs/aioplus/apairwise].\n\n```python\n>>> aiterable = arange(23)\n>>> [pair async for pair in apairwise(aiterable)]\n[(0, 1), (1, 2), (2, 3), ..., (20, 21), (21, 22)]\n```\n\n#### *arange*\n\nFor more, see the [documentation][docs/aioplus/arange].\n\n```python\n>>> [num async for num in arange(23)]\n[0, 1, 2, 3, 4, ..., 19, 20, 21, 22]\n```\n\n#### *arepeat*\n\nFor more, see the [documentation][docs/aioplus/arepeat].\n\n```python\n>>> [num async for num in arepeat(23, times=4)]\n[23, 23, 23, 23]\n```\n\n#### *areversed*\n\nFor more, see the [documentation][docs/aioplus/areversed].\n\n```python\n>>> aiterable = arange(23)\n>>> [num async for num in areversed(aiterable)]\n[22, 21, 20, 19, 18, ..., 4, 3, 2, 1, 0]\n```\n\n#### *asum*\n\nFor more, see the [documentation][docs/aioplus/asum].\n\n```python\n>>> aiterable = arange(23)\n>>> await asum(aiterable)\n253\n```\n\n#### *atail*\n\nFor more, see the [documentation][docs/aioplus/atail].\n\n```python\n>>> aiterable = arange(23)\n>>> [num async for num in atail(aiterable, n=4)]\n[19, 20, 21, 22]\n```\n\n#### atriplewise\n\nFor more, see the [documentation][docs/aioplus/atriplewise].\n\n```python\n>>> aiterable = arange(23)\n>>> [triplet async for triplet in atriplewise(aiterable)]\n[(0, 1, 2), (1, 2, 3), ..., (19, 20, 21), (20, 21, 22)]\n```\n\n#### *awaitify*\n\nFor more, see the [documentation][docs/aioplus/awaitify].\n\n```python\n>>> aprint = awaitify(print)\n>>> await aprint(\"4 -> 23\")\n4 -> 23\n```\n\n#### awindowed\n\nFor more, see the [documentation][docs/aioplus/awindowed].\n\n```python\n>>> aiterable = arange(23)\n>>> [window async for window in awindowed(aiterable, n=3)]\n[(0, 1, 2), (1, 2, 3), ..., (19, 20, 21), (20, 21, 22)]\n```\n\n## License\n\nMIT License, Copyright (c) 2025 Sergei Y. Bogdanov. See [LICENSE][github/license] file.\n\n<!-- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- -->\n\n[docs/aioplus]: https://aioplus.readthedocs.io/\n[docs/aioplus/CallerThreadExecutor]: https://aioplus.readthedocs.io/en/latest/CallerThreadExecutor.html\n[docs/aioplus/aall]: https://aioplus.readthedocs.io/en/latest/aall.html\n[docs/aioplus/aany]: https://aioplus.readthedocs.io/en/latest/aany.html\n[docs/aioplus/abatched]: https://aioplus.readthedocs.io/en/latest/abatched.html\n[docs/aioplus/acount]: https://aioplus.readthedocs.io/en/latest/acount.html\n[docs/aioplus/acycle]: https://aioplus.readthedocs.io/en/latest/acycle.html\n[docs/aioplus/aempty]: https://aioplus.readthedocs.io/en/latest/aempty.html\n[docs/aioplus/aenumerate]: https://aioplus.readthedocs.io/en/latest/aenumerate.html\n[docs/aioplus/afirst]: https://aioplus.readthedocs.io/en/latest/afirst.html\n[docs/aioplus/ahead]: https://aioplus.readthedocs.io/en/latest/ahead.html\n[docs/aioplus/aislice]: https://aioplus.readthedocs.io/en/latest/aislice.html\n[docs/aioplus/alast]: https://aioplus.readthedocs.io/en/latest/alast.html\n[docs/aioplus/alen]: https://aioplus.readthedocs.io/en/latest/alen.html\n[docs/aioplus/amax]: https://aioplus.readthedocs.io/en/latest/amax.html\n[docs/aioplus/amin]: https://aioplus.readthedocs.io/en/latest/amin.html\n[docs/aioplus/aminmax]: https://aioplus.readthedocs.io/en/latest/aminmax.html\n[docs/aioplus/anextify]: https://aioplus.readthedocs.io/en/latest/anextify.html\n[docs/aioplus/anth]: https://aioplus.readthedocs.io/en/latest/anth.html\n[docs/aioplus/apairwise]: https://aioplus.readthedocs.io/en/latest/apairwise.html\n[docs/aioplus/arange]: https://aioplus.readthedocs.io/en/latest/arange.html\n[docs/aioplus/arepeat]: https://aioplus.readthedocs.io/en/latest/arepeat.html\n[docs/aioplus/areversed]: https://aioplus.readthedocs.io/en/latest/areversed.html\n[docs/aioplus/asum]: https://aioplus.readthedocs.io/en/latest/asum.html\n[docs/aioplus/atail]: https://aioplus.readthedocs.io/en/latest/atail.html\n[docs/aioplus/atriplewise]: https://aioplus.readthedocs.io/en/latest/atriplewise.html\n[docs/aioplus/awaitify]: https://aioplus.readthedocs.io/en/latest/awaitify.html\n[docs/aioplus/awindowed]: https://aioplus.readthedocs.io/en/latest/awindowed.html\n\n[github/license]: https://github.com/syubogdanov/aioplus/tree/main/LICENSE\n\n[pypi/homepage]: https://pypi.org/project/aioplus/\n\n[shields/pypi/downloads]: https://img.shields.io/pypi/dm/aioplus.svg?color=green\n[shields/pypi/license]: https://img.shields.io/pypi/l/aioplus.svg?color=green\n[shields/pypi/version]: https://img.shields.io/pypi/v/aioplus.svg?color=green\n[shields/python/version]: https://img.shields.io/pypi/pyversions/aioplus.svg?color=green\n[shields/readthedocs]: https://img.shields.io/readthedocs/aioplus?style=flat&color=green\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Because asyncio.gather() is not enough!",
"version": "0.6.0",
"project_urls": {
"Documentation": "https://aioplus.readthedocs.io",
"Homepage": "https://github.com/syubogdanov/aioplus",
"Repository": "https://github.com/syubogdanov/aioplus"
},
"split_keywords": [
"async",
" asyncio",
" builtins",
" concurrency",
" concurrent",
" executor",
" futures",
" iteration",
" iterator",
" itertools",
" python",
" python3",
" stdlib"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a8a0a04763a74e154d6084e7d86bf800585265a4e34b009fba058f712d4529ba",
"md5": "0236cee3b5289632ef430a5ce9d0d6e7",
"sha256": "c0b9e619a156f32ae797d90135b6caa56c4b13dc20c5e081ecb515e3ee8b5acd"
},
"downloads": -1,
"filename": "aioplus-0.6.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0236cee3b5289632ef430a5ce9d0d6e7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.14,>=3.11",
"size": 31507,
"upload_time": "2025-08-31T09:17:12",
"upload_time_iso_8601": "2025-08-31T09:17:12.114999Z",
"url": "https://files.pythonhosted.org/packages/a8/a0/a04763a74e154d6084e7d86bf800585265a4e34b009fba058f712d4529ba/aioplus-0.6.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8517cbf4c46f13f59cbc0118e68ab4bf7872854c89512d64fcf619d08ed390ef",
"md5": "de201f1c87b8cf6e17831ac20dfe82ee",
"sha256": "7821c7a25e0e323e36ff8f339db84049846c1aec311550aaa24e19f7440a793f"
},
"downloads": -1,
"filename": "aioplus-0.6.0.tar.gz",
"has_sig": false,
"md5_digest": "de201f1c87b8cf6e17831ac20dfe82ee",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.14,>=3.11",
"size": 14730,
"upload_time": "2025-08-31T09:17:13",
"upload_time_iso_8601": "2025-08-31T09:17:13.359294Z",
"url": "https://files.pythonhosted.org/packages/85/17/cbf4c46f13f59cbc0118e68ab4bf7872854c89512d64fcf619d08ed390ef/aioplus-0.6.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-31 09:17:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "syubogdanov",
"github_project": "aioplus",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "aioplus"
}