Skip to main content

Pathlib support for asyncio

Project description

aiopathlib: Pathlib support for asyncio

aiopathlib is written in Python, for handling local disk files in asyncio applications.

Base on aiofiles and just like pathlib, but use await.

.. code-block:: python

with open('filename', 'w') as f:
    f.write('My file contents')

text = await aiopathlib.AsyncPath('filename').read_text()
print(text)
'My file contents'

content = await aiopathlib.AsyncPath(Path('filename')).read_bytes()
print(cotent)
b'My file contents'

Asynchronous interface to create folder.

.. code-block:: python

await AsyncPath('dirname').mkdir(parents=True)

Features

  • a file API very similar to Python's standard package pathlib, blocking API
  • support for buffered and unbuffered binary files, and buffered text files
  • support for async/await (:PEP:492) constructs

Installation

To install aiofiles, simply:

.. code-block:: bash

$ pip install git+https://gitee.com/waketzheng/aiopathlib.git

Usage

  • read_text
  • read_bytes
  • read_json
  • write_text
  • write_bytes
  • write_json
  • mkdir
  • exists
  • rename
  • remove

History


0.1.0 (2021-06-13)
``````````````````

- Introduced a changelog.
- Publish at gitee.


Contributing

Contributions are very welcome.

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

aiopathlib-0.1.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

aiopathlib-0.1.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiopathlib-0.1.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.9.4 Linux/5.8.0-40-generic

File hashes

Hashes for aiopathlib-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cb932e706ede3967a07726c7d1d7d5ae46ec7aa5f2b07c192b0d4e909d4942f5
MD5 f0510d23cb55a09096a87e163db2b6e6
BLAKE2b-256 5058baac6452304f652d6660e7b369766f9ff1461e12a6794424825db371c393

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aiopathlib-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.9.4 Linux/5.8.0-40-generic

File hashes

Hashes for aiopathlib-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7ed0749b3fceffc4ed68c5c73a5fde08a20162e72e7f8b39617946c18f6c3812
MD5 6f0cf4027c5cd1cf2f0b0d5ca0f977a9
BLAKE2b-256 32cbc60a16b75936a39bbe07db562282a481f74828c16358ace763a57dfe5c9a

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