Skip to main content
Travis CI Latest Version https://img.shields.io/pypi/wheel/aiofile.svg https://img.shields.io/pypi/pyversions/aiofile.svg https://img.shields.io/pypi/l/aiofile.svg

Real asynchronous file operations with asyncio support.

Status

Development - BETA

Features

  • AIOFile has no internal pointer. You should pass offset and chunk_size for each operation or use helpers (Reader or Writer).

  • For POSIX (MacOS X and Linux) using Cython implementaion based on aio.h (using Cython).

  • For non-POSIX systems using thread-based implementation

Code examples

Totally async read and write:

import asyncio
from aiofile import AIOFile, Reader, Writer

async def main(loop):
    aio_file = AIOFile("/tmp/hello.txt", 'w+', loop=loop)

    await aio_file.write(b"Hello ")
    await aio_file.write(b"world", offset=7)
    await aio_file.fsync()

    print(await aio_file.read())

loop = asyncio.get_event_loop()
loop.run_until_complete(main(loop))

Write and read with helpers:

import asyncio
from aiofile import AIOFile, Reader, Writer

async def main(loop):
    aio_file = AIOFile("/tmp/hello.txt", 'w+', loop=loop)

    writer = Writer(aio_file)
    reader = Reader(aio_file, chunk_size=8)

    await writer(b"Hello")
    await writer(b" ")
    await writer(b"World")
    await aio_file.flush()

    async for chunk in reader:
        print(chunk)

loop = asyncio.get_event_loop()
loop.run_until_complete(main(loop))

Metadata

Release files for aiofile 0.5.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aiofile 0.5.3
File Size Uploaded
aiofile-0.5.3.tar.gz 72.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for aiofile 0.5.3
File
aiofile-0.5.3-cp36-cp36m-manylinux1_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64 Details
aiofile-0.5.3-cp36-cp36m-macosx_10_6_intel.whl CPython 3.6 CPython 3.6 pymalloc macOS 10.6+ Intel (x86-64, i386) Details
aiofile-0.5.3-cp35-cp35m-manylinux1_x86_64.whl CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.5+ x86-64 Details
aiofile-0.5.3-cp35-cp35m-macosx_10_6_intel.whl CPython 3.5 CPython 3.5 pymalloc macOS 10.6+ Intel (x86-64, i386) Details
aiofile-0.5.3-cp34-cp34m-manylinux1_x86_64.whl CPython 3.4 CPython 3.4 pymalloc Linux glibc 2.5+ x86-64 Details
aiofile-0.5.3-cp34-cp34m-macosx_10_6_intel.whl CPython 3.4 CPython 3.4 pymalloc macOS 10.6+ Intel (x86-64, i386) Details

Total release size: 922.0 kB

Release files / aiofile-0.5.3.tar.gz

Download URL aiofile-0.5.3.tar.gz
Size 72.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2a37d2e5e42ec11803b31a8939077d39159a7863b48b43dffc4453962db3b61e
BLAKE2b-256 checksum
How to use checksums
8e2ca2c8029c4f80eea2c20317321918abaab7744daf20622a52cd39512440e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / aiofile-0.5.3-cp36-cp36m-manylinux1_x86_64.whl

Download URL aiofile-0.5.3-cp36-cp36m-manylinux1_x86_64.whl
Size 188.2 kB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
0e05e29374a4274606b9cf595012dfe31256705f5330574e9478d3426283aa75
BLAKE2b-256 checksum
How to use checksums
f5e1a0d1f500605f3d960f6505c3444a11f8f751242f2abbcfe4288ba6f3b409
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / aiofile-0.5.3-cp36-cp36m-macosx_10_6_intel.whl

Download URL aiofile-0.5.3-cp36-cp36m-macosx_10_6_intel.whl
Size 93.6 kB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.6+ Intel (x86-64, i386)
SHA-256 checksum
How to use checksums
1bdbf3cd07249f8b5a5cb3d1346bbdce6817e70066b57618f6723f7ee8fd699a
BLAKE2b-256 checksum
How to use checksums
c7e057f0347f4d6f227c5db12fee6aeb024d280bce9e4b50a8fbee8a515f8225
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / aiofile-0.5.3-cp35-cp35m-manylinux1_x86_64.whl

Download URL aiofile-0.5.3-cp35-cp35m-manylinux1_x86_64.whl
Size 185.1 kB
Tags CPython 3.5 CPython 3.5 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
285defdecd84305c62c67c7234449a2a03666b347e952cf5f1c6a532376fe266
BLAKE2b-256 checksum
How to use checksums
4f7eb7f6c516402a6044a62d7a837b9573fc8d86da4891d7b31e6de3ab667cba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / aiofile-0.5.3-cp35-cp35m-macosx_10_6_intel.whl

Download URL aiofile-0.5.3-cp35-cp35m-macosx_10_6_intel.whl
Size 94.9 kB
Tags CPython 3.5 CPython 3.5 pymalloc macOS 10.6+ Intel (x86-64, i386)
SHA-256 checksum
How to use checksums
163e64be51e38c3b3282da180c201205a4e734f9f8f8d7fe767887459cc64704
BLAKE2b-256 checksum
How to use checksums
337dc5dd8b85467cee10f839cd6b926b23b8c2ff35945a0c12f92891af8ac97f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / aiofile-0.5.3-cp34-cp34m-manylinux1_x86_64.whl

Download URL aiofile-0.5.3-cp34-cp34m-manylinux1_x86_64.whl
Size 191.5 kB
Tags CPython 3.4 CPython 3.4 pymalloc Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
c48da5ef555347aa2f438c47310463906457a51a6c44b6ea547d62d07003988b
BLAKE2b-256 checksum
How to use checksums
c9ce6793d0f19a8e64f684ec4eaf0943f0132c437a70c88325b3bbd393920cdc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / aiofile-0.5.3-cp34-cp34m-macosx_10_6_intel.whl

Download URL aiofile-0.5.3-cp34-cp34m-macosx_10_6_intel.whl
Size 96.4 kB
Tags CPython 3.4 CPython 3.4 pymalloc macOS 10.6+ Intel (x86-64, i386)
SHA-256 checksum
How to use checksums
1e86f828437745ba403c9bf376b30d88c8e3f71eb0d115a159e8c12004204197
BLAKE2b-256 checksum
How to use checksums
b9d4b6e52290e21ba393be059bbb0daa4b6a89f852b44216b2d86af13a94d6ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

3.11.1

2 release files

3.11.0

2 release files

3.10.2

2 release files

3.10.1

2 release files

3.10.0

2 release files

3.9.0

2 release files

3.8.8

2 release files

3.8.7

2 release files

3.8.6

2 release files

3.8.5

2 release files

3.8.4

2 release files

3.8.3

2 release files

3.8.2

1 release file

3.8.1

1 release file

3.8.0

1 release file

3.7.4

2 release files

3.7.3

2 release files

3.7.2

2 release files

3.7.1

2 release files

3.7.0

2 release files

3.6.0

2 release files

3.5.1

1 release file

3.5.0

2 release files

3.4.0

2 release files

3.3.3

2 release files

3.3.1

2 release files

3.3.0

2 release files

3.2.1

2 release files

3.2.0

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.0

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.5.2

7 release files

1.5.1

8 release files

1.4.3

8 release files

1.4.2

7 release files

1.4.0

8 release files

1.3.0

7 release files

1.2.6

7 release files

1.2.5

7 release files

1.2.2

7 release files

1.2.1

7 release files

1.2.0

7 release files

This release

0.5.3 This release

7 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page