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

Uploaded Source

Built Distributions

caio-0.9.3-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

caio-0.9.3-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (86.2 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

caio-0.9.3-cp39-cp39-macosx_10_14_x86_64.whl (29.8 kB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

caio-0.9.3-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (86.8 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

caio-0.9.3-cp38-cp38-macosx_10_14_x86_64.whl (29.8 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

caio-0.9.3-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (86.6 kB view details)

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

caio-0.9.3-cp37-cp37m-macosx_10_14_x86_64.whl (29.7 kB view details)

Uploaded CPython 3.7m macOS 10.14+ x86-64

caio-0.9.3-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (84.8 kB view details)

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

caio-0.9.3-cp36-cp36m-macosx_10_14_x86_64.whl (29.7 kB view details)

Uploaded CPython 3.6m macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: caio-0.9.3.tar.gz
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for caio-0.9.3.tar.gz
Algorithm Hash digest
SHA256 2e46b0c008b8baadcac9c8acc66aa1fff58acae779a8a81479795a499f3a6a40
MD5 f6f29da00615cae0c6db21e7406a393a
BLAKE2b-256 9ee0e1147ec084789b70513f801ee11196382a8911a646837a851fb21c9ad140

See more details on using hashes here.

File details

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

File metadata

  • Download URL: caio-0.9.3-py3-none-any.whl
  • Upload date:
  • Size: 18.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.6.8

File hashes

Hashes for caio-0.9.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fae7cd90da87effda72ec2ca85df67f6dc91e58c0dfb6244db4c4d32d1a43fb7
MD5 9cf7419df0b17fa60c43dc012d3c9cb0
BLAKE2b-256 e6a3b5d910340c2e87a7cf5014ef76e0dfb81d2ab3e03929b264c94d2b1167e7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for caio-0.9.3-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 4c10054e6bc19e619033bb6f6ef8000b334596f0a947de91462513e5f54054db
MD5 4990a01467322dacb1500d29ba3dee7a
BLAKE2b-256 9a839acf94c79430113dad28f70559619d45bb5a629d9555147ec341e158ea78

See more details on using hashes here.

File details

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

File metadata

  • Download URL: caio-0.9.3-cp39-cp39-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 29.8 kB
  • Tags: CPython 3.9, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for caio-0.9.3-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 ab94072fb0b00ee0108acd938c9444b828bd9dd0afbb54059293c1e5e61f2a76
MD5 94d61876fcb4bbb6762a02157f5fe9a0
BLAKE2b-256 90f5852afca6b0e5c6791f79fb4f5d4f37dc2b35c3a7536c8df6972e9fa1015d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for caio-0.9.3-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 fa4b8f9538a2b52081edee7f972f6644f02149ae7d1ea9c3a7d55df9c1cc182f
MD5 9ae13ce6ff4de8b2f18015e8008c8bd3
BLAKE2b-256 50860c8b5b8bc18ba62e1aa0007c0857a662f3ef8463c6cb784d51f56c295227

See more details on using hashes here.

File details

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

File metadata

  • Download URL: caio-0.9.3-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 29.8 kB
  • Tags: CPython 3.8, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11

File hashes

Hashes for caio-0.9.3-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 e475ed5cadd550aef36b10a74613fa797e8141cd7360af71507ed29eaaf20b0b
MD5 dc7c534846a793494e2dabaa6a271df1
BLAKE2b-256 03788093b05130699fadf5756310d231e4d59c69908e128d1186769d27c95645

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for caio-0.9.3-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 7331c49c6d9036a72ba9ae17de9804359b84c0c3c69bb9f3ab7020bf47f59a53
MD5 97cafc0ea0d6232a5add97d8133c06fe
BLAKE2b-256 66903ddd1bc977501d2bd0db67810c969ca0da3526dc2610a464514aebd3dc9f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: caio-0.9.3-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 29.7 kB
  • Tags: CPython 3.7m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.7.11

File hashes

Hashes for caio-0.9.3-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 cccd691fa9eadb378ec2baf6bce6427640a629426a4dcd56d66b849a09c49949
MD5 2dc2bbc7211fd9dee1efeb6d961fc2b5
BLAKE2b-256 fb496576d7d0a87919ce2036540b9019ce8b0ba5e347990f4811ed2450004a3b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for caio-0.9.3-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 46f649cbd68c6762e0a2d6fc1ab69ab9b06ddcdaab52241514b8c7cce48be08a
MD5 8e7d64612473b414c0646e592f001693
BLAKE2b-256 bd41976f7c09039897c60466863960f03cdcde1857b677551e193e858e21a3ac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: caio-0.9.3-cp36-cp36m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 29.7 kB
  • Tags: CPython 3.6m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.6.14

File hashes

Hashes for caio-0.9.3-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 966575da339c004c2410b4a92a6b7639659a6e90f45849dafa839e9dd2177c77
MD5 f329613009d6bb01c091e95254a8f4eb
BLAKE2b-256 7f0623872bcdc24a65f0f27960a4ba4d9c961013bb7d3002fd15e812399ba93f

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