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

Uploaded Source

Built Distributions

caio-0.8.0-cp39-cp39-manylinux2010_x86_64.whl (82.6 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

caio-0.8.0-cp39-cp39-macosx_10_9_x86_64.whl (33.5 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

caio-0.8.0-cp38-cp38-manylinux2010_x86_64.whl (105.4 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

caio-0.8.0-cp38-cp38-macosx_10_9_x86_64.whl (43.4 kB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

caio-0.8.0-cp37-cp37m-manylinux2010_x86_64.whl (83.1 kB view details)

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

caio-0.8.0-cp37-cp37m-macosx_10_9_x86_64.whl (33.4 kB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

caio-0.8.0-cp36-cp36m-manylinux2010_x86_64.whl (81.3 kB view details)

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

caio-0.8.0-cp36-cp36m-macosx_10_9_x86_64.whl (33.4 kB view details)

Uploaded CPython 3.6m macOS 10.9+ x86-64

caio-0.8.0-cp35-cp35m-manylinux2010_x86_64.whl (80.9 kB view details)

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

File details

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

File metadata

  • Download URL: caio-0.8.0.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3

File hashes

Hashes for caio-0.8.0.tar.gz
Algorithm Hash digest
SHA256 87655ee2510ef6f0e9bf0b5cd77fc04a79236ac0259a9739e75622fa2fd1b674
MD5 4e4c7dfbf70dacee9aa45755b5d196a6
BLAKE2b-256 293b36940a178e68ee49fbe52c31b1e76743c4f904845c6938207b107b750954

See more details on using hashes here.

File details

Details for the file caio-0.8.0-cp39-cp39-manylinux2010_x86_64.whl.

File metadata

  • Download URL: caio-0.8.0-cp39-cp39-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 82.6 kB
  • Tags: CPython 3.9, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3

File hashes

Hashes for caio-0.8.0-cp39-cp39-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 ae54d0e409732882448ae9a730151acba9ac4cb536d03cbfd77114587cb858f7
MD5 c0e3ce5cb2ffd959a1932c58a03cee79
BLAKE2b-256 0b6ae61f04ff06439788b38f509726407f19dc3e6e03a2d4eb5ac284d689934c

See more details on using hashes here.

File details

Details for the file caio-0.8.0-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: caio-0.8.0-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 33.5 kB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3

File hashes

Hashes for caio-0.8.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b1b163d2603a7001ac39f00c2dfaf0e9fff56d3fa2553b708e9bb0fc39ac9432
MD5 37e95b797f3d495619aa97fb9b1a849b
BLAKE2b-256 f674f343c8de480d45cb89d08ddc9af5e831ab881f7721f1f2ef91f3c1727074

See more details on using hashes here.

File details

Details for the file caio-0.8.0-cp38-cp38-manylinux2010_x86_64.whl.

File metadata

  • Download URL: caio-0.8.0-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 105.4 kB
  • Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3

File hashes

Hashes for caio-0.8.0-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 601b219fe167c2aeb74bf91f1ca7a4d0fc0ba63767cee79f9a1c14c679e11fdf
MD5 285efa64627bee155bbf566d33455544
BLAKE2b-256 5d6652e8c95db5c3a13ca8940d5c1164e38bb705506c0a56df4ba11b2f4a66df

See more details on using hashes here.

File details

Details for the file caio-0.8.0-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: caio-0.8.0-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 43.4 kB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3

File hashes

Hashes for caio-0.8.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d45361b84edc74868e46d5bf34a2879f69b1d278e60922f9b98ab2962a593f03
MD5 e1453d006a2c33958597d70257d96846
BLAKE2b-256 cd3bfde1677e0b4266f37b905b37e33f79bfc9126b2fcbfabdc0b0434e62bed6

See more details on using hashes here.

File details

Details for the file caio-0.8.0-cp37-cp37m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: caio-0.8.0-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 83.1 kB
  • Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3

File hashes

Hashes for caio-0.8.0-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 c302fe7c417ce2cc1c6c34ebb4b46220592068a14a1e324c8016f19d74b4d7ed
MD5 b0cf13b3f4b9668a8cd320c0bab90829
BLAKE2b-256 eda438dc5e8b511829e7cae9a4952a77b68909178ac0abe65a6b967077d56907

See more details on using hashes here.

File details

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

File metadata

  • Download URL: caio-0.8.0-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 33.4 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3

File hashes

Hashes for caio-0.8.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 1f1d2a41ad67fb6e9af4d89c40056df370b338f0cc6ca1b3d2f7a85675beaab7
MD5 6c1c390e6b722d85e20148fa0a88a1c6
BLAKE2b-256 e45e956d1e0aa3aa231956193f11ef13bbeef59513e20b39b331cad5d3b0738f

See more details on using hashes here.

File details

Details for the file caio-0.8.0-cp36-cp36m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: caio-0.8.0-cp36-cp36m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 81.3 kB
  • Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3

File hashes

Hashes for caio-0.8.0-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 d35b423f178daddff2481594b94d66b1e06afd9f26629eec034f3ae0c950b312
MD5 c18c8f733389d801cf45aeee0fcaf8c8
BLAKE2b-256 1318681d31ce5ddd2304b265b91a4d66d581733aa18db4f8268d0d185afc9707

See more details on using hashes here.

File details

Details for the file caio-0.8.0-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: caio-0.8.0-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 33.4 kB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3

File hashes

Hashes for caio-0.8.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 86dd1076008afa2665e30cf6be3fee3d53b88601abfd7e730b5954b4e64fac40
MD5 57ecb485b917673bbef667c46d0a9a96
BLAKE2b-256 37dc96658f01bdcbd5889f04e9723e93cc6d5a594c1c7ba38079f9e94edbaf09

See more details on using hashes here.

File details

Details for the file caio-0.8.0-cp35-cp35m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: caio-0.8.0-cp35-cp35m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 80.9 kB
  • Tags: CPython 3.5m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.3

File hashes

Hashes for caio-0.8.0-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 12c9354954cced5c86eda101685d3d0b5656bbd50b9293604b68150ce32fb5db
MD5 36ae68bc59fb1b256c77b8c339f5d6db
BLAKE2b-256 6756925391950f6d5b3a9ad246ecf9761e2a4e294c0911fafbebe175271449eb

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