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

Uploaded Source

Built Distributions

caio-0.9.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

caio-0.9.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (82.3 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

caio-0.9.0-cp39-cp39-macosx_10_14_x86_64.whl (27.4 kB view details)

Uploaded CPython 3.9 macOS 10.14+ x86-64

caio-0.9.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (82.9 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

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

Uploaded CPython 3.8 macOS 10.14+ x86-64

caio-0.9.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (82.6 kB view details)

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

caio-0.9.0-cp37-cp37m-macosx_10_14_x86_64.whl (27.4 kB view details)

Uploaded CPython 3.7m macOS 10.14+ x86-64

caio-0.9.0-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (80.8 kB view details)

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

caio-0.9.0-cp36-cp36m-macosx_10_14_x86_64.whl (27.4 kB view details)

Uploaded CPython 3.6m macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: caio-0.9.0.tar.gz
  • Upload date:
  • Size: 22.9 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.0.tar.gz
Algorithm Hash digest
SHA256 7289f835495b2b78fa660c538d5097c827e82dbeedb8b69940e00db4aa1093f0
MD5 ff65e3cd504c47500bc1f12a28531e27
BLAKE2b-256 9e4f84982045cdae93f20b6f27f09746788bac0a95026bdb255400e54baddbfa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: caio-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 399de8f266ede4e87ffa1c647c8bb6859df14039354b6fcf74a47d3d756fdc41
MD5 b08358feaf0ca8a23da069aaf3204b8c
BLAKE2b-256 3bcd8680f48b0cfc07db5428ec394e2a53133a39fc574d6a4acee59eb18784c3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for caio-0.9.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 28c65797378306c2538aa9c27cd9954ea8fda7f143cb6f0a0243175bcd4cd20b
MD5 ed210aa9a6d2e3773239beaa04b99331
BLAKE2b-256 d3c15a6d580ede46ba42e1375da023dd9f8632deb3c604f79b4cba408654d428

See more details on using hashes here.

File details

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

File metadata

  • Download URL: caio-0.9.0-cp39-cp39-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 27.4 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.0-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 5e94636e2df03a7fe9c4e2cc119662eb896b72477818a6f443516933c56e425e
MD5 7d564ce150d51077418bcf9441aa3424
BLAKE2b-256 899e9c5db92df827afccd865435f6b21072b7b448ca3c3c0870f42c73e96b065

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for caio-0.9.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 14d3f00f92bd775a478c41a9768f5fdb2636637bdf3e69ea9b709f376855630d
MD5 6c998994c3131523f1ba686d9e3a6e26
BLAKE2b-256 a22ab503a90e81c58a812601d4267b6bcb0790c0683b2a3c0d7d371fb3a992d6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: caio-0.9.0-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.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.0-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 bc288e8ef4e2886b143032b5a24132d6a59fe805972d15bdbfb0ebb158353d4b
MD5 b70b658ffcbf95e39ec2002f6aedeb68
BLAKE2b-256 cc53b75d38d185e24320276251040a37e0181aae8ffa678c203f17acd2c77421

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for caio-0.9.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 c7991460d0e09d99450ce8fabfd8e61332e7b67c2c1b002b665f34405dbb5c8e
MD5 e08f3ed310bd41050ac945ee306e8928
BLAKE2b-256 00dc5ee36b643be106937b47c97102e75b2e2200b264d93e23e5954a3aacca77

See more details on using hashes here.

File details

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

File metadata

  • Download URL: caio-0.9.0-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 27.4 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.0-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 6ca1cb347b38e734afd7bba5a359099f215cf491ec2e05c07adeea2feb79fee6
MD5 44a9eff981ad089d7b252dc9667a222b
BLAKE2b-256 cee9873564493bd0b7f8f12b9e9c5ec8bf397cf681365d167f53fd949f322dab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for caio-0.9.0-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 89d5686835661c8d7c59b727d1b6cab0cb0b366ed0f90f9b4b9e471bb75dcd5c
MD5 82ecd3175adbe4b8562517aa91f276f4
BLAKE2b-256 01b4f61d58ca7d947a7313e55522afc546caf6a73755e3712c907f5e7704afda

See more details on using hashes here.

File details

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

File metadata

  • Download URL: caio-0.9.0-cp36-cp36m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 27.4 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.0-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 d585cdb1743c456daef915b9ab6f629bdcffac374b791983fcce687bfde420af
MD5 1644427d5387531a4480e4b58a74517d
BLAKE2b-256 7d68d5c19c2fb124e1797c9a4974e641721d1280783ecfe2aab2ec04d6101d7d

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