Skip to main content

Asynchronous file IO for Linux MacOS or Windows.

Project description

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:

  1. Upgrade the kernel
  2. Use compatible file system
  3. Use threads based or pure python implementation.

The caio since version 0.7.0 contains some ways to do this.

  1. In runtime use the environment variable CAIO_IMPL with possible values:
    • linux - use native linux kernels aio mechanism
    • thread - use thread based implementation written in C
    • python - use pure python implementation
  2. File default_implementation located near __init__.py in 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 of linux thread or python.

Previous versions allows direct import of the target implementation.

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

caio-0.9.17.tar.gz (25.0 kB view details)

Uploaded Source

Built Distributions

caio-0.9.17-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

caio-0.9.17-cp312-cp312-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (81.7 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.17+ x86-64

caio-0.9.17-cp312-cp312-macosx_10_9_universal2.whl (37.9 kB view details)

Uploaded CPython 3.12 macOS 10.9+ universal2 (ARM64, x86-64)

caio-0.9.17-cp311-cp311-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (80.0 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.17+ x86-64

caio-0.9.17-cp311-cp311-macosx_10_9_universal2.whl (37.8 kB view details)

Uploaded CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64)

caio-0.9.17-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (79.4 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.17+ x86-64

caio-0.9.17-cp310-cp310-macosx_10_9_universal2.whl (37.8 kB view details)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)

caio-0.9.17-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (78.7 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.17+ x86-64

caio-0.9.17-cp39-cp39-macosx_10_9_universal2.whl (37.9 kB view details)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64)

caio-0.9.17-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (79.8 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.17+ x86-64

caio-0.9.17-cp38-cp38-macosx_11_0_universal2.whl (38.0 kB view details)

Uploaded CPython 3.8 macOS 11.0+ universal2 (ARM64, x86-64)

File details

Details for the file caio-0.9.17.tar.gz.

File metadata

  • Download URL: caio-0.9.17.tar.gz
  • Upload date:
  • Size: 25.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for caio-0.9.17.tar.gz
Algorithm Hash digest
SHA256 8f30511526814d961aeef389ea6885273abe6c655f1e08abbadb95d12fdd9b4f
MD5 37719f344efbf0743eb835ac7c2e33aa
BLAKE2b-256 88cf59b868909a85ad9eca985ad5bbeb3c0a8cd435e50ae12def770d16911753

See more details on using hashes here.

File details

Details for the file caio-0.9.17-py3-none-any.whl.

File metadata

  • Download URL: caio-0.9.17-py3-none-any.whl
  • Upload date:
  • Size: 19.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.8.10

File hashes

Hashes for caio-0.9.17-py3-none-any.whl
Algorithm Hash digest
SHA256 c55d4dc6b3a36f93237ecd6360e1c131c3808bc47d4191a130148a99b80bb311
MD5 b746a2bed52c3ee5c59c967cecf09e61
BLAKE2b-256 58723f4895adb1d23b0ac1d8afc748405a2ad3c77d8d0f23b05a64ff583c11e5

See more details on using hashes here.

File details

Details for the file caio-0.9.17-cp312-cp312-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for caio-0.9.17-cp312-cp312-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b3e320b0ea371c810359934f8e8fe81777c493cc5fb4d41de44277cbe7336e74
MD5 b261932ac06547fb277d5e5d098776b6
BLAKE2b-256 80f55e993120daeb4ec084f5f84c118bbd48b65379f63ed56919bf224e0eab42

See more details on using hashes here.

File details

Details for the file caio-0.9.17-cp312-cp312-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for caio-0.9.17-cp312-cp312-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 0ddb253b145a53ecca76381677ce465bc5efeaecb6aaf493fac43ae79659f0fb
MD5 5430673ece8e7b01e576de25196dd465
BLAKE2b-256 c3b837dcee4bc4fae1701a86373a297bbca797f6b7bfe5f85993a11049649c63

See more details on using hashes here.

File details

Details for the file caio-0.9.17-cp311-cp311-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for caio-0.9.17-cp311-cp311-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 549caa51b475877fe32856a26fe937366ae7a1c23a9727005b441db9abb12bcc
MD5 4fa7c59e2f105d1721b9a90811a79392
BLAKE2b-256 57e21d04e506a5fd735856f0bb95b4d03b800947bd43c98193ee57d37070a51e

See more details on using hashes here.

File details

Details for the file caio-0.9.17-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for caio-0.9.17-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 079730a353bbde03796fab681e969472eace09ffbe5000e584868a7fe389ba6f
MD5 71a9e993f967446156ae1f710538e24c
BLAKE2b-256 5244a79c7004a9562a176d78437816c736c34ab9fb6233a4b8164eb25628a09c

See more details on using hashes here.

File details

Details for the file caio-0.9.17-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for caio-0.9.17-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3028b746e9ec7f6d6ebb386a7fd8caf0eebed5d6e6b4f18c8ef25861934b1673
MD5 4c2a2c0d84885f0819a99037b05a34fb
BLAKE2b-256 bf3f0ae9f69deb3dc96b20bf084cc262b438a154d5de08a064628272713ff239

See more details on using hashes here.

File details

Details for the file caio-0.9.17-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for caio-0.9.17-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 3f69395fdd45c115b2ef59732e3c8664722a2b51de2d6eedb3d354b2f5f3be3c
MD5 d46eeb9393f7caa2c57f8b571cb437fe
BLAKE2b-256 dbc317bc41b7c795d91d58ee7a70ad98e23f1ba0d50bdeadd82173bb02cddc8e

See more details on using hashes here.

File details

Details for the file caio-0.9.17-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for caio-0.9.17-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 40bd0afbd3491d1e407bcf74e3a9e9cc67a7f290ed29518325194184d63cc2b6
MD5 17b417745eebd09c7a7b7324ac475767
BLAKE2b-256 7715d9410b3538e9454380469b43a4750f176ff543c17bba524fd25e55bf2054

See more details on using hashes here.

File details

Details for the file caio-0.9.17-cp39-cp39-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for caio-0.9.17-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 fca916240597005d2b734f1442fa3c3cfb612bf46e0978b5232e5492a371de38
MD5 68bb52a0fb29b4fd9a5502f8aa94a1db
BLAKE2b-256 00a23bfb94f7edaa4361ce62692e1bbd70355693cd45d96342eecf152862f6ae

See more details on using hashes here.

File details

Details for the file caio-0.9.17-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for caio-0.9.17-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b3e96925b9f15f43e6ef1d42a83edfd937eb11a984cb6ef7c10527e963595497
MD5 3fb7bf53cff1879bb45643060087ceac
BLAKE2b-256 44eb313a36e1faa015a6ab76393b48f1f9bd56d9eaf79f650b5ddfad884d81f7

See more details on using hashes here.

File details

Details for the file caio-0.9.17-cp38-cp38-macosx_11_0_universal2.whl.

File metadata

File hashes

Hashes for caio-0.9.17-cp38-cp38-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 a39a49e279f82aa022f0786339d45d9550b5aa3e46eec7d08e0f351c503df0a5
MD5 7e84db9fc73407fbd369474b619b7f03
BLAKE2b-256 7580c54fb589cc6e00085656d9ff93d6a0e36f403648dbb38a300f237ba875ae

See more details on using hashes here.

Supported by

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