Python wrapper for AIO
======================
.. warning:: Native Linux aio implementation supports since 4.18 kernel version.
Python bindings for Linux AIO API and simple asyncio wrapper.
Example
-------
.. code-block:: python
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.
Raw data
{
"_id": null,
"home_page": "",
"name": "caio",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7, <4",
"maintainer_email": "",
"keywords": "",
"author": "Dmitry Orlov <me@mosquito.su>",
"author_email": "me@mosquito.su",
"download_url": "https://files.pythonhosted.org/packages/48/7a/8b7537bc156b4f56e810e0cf47f3e7b1d1f6e4856a8083f5316bd7186f0b/caio-0.9.13.tar.gz",
"platform": null,
"description": "Python wrapper for AIO\n======================\n\n.. warning:: Native Linux aio implementation supports since 4.18 kernel version.\n\nPython bindings for Linux AIO API and simple asyncio wrapper.\n\nExample\n-------\n\n.. code-block:: python\n\n import asyncio\n from caio import AsyncioContext\n\n loop = asyncio.get_event_loop()\n\n async def main():\n # max_requests=128 by default\n ctx = AsyncioContext(max_requests=128)\n\n with open(\"test.file\", \"wb+\") as fp:\n fd = fp.fileno()\n\n # Execute one write operation\n await ctx.write(b\"Hello world\", fd, offset=0)\n\n # Execute one read operation\n print(await ctx.read(32, fd, offset=0))\n\n # Execute one fdsync operation\n await ctx.fdsync(fd)\n\n op1 = ctx.write(b\"Hello from \", fd, offset=0)\n op2 = ctx.write(b\"async world\", fd, offset=11)\n\n await asyncio.gather(op1, op2)\n\n print(await ctx.read(32, fd, offset=0))\n # Hello from async world\n\n\n loop.run_until_complete(main())\n\n\nTroubleshooting\n---------------\n\nThe ``linux`` implementation works normal for modern linux kernel versions\nand file systems. So you may have problems specific for your environment.\nIt's not a bug and might be resolved some ways:\n\n1. Upgrade the kernel\n2. Use compatible file system\n3. Use threads based or pure python implementation.\n\nThe caio since version 0.7.0 contains some ways to do this.\n\n1. In runtime use the environment variable ``CAIO_IMPL`` with\npossible values:\n\n* ``linux`` - use native linux kernels aio mechanism\n* ``thread`` - use thread based implementation written in C\n* ``python`` - use pure python implementation\n\n2. File ``default_implementation`` located near ``__init__.py`` in caio\ninstallation path. It's useful for distros package maintainers. This file\nmight contains comments (lines starts with ``#`` symbol) and the first line\nshould be one of ``linux`` ``thread`` or ``python``.\n\nPrevious versions allows direct import of the target implementation.\n\n\n",
"bugtrack_url": null,
"license": "Apache Software License",
"summary": "Asynchronous file IO for Linux MacOS or Windows.",
"version": "0.9.13",
"project_urls": {
"Documentation": "https://github.com/mosquito/caio/",
"Source": "https://github.com/mosquito/caio"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "32a13e8bed00ec600d0aac9e968b616743dcb8c76eef854f28e4690d6206072a",
"md5": "22915048a4b181247715d273bdc2ce4c",
"sha256": "a921c0514ea2bb161d9d9c4940d409a2431cc6bab89abbf20fb16fdc6964f650"
},
"downloads": -1,
"filename": "caio-0.9.13-cp310-cp310-macosx_10_9_universal2.whl",
"has_sig": false,
"md5_digest": "22915048a4b181247715d273bdc2ce4c",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.7, <4",
"size": 43259,
"upload_time": "2023-08-18T20:50:28",
"upload_time_iso_8601": "2023-08-18T20:50:28.909352Z",
"url": "https://files.pythonhosted.org/packages/32/a1/3e8bed00ec600d0aac9e968b616743dcb8c76eef854f28e4690d6206072a/caio-0.9.13-cp310-cp310-macosx_10_9_universal2.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8d5abd07815c13603a486784cb8b10fedc09fc0636f244557d74b2e8f3ed950f",
"md5": "dac85573c53b4fea4a1ea3eb2f26eff1",
"sha256": "0a04bcac15b0c18057ec57dd9666c4d5c1058958a8db5191b46a1e54931c4a6e"
},
"downloads": -1,
"filename": "caio-0.9.13-cp310-cp310-macosx_11_0_x86_64.whl",
"has_sig": false,
"md5_digest": "dac85573c53b4fea4a1ea3eb2f26eff1",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.7, <4",
"size": 30503,
"upload_time": "2023-08-18T20:52:13",
"upload_time_iso_8601": "2023-08-18T20:52:13.015846Z",
"url": "https://files.pythonhosted.org/packages/8d/5a/bd07815c13603a486784cb8b10fedc09fc0636f244557d74b2e8f3ed950f/caio-0.9.13-cp310-cp310-macosx_11_0_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d3230953227b616054cbf4a6f19d1ddb35ad3353570163f7c763eb53ec415ac6",
"md5": "3beafea589e4d17cd5b2c226488fe8f9",
"sha256": "18307046421f4a8cac85c3d84aa941ab283fbbf0e57f0e5f81a306a057668f43"
},
"downloads": -1,
"filename": "caio-0.9.13-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "3beafea589e4d17cd5b2c226488fe8f9",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.7, <4",
"size": 79344,
"upload_time": "2023-08-18T20:52:30",
"upload_time_iso_8601": "2023-08-18T20:52:30.322346Z",
"url": "https://files.pythonhosted.org/packages/d3/23/0953227b616054cbf4a6f19d1ddb35ad3353570163f7c763eb53ec415ac6/caio-0.9.13-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d87cf01d25148f31880cf7dad855f81f9d14565256abd348155f3edadbcef02e",
"md5": "952297474ad3c04c5069abcb99340163",
"sha256": "789f8b55f4a2b46be14361df3ac8d14b6c8f0a3730badd70cb1b7778fcdc7039"
},
"downloads": -1,
"filename": "caio-0.9.13-cp311-cp311-macosx_10_9_universal2.whl",
"has_sig": false,
"md5_digest": "952297474ad3c04c5069abcb99340163",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.7, <4",
"size": 38197,
"upload_time": "2023-08-18T20:52:29",
"upload_time_iso_8601": "2023-08-18T20:52:29.161963Z",
"url": "https://files.pythonhosted.org/packages/d8/7c/f01d25148f31880cf7dad855f81f9d14565256abd348155f3edadbcef02e/caio-0.9.13-cp311-cp311-macosx_10_9_universal2.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "930238111125a24da778b8722d98692921eb3585d3b78b5f641b4c65da714140",
"md5": "b1113ec97ee1727b7a686ed2d3eaa8b6",
"sha256": "a914684bad2a757cf013ae88d785d81659a3add1885bad60cd20bfbd3068bd5a"
},
"downloads": -1,
"filename": "caio-0.9.13-cp311-cp311-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "b1113ec97ee1727b7a686ed2d3eaa8b6",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.7, <4",
"size": 79938,
"upload_time": "2023-08-18T20:52:31",
"upload_time_iso_8601": "2023-08-18T20:52:31.425572Z",
"url": "https://files.pythonhosted.org/packages/93/02/38111125a24da778b8722d98692921eb3585d3b78b5f641b4c65da714140/caio-0.9.13-cp311-cp311-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7a0cc92457ec01585d44e95af5591afaa1dc63aa5f3624ef07ba5ef3a62763c8",
"md5": "ce2a7829c3d9461ec43b43deb1ec20bc",
"sha256": "a6577cec932011db441a87bb35051a0ae8c6f970ea1af165cef3106746ae9a52"
},
"downloads": -1,
"filename": "caio-0.9.13-cp37-cp37m-macosx_10_9_x86_64.whl",
"has_sig": false,
"md5_digest": "ce2a7829c3d9461ec43b43deb1ec20bc",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": ">=3.7, <4",
"size": 35352,
"upload_time": "2023-08-18T20:53:43",
"upload_time_iso_8601": "2023-08-18T20:53:43.767273Z",
"url": "https://files.pythonhosted.org/packages/7a/0c/c92457ec01585d44e95af5591afaa1dc63aa5f3624ef07ba5ef3a62763c8/caio-0.9.13-cp37-cp37m-macosx_10_9_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a922822e5afca153b14c9e0db36e244342b8ad1f0d30b4b78539b6aaee19fe31",
"md5": "47073a901fdb2ff95886ecd725ee364c",
"sha256": "e13c1b882f1c16bc15441d4cfe3e7e6b58b66cb5cf07a0ce46103ff9d0c1d16b"
},
"downloads": -1,
"filename": "caio-0.9.13-cp37-cp37m-macosx_11_0_x86_64.whl",
"has_sig": false,
"md5_digest": "47073a901fdb2ff95886ecd725ee364c",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": ">=3.7, <4",
"size": 30453,
"upload_time": "2023-08-18T20:52:26",
"upload_time_iso_8601": "2023-08-18T20:52:26.391442Z",
"url": "https://files.pythonhosted.org/packages/a9/22/822e5afca153b14c9e0db36e244342b8ad1f0d30b4b78539b6aaee19fe31/caio-0.9.13-cp37-cp37m-macosx_11_0_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ca5ace82484bc6fe4a633d751a44aa5c5fbd255ef404039299660d5317a088d9",
"md5": "0863556028b2fe505e14eb23f78a9eae",
"sha256": "114d6c158dc592849532fd0992cbfb85430f4f6e48323a3990c39e4741f81a25"
},
"downloads": -1,
"filename": "caio-0.9.13-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "0863556028b2fe505e14eb23f78a9eae",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": ">=3.7, <4",
"size": 77710,
"upload_time": "2023-08-18T20:52:32",
"upload_time_iso_8601": "2023-08-18T20:52:32.884485Z",
"url": "https://files.pythonhosted.org/packages/ca/5a/ce82484bc6fe4a633d751a44aa5c5fbd255ef404039299660d5317a088d9/caio-0.9.13-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "427c860bed1182a63169fd6806aea23c8b52970f327b65729c0cf2d2c858739f",
"md5": "a0c5574fdbf6be65dd5add0af4fe8c2e",
"sha256": "9c5f115c6b5e032f00f35d5da69f27322272b1cb8d51a21da1c2444bd1926beb"
},
"downloads": -1,
"filename": "caio-0.9.13-cp38-cp38-macosx_11_0_universal2.whl",
"has_sig": false,
"md5_digest": "a0c5574fdbf6be65dd5add0af4fe8c2e",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.7, <4",
"size": 43343,
"upload_time": "2023-08-18T20:53:45",
"upload_time_iso_8601": "2023-08-18T20:53:45.325082Z",
"url": "https://files.pythonhosted.org/packages/42/7c/860bed1182a63169fd6806aea23c8b52970f327b65729c0cf2d2c858739f/caio-0.9.13-cp38-cp38-macosx_11_0_universal2.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8622041bc8104aa222f7aa401168a3d610656e9d12c3c95b04539852b8aa9bb6",
"md5": "6f77fe18b15e62cf941abd4db03a6973",
"sha256": "48f2c32f67923c728f4b79e03e4a0fc8dc175aa079a1e301773ab7d6baaa571f"
},
"downloads": -1,
"filename": "caio-0.9.13-cp38-cp38-macosx_11_0_x86_64.whl",
"has_sig": false,
"md5_digest": "6f77fe18b15e62cf941abd4db03a6973",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.7, <4",
"size": 30517,
"upload_time": "2023-08-18T20:52:39",
"upload_time_iso_8601": "2023-08-18T20:52:39.359187Z",
"url": "https://files.pythonhosted.org/packages/86/22/041bc8104aa222f7aa401168a3d610656e9d12c3c95b04539852b8aa9bb6/caio-0.9.13-cp38-cp38-macosx_11_0_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "171c1a108d5817bf906d4dea6a966f183bebe8804e8f4b6a6ccd66671d3e5ac7",
"md5": "958720816eb053c678be779b5537cf85",
"sha256": "9b7b6eafa11a446dced3cd10342140e618acb548b513aaf3a1fa4c86451d3856"
},
"downloads": -1,
"filename": "caio-0.9.13-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "958720816eb053c678be779b5537cf85",
"packagetype": "bdist_wheel",
"python_version": "cp38",
"requires_python": ">=3.7, <4",
"size": 79712,
"upload_time": "2023-08-18T20:52:34",
"upload_time_iso_8601": "2023-08-18T20:52:34.007402Z",
"url": "https://files.pythonhosted.org/packages/17/1c/1a108d5817bf906d4dea6a966f183bebe8804e8f4b6a6ccd66671d3e5ac7/caio-0.9.13-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0304658da5e08407d01d2167c7554ab7108d181b3ef2ecc925f2b1bbab77e3c3",
"md5": "1a27b11830bc8d59cddbb1ef23a7fd0e",
"sha256": "b1e4252b783ad25f15eeff6e412f7e9ec9409e7b4a81fd2893dc1ce1819385ff"
},
"downloads": -1,
"filename": "caio-0.9.13-cp39-cp39-macosx_10_9_universal2.whl",
"has_sig": false,
"md5_digest": "1a27b11830bc8d59cddbb1ef23a7fd0e",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.7, <4",
"size": 43255,
"upload_time": "2023-08-18T20:53:48",
"upload_time_iso_8601": "2023-08-18T20:53:48.389997Z",
"url": "https://files.pythonhosted.org/packages/03/04/658da5e08407d01d2167c7554ab7108d181b3ef2ecc925f2b1bbab77e3c3/caio-0.9.13-cp39-cp39-macosx_10_9_universal2.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "799942fd7de245180b7842544aa9a5fa59627b656dc3832b56b1371a645f2dbb",
"md5": "2cf46800c23caf7ed8d8d79dac8fc256",
"sha256": "a07c9933543d18f98525f34a786700134403f13050a5bd22a642629e2ab410d4"
},
"downloads": -1,
"filename": "caio-0.9.13-cp39-cp39-macosx_11_0_x86_64.whl",
"has_sig": false,
"md5_digest": "2cf46800c23caf7ed8d8d79dac8fc256",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.7, <4",
"size": 30523,
"upload_time": "2023-08-18T20:53:30",
"upload_time_iso_8601": "2023-08-18T20:53:30.689295Z",
"url": "https://files.pythonhosted.org/packages/79/99/42fd7de245180b7842544aa9a5fa59627b656dc3832b56b1371a645f2dbb/caio-0.9.13-cp39-cp39-macosx_11_0_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0153228d9cf8b53daded1a1250480fe2d58fc8d187cb3c6e23b6dbf3e5425f74",
"md5": "4523459210307d18dfc897c5b7e6edbf",
"sha256": "a090ab82f21b310b56fa6afe04b3be92a0d1577a2e57127b61426c9dd6df34be"
},
"downloads": -1,
"filename": "caio-0.9.13-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "4523459210307d18dfc897c5b7e6edbf",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.7, <4",
"size": 78623,
"upload_time": "2023-08-18T20:52:34",
"upload_time_iso_8601": "2023-08-18T20:52:34.882668Z",
"url": "https://files.pythonhosted.org/packages/01/53/228d9cf8b53daded1a1250480fe2d58fc8d187cb3c6e23b6dbf3e5425f74/caio-0.9.13-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0ee08f96161485912c8ea461c8735fb6ea915b405ad4d769a2fec8b237f4956f",
"md5": "7cba7508f7855b558ed401f3242f6c6f",
"sha256": "582cbfc6e203d1dedf662ba972a94db6e744fe0b6bb9e02922b0f86803006fc9"
},
"downloads": -1,
"filename": "caio-0.9.13-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7cba7508f7855b558ed401f3242f6c6f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7, <4",
"size": 19025,
"upload_time": "2023-08-18T20:52:15",
"upload_time_iso_8601": "2023-08-18T20:52:15.359720Z",
"url": "https://files.pythonhosted.org/packages/0e/e0/8f96161485912c8ea461c8735fb6ea915b405ad4d769a2fec8b237f4956f/caio-0.9.13-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "487a8b7537bc156b4f56e810e0cf47f3e7b1d1f6e4856a8083f5316bd7186f0b",
"md5": "8f06aaded3acd8488c643be4845e9b4b",
"sha256": "26f1e08a442bef4526a66142ea4e325e22dca8f040800aecb3caf8fae0589e98"
},
"downloads": -1,
"filename": "caio-0.9.13.tar.gz",
"has_sig": false,
"md5_digest": "8f06aaded3acd8488c643be4845e9b4b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7, <4",
"size": 26398,
"upload_time": "2023-08-18T20:50:30",
"upload_time_iso_8601": "2023-08-18T20:50:30.958327Z",
"url": "https://files.pythonhosted.org/packages/48/7a/8b7537bc156b4f56e810e0cf47f3e7b1d1f6e4856a8083f5316bd7186f0b/caio-0.9.13.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-18 20:50:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mosquito",
"github_project": "caio",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "caio"
}