Skip to main content

Asynchronous file IO for Linux MacOS or Windows.

Project description

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

Uploaded Source

Built Distributions

caio-0.9.13-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

caio-0.9.13-cp311-cp311-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (79.9 kB view details)

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

caio-0.9.13-cp311-cp311-macosx_10_9_universal2.whl (38.2 kB view details)

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

caio-0.9.13-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (79.3 kB view details)

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

caio-0.9.13-cp310-cp310-macosx_11_0_x86_64.whl (30.5 kB view details)

Uploaded CPython 3.10 macOS 11.0+ x86-64

caio-0.9.13-cp310-cp310-macosx_10_9_universal2.whl (43.3 kB view details)

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

caio-0.9.13-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (78.6 kB view details)

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

caio-0.9.13-cp39-cp39-macosx_11_0_x86_64.whl (30.5 kB view details)

Uploaded CPython 3.9 macOS 11.0+ x86-64

caio-0.9.13-cp39-cp39-macosx_10_9_universal2.whl (43.3 kB view details)

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

caio-0.9.13-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (79.7 kB view details)

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

caio-0.9.13-cp38-cp38-macosx_11_0_x86_64.whl (30.5 kB view details)

Uploaded CPython 3.8 macOS 11.0+ x86-64

caio-0.9.13-cp38-cp38-macosx_11_0_universal2.whl (43.3 kB view details)

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

