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

Uploaded Source

Built Distributions

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

Uploaded Python 3

caio-0.9.2-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.2-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.2-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.2-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.2-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.2-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.2-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.2-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.2.tar.gz.

File metadata

  • Download URL: caio-0.9.2.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.2.tar.gz
Algorithm Hash digest
SHA256 64ed9e0a08bf9db5fc6275180e07b2da90b8df75f86475dd9f3f98c40cc1297d
MD5 4e9770e666a2c6b7292e9ebb2a4992b7
BLAKE2b-256 a95318a6bafad0123d79d31aa998184c62128e7d1e428dd1d61ad0c6ff20af50

See more details on using hashes here.

File details

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

File metadata

  • Download URL: caio-0.9.2-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.9.6

File hashes

Hashes for caio-0.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 12346465971048ec4299052991fa6c4458228b4b529aaba0efedf5385e115d4f
MD5 6f6e03b4122d46cdfb55e8190b3548b9
BLAKE2b-256 a7e9fbeceaaac884d088aafb2a130bc64789ca97aaa73b13bf0ae87a3cda3bc5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for caio-0.9.2-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 f30506b37bb21d9edff8b0faaa4f859e5c4946f74eb6aa1a291bf9fbf1c354dc
MD5 38c86ee82bcb8d78527b79cc53cbfba2
BLAKE2b-256 df99d0464233fccfc6ef4a2c69ab61286b146a2c06bbb8f47dd6ce8f5b551c73

See more details on using hashes here.

File details

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

File metadata

  • Download URL: caio-0.9.2-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.2-cp39-cp39-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 55b5600c8a156f82695def870fed1488c44c0899e327d9f999e8e77c9d4f6080
MD5 dff1c8f4363de753a8a439d8e6f575e8
BLAKE2b-256 0974a907afd8d7a114f56dc68d572478fc9af1dd6a7b28a8074c07df5efe761c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for caio-0.9.2-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 da7863ebff147ee6fbdd28be5a55d2e9604dde7a82942fac6bb10b6287fb2ef8
MD5 22e099e858bc58e3f53a8a09fcf87d65
BLAKE2b-256 6a11e9db7330f2e22cc6023b21522904233abcdcc35ce427f503b5784de487d1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: caio-0.9.2-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.2-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 2b8444454f9ac785d4bef393d342722db030830354fd1549171628ba5e39019c
MD5 4d4270e7938f4b4ecc4833634f1de9c9
BLAKE2b-256 160acfa4a635d22c5d8487bda2ae25b025030bf442fac787bdba86e33b8a2e15

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for caio-0.9.2-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 b48100e0812f963fa13f65494df5e237f62d8732f9cc1b099b66dd068870cd84
MD5 f98ae514c8bb8d499d36b05044bfd1dd
BLAKE2b-256 1784cfcf60578d771905c14b4efe1125a9035b217aa464277319494d6d4de96d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: caio-0.9.2-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.2-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 baac4d75fbc6638bb1418db7b7065709132948a95d47fca15965f0fc59a24607
MD5 8de6bccdfa23a81764632e7c55de3c16
BLAKE2b-256 6077c1df09d37ad3082d170f78bc8b91770d68d52f9ac21becceb771022c6b74

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for caio-0.9.2-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 bdc73e3f4bdb5e49a37f2e3bcda333aff279ef855f986b6904d3b6a2815db4f6
MD5 6db1a7d8fed303e5202713692191c708
BLAKE2b-256 155c98ec204eca79851a30676454dd5a760e6eb21b7a33c045c25d24f902ba68

See more details on using hashes here.

File details

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

File metadata

  • Download URL: caio-0.9.2-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.2-cp36-cp36m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 d061c9546600614009b017b103a978db179aeac3cc0b3c28ec1c2b09c74b5282
MD5 5ff8c8817dc6351519644e193f543c2c
BLAKE2b-256 bdec1445898515e6fc9f0f7f4be49c1730b88d80992fe30aa116cc90d89e3cb1

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