Skip to main content

Because asyncio.gather() is not enough!

Project description

aioplus

PyPI Version PyPI Downloads License Python Version Documentation

Key Features

  • As easy as built-ins - but asynchronous;
  • Early returns never cause unawaited coroutine warnings;
  • Nearly the same API as the Python 3.13 standard blocking API.

Getting Started

Installation

The library is available as aioplus on PyPI:

pip install aioplus

Usage

aall

For more, see the documentation.

import asyncio

from aioplus import aall, arange

async def main() -> None:
    """Run the program."""
    aiterable = (num > 0 async for num in arange(2304))
    flg = await aall(aiterable)

if __name__ == "__main__":
    asyncio.run(main())

aany

For more, see the documentation.

import asyncio

from aioplus import aany, arange

async def main() -> None:
    """Run the program."""
    aiterable = (num % 2 == 0 async for num in arange(2304))
    flg = await aany(aiterable)

if __name__ == "__main__":
    asyncio.run(main())

abatched

For more, see the documentation.

import asyncio

from aioplus import abatched, arange

async def main() -> None:
    """Run the program."""
    async for batch in abatched(arange(23), n=4):
        print(batch)

if __name__ == "__main__":
    asyncio.run(main())

acount

For more, see the documentation.

import asyncio

from aioplus import acount

async def main() -> None:
    """Run the program."""
    async for num in acount(start=23, step=4):
        print(num)

if __name__ == "__main__":
    asyncio.run(main())

acycle

For more, see the documentation.

import asyncio

from aioplus import acycle, arange

async def main() -> None:
    """Run the program."""
    async for num in acycle(arange(23)):
        print(num)

if __name__ == "__main__":
    asyncio.run(main())

aenumerate

For more, see the documentation.

import asyncio

from aioplus import aenumerate, arange

async def main() -> None:
    """Run the program."""
    async for index, num in aenumerate(arange(2304)):
        print(index, num)

if __name__ == "__main__":
    asyncio.run(main())

ahead

For more, see the documentation.

import asyncio

from aioplus import ahead, arange

async def main() -> None:
    """Run the program."""
    async for num in ahead(arange(23), n=4):
        print(num)

if __name__ == "__main__":
    asyncio.run(main())

aislice

For more, see the documentation.

import asyncio

from aioplus import aislice, arange

async def main() -> None:
    """Run the program."""
    async for num in aislice(arange(23), 4):
        print(num)

if __name__ == "__main__":
    asyncio.run(main())

alen

For more, see the documentation.

import asyncio

from aioplus import alen, arange

async def main() -> None:
    """Run the program."""
    aiterable = arange(2304)
    length = await alen(aiterable)
    print(f"len(aiterable) == {length}")

if __name__ == "__main__":
    asyncio.run(main())

anth

For more, see the documentation.

import asyncio

from aioplus import anth, arange

async def main() -> None:
    """Run the program."""
    aiterable = arange(23)
    value = await anth(aiterable, n=4)
    print(f"value = {value}")

if __name__ == "__main__":
    asyncio.run(main())

apairwise

For more, see the documentation.

import asyncio

from aioplus import apairwise, arange

async def main() -> None:
    """Run the program."""
    async for before, after in apairwise(arange(23)):
        print(f"{before} -> {after}")

if __name__ == "__main__":
    asyncio.run(main())

arange

For more, see the documentation.

import asyncio

from aioplus import arange

async def main() -> None:
    """Run the program."""
    async for num in arange(2304):
        print(num)

if __name__ == "__main__":
    asyncio.run(main())

arepeat

For more, see the documentation.

import asyncio

from aioplus import arepeat

async def main() -> None:
    """Run the program."""
    async for num in arepeat(23, times=4):
        print(num)

if __name__ == "__main__":
    asyncio.run(main())

areversed

For more, see the documentation.

import asyncio

from aioplus import arange, areversed

async def main() -> None:
    """Run the program."""
    async for num in areversed(arange(2304)):
        print(num)

if __name__ == "__main__":
    asyncio.run(main())

atail

For more, see the documentation.

import asyncio

from aioplus import arange, atail

async def main() -> None:
    """Run the program."""
    async for num in atail(arange(23), n=4):
        print(num)

if __name__ == "__main__":
    asyncio.run(main())

awaitify

For more, see the documentation.

import asyncio

from aioplus import awaitify

def func(num: int) -> None:
    """Print the number."""
    print(f"Num: {num}")

async def main() -> None:
    """Run the program."""
    afunc = awaitify(func)
    await afunc(num=2304)

if __name__ == "__main__":
    asyncio.run(main())

License

MIT License, Copyright (c) 2025 Sergei Y. Bogdanov. See LICENSE file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aioplus-0.1.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aioplus-0.1.0-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

Details for the file aioplus-0.1.0.tar.gz.

File metadata

  • Download URL: aioplus-0.1.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.5 Windows/10

File hashes

Hashes for aioplus-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5b193705d109fc391368c9de9903695941307034ad3962fc8de64e93384a6211
MD5 eb5910bded454b4b6926c7d34c727ab6
BLAKE2b-256 fa3be2d8d29c58e61e221cce5cfa41e2c5b4ba6e2c727e7df15448771ca5d1a6

See more details on using hashes here.

File details

Details for the file aioplus-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: aioplus-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.5 Windows/10

File hashes

Hashes for aioplus-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d79debb57fc218b8f1b31450a3d8146a55d332b3490fb76f8368737494f9b1d7
MD5 ccae0c501f9b6d7ffa890d86e770f9b1
BLAKE2b-256 b5ffaf35e322f5c48e14820275ab58c28ceaae1416a85339588cb9a3511237a9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page