Skip to main content

Asynchronous file IO for Linux Posix and 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.8.4.tar.gz (23.0 kB view details)

Uploaded Source

Built Distributions

caio-0.8.4-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

caio-0.8.4-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (81.0 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

caio-0.8.4-cp39-cp39-macosx_10_14_x86_64.whl (27.3 kB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

caio-0.8.4-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (81.6 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

caio-0.8.4-cp38-cp38-macosx_10_14_x86_64.whl (27.4 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

caio-0.8.4-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (81.4 kB view details)

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

caio-0.8.4-cp37-cp37m-macosx_10_14_x86_64.whl (27.3 kB view details)

Uploaded CPython 3.7m macOS 10.14+ x86-64

caio-0.8.4-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (79.7 kB view details)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

caio-0.8.4-cp36-cp36m-macosx_10_14_x86_64.whl (27.3 kB view details)

Uploaded CPython 3.6m macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: caio-0.8.4.tar.gz
  • Upload date:
  • Size: 23.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for caio-0.8.4.tar.gz
Algorithm Hash digest
SHA256 c49fef200796ac876a3507d2b07478c3920c48968dcef26ff928d191cd89d041
MD5 4512cd077a82f48a4ea6f749d019eb4b
BLAKE2b-256 bc3fca52ad6ae0a1189e8c97f04f16266bb572ec6e010c37236a7675b26d3875

See more details on using hashes here.

File details

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

File metadata

  • Download URL: caio-0.8.4-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10

File hashes

Hashes for caio-0.8.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f7ee73b182d732bbca937df3ce13767641328f8fc69f92605aaab06feba5a125
MD5 7b7358ddfd21f2a1c7fde8100cfdde1d
BLAKE2b-256 9d60739a616dca82259b195efcafa839937536dce1a907acdbc2ae3989f7427a

See more details on using hashes here.

File details

Details for the file caio-0.8.4-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for caio-0.8.4-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 7a422a877c2d9f2c2cdce0219306bb063a4106765f9cad19d2917c70de415a63
MD5 a52376eb01f90007642f0c7067da1412
BLAKE2b-256 5da707eacc52c905870f1959ed2512d95ac3f4250fe84b225a7c62e9618d7622

See more details on using hashes here.

File details

Details for the file caio-0.8.4-cp39-cp39-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: caio-0.8.4-cp39-cp39-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 27.3 kB
  • Tags: CPython 3.9, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for caio-0.8.4-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 67d0b376676c0959b09d00d8e7715c0dd2127b1503b5727a0a232c6561668d96
MD5 7c083761535f01dc0d969381d94477d1
BLAKE2b-256 5ae92507e6b6e561f972d1bc63a5a52b51b60a6ff061529679f9d8112eb74d06

See more details on using hashes here.

File details

Details for the file caio-0.8.4-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for caio-0.8.4-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 7a948072859730e01add7021b48ed7dbd905fc4bc9eb280d550c2015b09568f8
MD5 49919acee13ec74ddb58f35b56e64cb2
BLAKE2b-256 d49f9bba5980550f1a1ecb3a70674c2671bc18b9e5689ca333d32e9396574fa2

See more details on using hashes here.

File details

Details for the file caio-0.8.4-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: caio-0.8.4-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 27.4 kB
  • Tags: CPython 3.8, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10

File hashes

Hashes for caio-0.8.4-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 7bd2b32fd4ba52970081dd05def99f2610d1a0e785feee09417df00d4c604edd
MD5 59200ab963eb8ec491ee95b12edbf929
BLAKE2b-256 eb8fc72c41319132adc995a7657e6f4eb9af46d552463f8fd64f034281fe082f

See more details on using hashes here.

File details

Details for the file caio-0.8.4-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for caio-0.8.4-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 e4a81aeec1f85f1df2bed04f160832db490d650c025492f3f22c6dac621b01fc
MD5 1d71fe93e95ff0201fdd88261e4f7691
BLAKE2b-256 0f80c2a61e74e1ef6b5a61b18b8458bde4a33b156961805771da5338cb8ac29c

See more details on using hashes here.

File details

Details for the file caio-0.8.4-cp37-cp37m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: caio-0.8.4-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 27.3 kB
  • Tags: CPython 3.7m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.10

File hashes

Hashes for caio-0.8.4-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 4096bd9d237eecfa816d9fc32e529eb36ef803c45a5ebd787ef9407e67e81a8b
MD5 25a2a2192e7846a4dee166a225913e71
BLAKE2b-256 de4d30bdc68bace186450243329b2dcc94573895ff9b6c600bbc8ac9f12dd10f

See more details on using hashes here.

File details

Details for the file caio-0.8.4-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for caio-0.8.4-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 4688182ad76e98ea2682f2f2c243123609145d98aff86bb30cab4f253d39d0f3
MD5 dc9cc951e59681f65c7573c110dfca69
BLAKE2b-256 73df992913c613131bcb3c99875943600e6a560cf796b09a27c50fb50640f425

See more details on using hashes here.

File details

Details for the file caio-0.8.4-cp36-cp36m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: caio-0.8.4-cp36-cp36m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 27.3 kB
  • Tags: CPython 3.6m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.6.13

File hashes

Hashes for caio-0.8.4-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 e03fcc066f9abb121d432ea46a32f0704ad3dc8233f13127e9def73e3bc88197
MD5 2f05f36470e24773238d2875e80a6fc8
BLAKE2b-256 b13b1abc37bd6d6f21e4e149e999dcf076ac3fe83d1439648d4146226b1006e9

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