Skip to main content

Minimal async file I/O wrapper using asyncio

Project description

asyncfiles

A minimal async file I/O library using asyncio and thread pool executors.

Usage

from pyafiles import AsyncFile
import asyncio

async def main():
    async with AsyncFile('example.txt', 'w') as f:
        await f.write('Hello!')

    async with AsyncFile('example.txt', 'r') as f:
        data = await f.read()
        print(data)

asyncio.run(main())

Features

  • Asynchronous file operations using asyncio.
  • Supports reading, writing, and appending to files.
  • Context manager for automatic resource management.
  • Uses thread pool executors for blocking I/O operations.

Installation

You can install the library using pip:

pip install pyafiles

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

Requirements

  • Python 3.7 or higher

Limitations

  • This library is designed for simple file operations and may not be suitable for high-performance applications.

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

pyafiles-0.1.0.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyafiles-0.1.0-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

Details for the file pyafiles-0.1.0.tar.gz.

File metadata

  • Download URL: pyafiles-0.1.0.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for pyafiles-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7861f28653e4ecd3b81f358fd38c47b84fe3a92567e72d585cbccbca50f9890d
MD5 fd3e11618fcef4837b1aea2f72ada19e
BLAKE2b-256 55418455898dce2c076325936222b7d27c40d22e1803511d3454d71adcc65c5a

See more details on using hashes here.

File details

Details for the file pyafiles-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyafiles-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for pyafiles-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f7a11bb50d489c28bb6898d0421fcaaaf82a311f7e94d924394f8a232ea2f316
MD5 a6581b409a549f1bed57ad7d06e39784
BLAKE2b-256 a37fe3c6cd45cafb56eb158b08bd0d0c1dfe6c5f471485b7b3038be0fcf4dc43

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page