Asynchronous file IO for Linux MacOS or Windows.
Project Links
Meta
Author: Dmitry Orlov
Requires Python: >=3.10
Classifiers
Topic
- Software Development
- Software Development :: Libraries
Intended Audience
- Developers
Natural Language
- English
Operating System
- MacOS
- POSIX
- Microsoft
Programming Language
- Python
- Python :: 3
- Python :: 3.10
- Python :: 3.11
- Python :: 3.12
- Python :: 3.13
- Python :: 3.14
- Python :: Implementation :: CPython
Python wrapper for AIO
NOTE: Native Linux aio implementation supports since 4.18 kernel version.
Python bindings for Linux AIO API and simple asyncio wrapper.
Example
import asyncio
from caio import AsyncioContext
loop = asyncio.get_event_loop()
async def main():
# max_requests=128 by default
ctx = AsyncioContext(max_requests=128)
with open("test.file", "wb+") as fp:
fd = fp.fileno()
# Execute one write operation
await ctx.write(b"Hello world", fd, offset=0)
# Execute one read operation
print(await ctx.read(32, fd, offset=0))
# Execute one fdsync operation
await ctx.fdsync(fd)
op1 = ctx.write(b"Hello from ", fd, offset=0)
op2 = ctx.write(b"async world", fd, offset=11)
await asyncio.gather(op1, op2)
print(await ctx.read(32, fd, offset=0))
# Hello from async world
loop.run_until_complete(main())
Troubleshooting
The linux implementation works normal for modern linux kernel versions
and file systems. So you may have problems specific for your environment.
It's not a bug and might be resolved some ways:
- Upgrade the kernel
- Use compatible file system
- Use threads based or pure python implementation.
The caio since version 0.7.0 contains some ways to do this.
- In runtime use the environment variable
CAIO_IMPLwith possible values:linux- use native linux kernels aio mechanismthread- use thread based implementation written in Cpython- use pure python implementation
- File
default_implementationlocated near__init__.pyin caio installation path. It's useful for distros package maintainers. This file might contains comments (lines starts with#symbol) and the first line should be one oflinuxthreadorpython.
Previous versions allows direct import of the target implementation.
0.9.25
Dec 26, 2025
0.9.24
Apr 23, 2025
0.9.23
Apr 23, 2025
0.9.22
Apr 17, 2025
0.9.21
Jan 12, 2025
0.9.20
Jan 12, 2025
0.9.19
Jan 09, 2025
0.9.18
Jan 09, 2025
0.9.17
May 28, 2024
0.9.16
May 28, 2024
0.9.15
May 28, 2024
0.9.14
May 28, 2024
0.9.13
Aug 18, 2023
0.9.12
Mar 06, 2023
0.9.11
Nov 09, 2022
0.9.10
Nov 09, 2022
0.9.8
Aug 14, 2022
0.9.7
Aug 10, 2022
0.9.6
Jun 27, 2022
0.9.5
Feb 07, 2022
0.9.4
Feb 07, 2022
0.9.3
Aug 03, 2021
0.9.2
Aug 03, 2021
0.9.1
Aug 03, 2021
0.9.0
Aug 02, 2021
0.8.4
Jun 10, 2021
0.8.3
Jun 10, 2021
0.8.2
Jun 10, 2021
0.8.1
May 21, 2021
0.8.0
Mar 02, 2021
0.7.0
Feb 23, 2021
0.6.3
Oct 11, 2020
0.6.2
Oct 09, 2020
0.6.1
Aug 28, 2020
0.6.0
Aug 26, 2020
0.5.6
Aug 26, 2020
0.5.5
Aug 26, 2020
0.5.3
Jun 25, 2020
0.5.2
Jun 23, 2020
0.5.0
Jun 21, 2020
0.4.0
Jun 21, 2020
0.3.1
Jun 21, 2020
0.3.0
Jun 20, 2020
0.2.0
Jun 19, 2020
0.0.4
Mar 13, 2020
0.0.3
Mar 13, 2020
Wheel compatibility matrix
Files in release
caio-0.9.25-cp310-cp310-macosx_10_9_universal2.whl (36.0KiB)
caio-0.9.25-cp310-cp310-manylinux2010_x86_64.manylinux2014_x86_64.manylinux_2_12_x86_64.manylinux_2_17_x86_64.whl (77.8KiB)
caio-0.9.25-cp310-cp310-manylinux_2_34_aarch64.whl (77.6KiB)
caio-0.9.25-cp310-cp310-manylinux_2_34_x86_64.whl (75.9KiB)
caio-0.9.25-cp311-cp311-macosx_10_9_universal2.whl (36.0KiB)
caio-0.9.25-cp311-cp311-manylinux2010_x86_64.manylinux2014_x86_64.manylinux_2_12_x86_64.manylinux_2_17_x86_64.whl (78.4KiB)
caio-0.9.25-cp311-cp311-manylinux_2_34_aarch64.whl (78.2KiB)
caio-0.9.25-cp311-cp311-manylinux_2_34_x86_64.whl (76.4KiB)
caio-0.9.25-cp312-cp312-macosx_10_13_universal2.whl (36.1KiB)
caio-0.9.25-cp312-cp312-manylinux2010_x86_64.manylinux2014_x86_64.manylinux_2_12_x86_64.manylinux_2_17_x86_64.whl (80.1KiB)
caio-0.9.25-cp312-cp312-manylinux_2_34_aarch64.whl (79.6KiB)
caio-0.9.25-cp312-cp312-manylinux_2_34_x86_64.whl (78.3KiB)
caio-0.9.25-cp313-cp313-macosx_10_13_universal2.whl (36.1KiB)
caio-0.9.25-cp313-cp313-manylinux2010_x86_64.manylinux2014_x86_64.manylinux_2_12_x86_64.manylinux_2_17_x86_64.whl (80.0KiB)
caio-0.9.25-cp313-cp313-manylinux_2_34_aarch64.whl (79.6KiB)
caio-0.9.25-cp313-cp313-manylinux_2_34_x86_64.whl (78.4KiB)
caio-0.9.25-cp314-cp314-macosx_10_15_universal2.whl (36.1KiB)
caio-0.9.25-cp314-cp314-manylinux2010_x86_64.manylinux2014_x86_64.manylinux_2_12_x86_64.manylinux_2_17_x86_64.whl (79.9KiB)
caio-0.9.25-cp314-cp314-manylinux_2_34_aarch64.whl (79.7KiB)
caio-0.9.25-cp314-cp314-manylinux_2_34_x86_64.whl (78.2KiB)
caio-0.9.25-py3-none-any.whl (18.6KiB)
caio-0.9.25.tar.gz (26.2KiB)