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.24.tar.gz (27.2 kB view details)

Uploaded Source

Built Distributions

caio-0.9.24-cp313-cp313-manylinux_2_34_x86_64.whl (80.2 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

caio-0.9.24-cp313-cp313-manylinux_2_34_aarch64.whl (81.6 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

caio-0.9.24-cp313-cp313-macosx_10_13_universal2.whl (42.2 kB view details)

Uploaded CPython 3.13macOS 10.13+ universal2 (ARM64, x86-64)

caio-0.9.24-cp312-cp312-manylinux_2_34_x86_64.whl (80.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

caio-0.9.24-cp312-cp312-manylinux_2_34_aarch64.whl (81.5 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64

caio-0.9.24-cp312-cp312-macosx_10_9_universal2.whl (42.2 kB view details)

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

caio-0.9.24-cp311-cp311-manylinux_2_34_x86_64.whl (78.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

caio-0.9.24-cp311-cp311-manylinux_2_34_aarch64.whl (80.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ ARM64

caio-0.9.24-cp311-cp311-macosx_10_9_universal2.whl (42.1 kB view details)

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

caio-0.9.24-cp310-cp310-manylinux_2_34_x86_64.whl (77.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

caio-0.9.24-cp310-cp310-manylinux_2_34_aarch64.whl (79.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ ARM64

caio-0.9.24-cp310-cp310-macosx_10_9_universal2.whl (42.1 kB view details)

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

caio-0.9.24-cp39-cp39-manylinux_2_34_x86_64.whl (77.2 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

caio-0.9.24-cp39-cp39-manylinux_2_34_aarch64.whl (79.0 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ ARM64

caio-0.9.24-cp39-cp39-macosx_10_9_universal2.whl (42.1 kB view details)

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

File details

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

File metadata

  • Download URL: caio-0.9.24.tar.gz
  • Upload date:
  • Size: 27.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.10

File hashes

Hashes for caio-0.9.24.tar.gz
Algorithm Hash digest
SHA256 5bcdecaea02a9aa8e3acf0364eff8ad9903d57d70cdb274a42270126290a77f1
MD5 533d3cf5d2ae56d78536215936f662d0
BLAKE2b-256 9804ec9b6864135032fd454f6cd1d9444e0bb01040196ad0cd776c061fc92c6b

See more details on using hashes here.

File details

Details for the file caio-0.9.24-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for caio-0.9.24-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 9368eae0a9badd5f31264896c51b47431d96c0d46f1979018fb1d20c49f56156
MD5 47d48cf96e6751e9a103b964afdfc6b2
BLAKE2b-256 783badeb0cffe98dbe60661f316ec0060037a5209a5ed8be38ac8e79fdbc856d

See more details on using hashes here.

File details

Details for the file caio-0.9.24-cp313-cp313-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for caio-0.9.24-cp313-cp313-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 d15fc746c4bf0077d75df05939d1e97c07ccaa8e580681a77021d6929f65d9f4
MD5 13ed6f1e09c43fc2288ca17345044c1b
BLAKE2b-256 e0e2c16aeaea4b2103e04fdc2e7088ede6313e1971704c87fcd681b58ab1c6b4

See more details on using hashes here.

File details

Details for the file caio-0.9.24-cp313-cp313-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for caio-0.9.24-cp313-cp313-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 1d47ef8d76aca74c17cb07339a441c5530fc4b8dd9222dfb1e1abd7f9f9b814f
MD5 15c90eac98c09efda555a179cc447be5
BLAKE2b-256 663506e77837fc5455d330c5502460fc3743989d4ff840b61aa79af3a7ec5b19

See more details on using hashes here.

File details

Details for the file caio-0.9.24-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for caio-0.9.24-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 8ee158e56128d865fb7d57a9c9c22fca4e8aa8d8664859c977a36fff3ccb3609
MD5 1e4c8eb95c39c7c5c5d889571e797432
BLAKE2b-256 64808a8cdfd4b47e06d1e9de6d5431c2603e0741282fa06f757f10c04e619d8f

See more details on using hashes here.

File details

Details for the file caio-0.9.24-cp312-cp312-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for caio-0.9.24-cp312-cp312-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 a306b0dda91cb4ca3170f066c114597f8ea41b3da578574a9d2b54f86963de68
MD5 5d25020b879daa1821ff9b0481e947d5
BLAKE2b-256 a98ccb62483e69309bbad503c2ace29c4ac3466558a20e9aed840d313e1dcacd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for caio-0.9.24-cp312-cp312-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 7ae3566228383175265a7583107f21a7cb044a752ea29ba84fce7c1a49a05903
MD5 c2cf76be1a3049af20092427078ed7b3
BLAKE2b-256 5f76b33a89dc2516aae045ef509cf2febe7ffb2a36c4eebb8f301a7ef2093385

See more details on using hashes here.

File details

Details for the file caio-0.9.24-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for caio-0.9.24-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 fa74d111b3b165bfad2e333367976bdf118bcf505a1cb44d3bcddea2849e3297
MD5 b4891c1b47ac5dc69fabbe988f782aa6
BLAKE2b-256 d55825e43b2a46a802da39efa6d5e98a8dd9e2b92ec997d6c2ea1de216bf3f35

See more details on using hashes here.

File details

Details for the file caio-0.9.24-cp311-cp311-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for caio-0.9.24-cp311-cp311-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 3b4dc0a8fb9a58ab40f967ad5a8a858cc0bfb2348a580b4142595849457f9c9a
MD5 9b50c20a55c7c4c918453e300f72aabb
BLAKE2b-256 57896e6830c4920f47c0aabffd920893777595893eef9577a965e7511566a214

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for caio-0.9.24-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 925b9e3748ce1a79386dfb921c0aee450e43225534551abd1398b1c08f9ba29f
MD5 c71ae4896dd6a032e7e43f56b678abce
BLAKE2b-256 f89d4f9f58ef6b708e0bf67c6af0c1b3d21d4b1b6dc1a4c2d741793cf4ac8e5d

See more details on using hashes here.

File details

Details for the file caio-0.9.24-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for caio-0.9.24-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ad7f0902bf952237e120606252c14ab3cb05995c9f79f39154b5248744864832
MD5 91dee71e94d6dc61d5ce895b5d801e87
BLAKE2b-256 85dc222f6c525f8e23850315ea82ad3ca01721ef9628d63daf98a3b6736efa75

See more details on using hashes here.

File details

Details for the file caio-0.9.24-cp310-cp310-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for caio-0.9.24-cp310-cp310-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 37bc172349686139e8dc97fff7662c67b1837e18a67b99e8ef25585f2893d013
MD5 d66f2ba81f8f11b38b53f1f7da4f228a
BLAKE2b-256 66fb134f5014937c454571c2510685ace79c5c1bb399446b3d2acd21e85930fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for caio-0.9.24-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 d80322126a97ba572412b17b2f086ff95195de2c4261deb19db6bfcdc9ef7540
MD5 c09f8be011117fc36f2921093787cfba
BLAKE2b-256 5c5962e1fe2f11790d04cf6c54d1872444eab70ae4bad948277ed9f8532a7dcd

See more details on using hashes here.

File details

Details for the file caio-0.9.24-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for caio-0.9.24-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5339ced0764e10242a50ccb21db7f0d9c359881db0f72fa2c5e45ed828ffacf7
MD5 7ee2cdd5c53a68d2ac72feff3018874c
BLAKE2b-256 a6d67f1ef60222c44c108f953dcd871069f99f87746ddfcc0383b7d424bcbbc2

See more details on using hashes here.

File details

Details for the file caio-0.9.24-cp39-cp39-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for caio-0.9.24-cp39-cp39-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 08304fa80af7771c78a5bcc923449c7ec8134d589b50d48c66320f85552c7ae2
MD5 99f35144dc7bc0f69d961d58bcc4e110
BLAKE2b-256 9d1ac8c5afa22d0af812065fcc4666be3e3a4cb77f3d36c31deebe2c06d2291b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: caio-0.9.24-cp39-cp39-macosx_10_9_universal2.whl
  • Upload date:
  • Size: 42.1 kB
  • Tags: CPython 3.9, macOS 10.9+ universal2 (ARM64, x86-64)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.10

File hashes

Hashes for caio-0.9.24-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 3f0e5a645ef4e7bb7a81e10ae2a7aef14988cb2cb4354588c6bf6f6f3f6de72a
MD5 aeadc157673b30c98ab07a166638c873
BLAKE2b-256 5c2948e9aa3fbd7b49a890c5c7ee9874df3b16a1115e9555e821cff4b5c916ff

See more details on using hashes here.

Supported by

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