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

Uploaded Source

Built Distributions

caio-0.9.1-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

caio-0.9.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (84.6 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

caio-0.9.1-cp39-cp39-macosx_10_14_x86_64.whl (29.7 kB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

caio-0.9.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (85.2 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

caio-0.9.1-cp38-cp38-macosx_10_14_x86_64.whl (29.7 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

caio-0.9.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (84.9 kB view details)

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

caio-0.9.1-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.1-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (83.1 kB view details)

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

caio-0.9.1-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.1.tar.gz.

File metadata

  • Download URL: caio-0.9.1.tar.gz
  • Upload date:
  • Size: 24.0 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.1.tar.gz
Algorithm Hash digest
SHA256 4aeb64602d14b1c93e34b8e4fec58e629e1dfe3825d839c1709f8dfec4d49dc6
MD5 f29ba969c5923c743b1810c0814d18a5
BLAKE2b-256 f554b724b3297296ff56d8e467358d912836204a6148beeb8401cd1d56ebd278

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for caio-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e288113a3a50d27aa3bc5375ee55ff76fe176e80f37ddf57fe38e219b410b1d1
MD5 fd19ea8325f62f00dd111f68753de9f5
BLAKE2b-256 65543eb405b5129617657eac42358e6a592c0cebf7cc390ff16f5be7fece0855

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for caio-0.9.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 87ce015fb760b7fc11f71615b58ac42f3fad3a0708d7ffa8abfde3e632b552da
MD5 ee4d7870b7d5615899638330e1e0191b
BLAKE2b-256 d2296039af7022956a59a4015f12c3c108eb06a06d84b009c7e3ddfeec9fc002

See more details on using hashes here.

File details

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

File metadata

  • Download URL: caio-0.9.1-cp39-cp39-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 29.7 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.1-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 9b63ac71b33cc530f94b0ca106fbab8b50c83fb64591530b223c52501b31e466
MD5 2a12f05187358b542edd5603b2368284
BLAKE2b-256 12574d1920413883839de5af669d8227fdcb42acefa1f392c8e674602405ee08

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for caio-0.9.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 34bd90ac36031b6a5da5d6d6b362412b8e3cf86b5cbb2ad131f2ea607cde61fe
MD5 4cff67e08421b7cb3f6be44523bab74a
BLAKE2b-256 152770adea19b78f7d90369da2835cbc8c4f1fca62e55a9eeb196d61ccae47e7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: caio-0.9.1-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 29.7 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.1-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 05a57acf24a929f432b0eed5c45099e81ec59c471c09932a99b55da77ee6d1ec
MD5 3cd4227ce3201a6da0458a8771afccce
BLAKE2b-256 cda87739dc20fd2e3d9e8409c1cc1f88a7ffd1f16b45cb8c8f7054122bd4edc0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for caio-0.9.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 cadea722c2d75408d287dcf319242b410c3eabaec2008af5a00770f296120a61
MD5 9d66d27dc32a3440762ca15a3726db01
BLAKE2b-256 0d98a079344063e4d31087dee971b4bd00723be6dcc6d90c5aa85f7270a8d7a6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: caio-0.9.1-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.1-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 f070d8ee6f987786c775ace521e8eb5ed162d49070c4bc1c59796d47d3927048
MD5 d46f01536c6cd18d4e871e277724b889
BLAKE2b-256 3c017f9f2938e8a10af95bc9699492903acf44bf5ace8606ab5648934b7ec3e5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for caio-0.9.1-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 602f146c0a026662ad6a11a2034533e5a185e5b8bc70e998405866ac82bcd8c6
MD5 ddf04e68a89b7fbdf073dd8d5f6050d5
BLAKE2b-256 5d2ad279286bdc35bbf7f83f595a932ad5e380b31d267d18301acbef8ecc9986

See more details on using hashes here.

File details

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

File metadata

  • Download URL: caio-0.9.1-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.1-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 4d6cbae7be78291e54351353c439366970ea435830f7100fdf1496fb4b8851e1
MD5 ebb6031009b023547f2e5a5e015a532d
BLAKE2b-256 a940fb3d2f79f96b5f6c9124b3a0f58c8640e20dd88f47c38089d82853985afe

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