caio-0.9.13-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (77.7 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.17+ x86-64

caio-0.9.13-cp37-cp37m-macosx_11_0_x86_64.whl (30.5 kB view details)

Uploaded CPython 3.7m macOS 11.0+ x86-64

caio-0.9.13-cp37-cp37m-macosx_10_9_x86_64.whl (35.4 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: caio-0.9.13.tar.gz
  • Upload date:
  • Size: 26.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/32.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.62.3 importlib-metadata/5.2.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for caio-0.9.13.tar.gz
Algorithm Hash digest
SHA256 26f1e08a442bef4526a66142ea4e325e22dca8f040800aecb3caf8fae0589e98
MD5 8f06aaded3acd8488c643be4845e9b4b
BLAKE2b-256 487a8b7537bc156b4f56e810e0cf47f3e7b1d1f6e4856a8083f5316bd7186f0b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: caio-0.9.13-py3-none-any.whl
  • Upload date:
  • Size: 19.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for caio-0.9.13-py3-none-any.whl
Algorithm Hash digest
SHA256 582cbfc6e203d1dedf662ba972a94db6e744fe0b6bb9e02922b0f86803006fc9
MD5 7cba7508f7855b558ed401f3242f6c6f
BLAKE2b-256 0ee08f96161485912c8ea461c8735fb6ea915b405ad4d769a2fec8b237f4956f

See more details on using hashes here.

File details

Details for the file caio-0.9.13-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.13-cp311-cp311-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a914684bad2a757cf013ae88d785d81659a3add1885bad60cd20bfbd3068bd5a
MD5 b1113ec97ee1727b7a686ed2d3eaa8b6
BLAKE2b-256 930238111125a24da778b8722d98692921eb3585d3b78b5f641b4c65da714140

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for caio-0.9.13-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 789f8b55f4a2b46be14361df3ac8d14b6c8f0a3730badd70cb1b7778fcdc7039
MD5 952297474ad3c04c5069abcb99340163
BLAKE2b-256 d87cf01d25148f31880cf7dad855f81f9d14565256abd348155f3edadbcef02e

See more details on using hashes here.

File details

Details for the file caio-0.9.13-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.13-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 18307046421f4a8cac85c3d84aa941ab283fbbf0e57f0e5f81a306a057668f43
MD5 3beafea589e4d17cd5b2c226488fe8f9
BLAKE2b-256 d3230953227b616054cbf4a6f19d1ddb35ad3353570163f7c763eb53ec415ac6

See more details on using hashes here.

File details

Details for the file caio-0.9.13-cp310-cp310-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for caio-0.9.13-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 0a04bcac15b0c18057ec57dd9666c4d5c1058958a8db5191b46a1e54931c4a6e
MD5 dac85573c53b4fea4a1ea3eb2f26eff1
BLAKE2b-256 8d5abd07815c13603a486784cb8b10fedc09fc0636f244557d74b2e8f3ed950f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: caio-0.9.13-cp310-cp310-macosx_10_9_universal2.whl
  • Upload date:
  • Size: 43.3 kB
  • Tags: CPython 3.10, macOS 10.9+ universal2 (ARM64, x86-64)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/32.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.62.3 importlib-metadata/5.2.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for caio-0.9.13-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 a921c0514ea2bb161d9d9c4940d409a2431cc6bab89abbf20fb16fdc6964f650
MD5 22915048a4b181247715d273bdc2ce4c
BLAKE2b-256 32a13e8bed00ec600d0aac9e968b616743dcb8c76eef854f28e4690d6206072a

See more details on using hashes here.

File details

Details for the file caio-0.9.13-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.13-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a090ab82f21b310b56fa6afe04b3be92a0d1577a2e57127b61426c9dd6df34be
MD5 4523459210307d18dfc897c5b7e6edbf
BLAKE2b-256 0153228d9cf8b53daded1a1250480fe2d58fc8d187cb3c6e23b6dbf3e5425f74

See more details on using hashes here.

File details

Details for the file caio-0.9.13-cp39-cp39-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for caio-0.9.13-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 a07c9933543d18f98525f34a786700134403f13050a5bd22a642629e2ab410d4
MD5 2cf46800c23caf7ed8d8d79dac8fc256
BLAKE2b-256 799942fd7de245180b7842544aa9a5fa59627b656dc3832b56b1371a645f2dbb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: caio-0.9.13-cp39-cp39-macosx_10_9_universal2.whl
  • Upload date:
  • Size: 43.3 kB
  • Tags: CPython 3.9, macOS 10.9+ universal2 (ARM64, x86-64)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/32.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.62.3 importlib-metadata/5.2.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for caio-0.9.13-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 b1e4252b783ad25f15eeff6e412f7e9ec9409e7b4a81fd2893dc1ce1819385ff
MD5 1a27b11830bc8d59cddbb1ef23a7fd0e
BLAKE2b-256 0304658da5e08407d01d2167c7554ab7108d181b3ef2ecc925f2b1bbab77e3c3

See more details on using hashes here.

File details

Details for the file caio-0.9.13-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.13-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9b7b6eafa11a446dced3cd10342140e618acb548b513aaf3a1fa4c86451d3856
MD5 958720816eb053c678be779b5537cf85
BLAKE2b-256 171c1a108d5817bf906d4dea6a966f183bebe8804e8f4b6a6ccd66671d3e5ac7

See more details on using hashes here.

File details

Details for the file caio-0.9.13-cp38-cp38-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for caio-0.9.13-cp38-cp38-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 48f2c32f67923c728f4b79e03e4a0fc8dc175aa079a1e301773ab7d6baaa571f
MD5 6f77fe18b15e62cf941abd4db03a6973
BLAKE2b-256 8622041bc8104aa222f7aa401168a3d610656e9d12c3c95b04539852b8aa9bb6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: caio-0.9.13-cp38-cp38-macosx_11_0_universal2.whl
  • Upload date:
  • Size: 43.3 kB
  • Tags: CPython 3.8, macOS 11.0+ universal2 (ARM64, x86-64)
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/32.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.62.3 importlib-metadata/5.2.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for caio-0.9.13-cp38-cp38-macosx_11_0_universal2.whl
Algorithm Hash digest
SHA256 9c5f115c6b5e032f00f35d5da69f27322272b1cb8d51a21da1c2444bd1926beb
MD5 a0c5574fdbf6be65dd5add0af4fe8c2e
BLAKE2b-256 427c860bed1182a63169fd6806aea23c8b52970f327b65729c0cf2d2c858739f

See more details on using hashes here.

File details

Details for the file caio-0.9.13-cp37-cp37m-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.13-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 114d6c158dc592849532fd0992cbfb85430f4f6e48323a3990c39e4741f81a25
MD5 0863556028b2fe505e14eb23f78a9eae
BLAKE2b-256 ca5ace82484bc6fe4a633d751a44aa5c5fbd255ef404039299660d5317a088d9

See more details on using hashes here.

File details

Details for the file caio-0.9.13-cp37-cp37m-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for caio-0.9.13-cp37-cp37m-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 e13c1b882f1c16bc15441d4cfe3e7e6b58b66cb5cf07a0ce46103ff9d0c1d16b
MD5 47073a901fdb2ff95886ecd725ee364c
BLAKE2b-256 a922822e5afca153b14c9e0db36e244342b8ad1f0d30b4b78539b6aaee19fe31

See more details on using hashes here.

File details

Details for the file caio-0.9.13-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: caio-0.9.13-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 35.4 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/32.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.12 tqdm/4.62.3 importlib-metadata/5.2.0 keyring/23.13.1 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for caio-0.9.13-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a6577cec932011db441a87bb35051a0ae8c6f970ea1af165cef3106746ae9a52
MD5 ce2a7829c3d9461ec43b43deb1ec20bc
BLAKE2b-256 7a0cc92457ec01585d44e95af5591afaa1dc63aa5f3624ef07ba5ef3a62763c8

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