uringio
uringio brings true asynchronous file I/O to Python with a native event loop built on io_uring, implemented as C extension for CPython.
⚠️ Currently in active development, so API and internals may change and will be evolved.
Quick Examples
Files
import asyncio
import uringio
async def main():
async with await uringio.open_file(path='testfile.txt') as file:
data = b'Hello, uringio!\n'
await file.write(data=data)
result = await file.read()
asyncio.run(main(), loop_factory=uringio.UringioLoop)
Sockets
import asyncio
import uringio
async def main():
async with await uringio.prep_socket() as socket:
await socket.connect('127.0.0.1', 9000)
await socket.send(b'Hello, uringio!')
data = await socket.recv()
asyncio.run(main(), loop_factory=uringio.UringioLoop)
Fixed buffers - One of io_uring optimization features
import asyncio
import uringio
async def main():
loop = asyncio.get_running_loop()
buf = bytearray(4096)
with loop.buffer_mode(mode=uringio.BUFFER_MODE.FIXED, buffers=[buf]):
await simple_file_example()
asyncio.run(main(), loop_factory=uringio.UringioLoop)
See the whole user guide
See API page
Also, you can watch examples inside docs/examples and run them under ASAN with
make run-examples
Benchmarks
uringio shows that true file async I/O provided by io_uring is superior over current solutions and shows x2 and almost x3 performance:
Write files sequentially
Write files using vector operations
uringio also shows better performance over other solutions in socket operations:
Socket connection storm
⚠️ But uringio and io_uring are not a magic wands, so there are scenarios when its better not to use it. For example:
Load test of concurrent TCP connections with I/O operations
As you can see, with little amount of connections there is no reason to use uringio because of CQEs and SQEs overhead. However, when it comes to many connections - it is the only backend that not degrading under pressure.
Read more about benchmark results in Benchmarks analysis page
Installation
Warning! Linux only uringio requires linux kernel version 6.11 or greater and Python 3.12 or greater. Library is available on PyPI, so use pip to install it:
pip install uringio
Build and use
To build and install use
make install
You can only build by using
make build
Run tests:
make test-all
Run tests under ASAN:
make test-all-asan
While working with code, dont forget to
make lint
Watch more commands in developer guide or inside Makefile. Currently tested only on Fedora 43 with 7.1.5 kernel version
Architecture
io_uring
uringio is written natively as C extension for CPython and brings the new event loop, based on io_uring.
What is io_uring and how it works, explained shortly by us - here
Presenting new objects
- Main:
- UringioLoop
- File
- Socket
- Helpers:
- BufferModeCtx
- StreamStrategyCtx
- TransferModeCtx
- ExecutionContextCtx
- Enums:
- BUFFER_MODE
- STREAM_STRATEGY
- TRANSFER_MODE
- PAYLOAD_TYPE
- Resolve Flags
- Statx Flags
- StatxMask
Whole documentation about their purposes and how they work is in architecture page
Structure
Structure of this project is trying to be simple - we have pure c-layer and pure python-layer and layer in between.
- C-layer - Functionality written entirely in C and basically wrappers aroung liburing ABI
- Python-layer - By analogy it is layer, written with usage of CPython API and CPython objects.
- Layer in between - for now here is really only one thing - registry. It is container to hold objects in between. I wish i could say that in between C-layer and Python-layer, but the meaning is not so. We are working with async nature and giving control of the operations to kernel, so we can do our things. To map the result of kernel with what was intended we need some sort of storage - this is registry.
Domains
- Ring
- Event Loop
- Reader
- OPS
- Buffers
- Execution Context
- Registry
- Timer
- Signals
To read about implementation details, go to architecture page
Contributing
We are looking for help with:
- Propose new features. You can choose something from our roadmap - you can add new checks yourself, but create an issue first.
- Testing on different Linux Distros/Kernels. If you'll find some issues - create some on GitHub.
- Sharing experience in memory management, libraries architecture, cpython, io_uring, epoll and many other things.
- Write tests and benchmarks
- Report bugs
Read next
Roadmap
See here
Metadata
Release files for uringio 0.4.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| uringio-0.4.4.tar.gz | 42.7 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| uringio-0.4.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl | CPython 3.14 | CPython 3.14 | Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 | Details |
| uringio-0.4.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl | CPython 3.13 | CPython 3.13 | Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 | Details |
| uringio-0.4.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 | Details |
Total release size: 892.4 kB
Release files / uringio-0.4.4.tar.gz
| Download URL | uringio-0.4.4.tar.gz |
|---|---|
| Size | 42.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7a3561d20815a1d865e81f8353210b8d04c94704ca6cfbc06943dc1a1e49687c
|
|
BLAKE2b-256 checksum How to use checksums |
bc64efd6abcc498bf51ef03d0ae4c4d176f0468f097bf6c252c923220239a7d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.
Transparency logRelease files / uringio-0.4.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | uringio-0.4.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 284.2 kB |
| Tags | CPython 3.14 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
c2323cc03eeb65117f2e8aaf90581aad684eac4d1c84315afae7b506f766cc1d
|
|
BLAKE2b-256 checksum How to use checksums |
2577a06d71d7f5c83f6a120ff9fcf09fb11a0ef362a81dd903995c5791ff9d35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.
Transparency logRelease files / uringio-0.4.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | uringio-0.4.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 282.7 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
956ea5727a4c09d8a08b8fee21774444da36456d4ed3d4b6b2c172e967c6a55d
|
|
BLAKE2b-256 checksum How to use checksums |
5cc8566c8e1f1c802377c74fd81c1a2daee58449a35beb906c477ceaee46503b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.
Transparency logRelease files / uringio-0.4.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | uringio-0.4.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 282.9 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
571ef4565ed08bfc6a098d42e70b44366a2b7cc61dda8b39b9ab4a9257e9e105
|
|
BLAKE2b-256 checksum How to use checksums |
9275ba005a6321377ab9af7087a2b38f351f0a8cce48ff81a82162f11cedb7c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.
Transparency log