skillfed

aiopath

📁 Async pathlib for Python

aiopath v0.7.7 209.7K downloads/30d#9,509 on PyPI
Copyleft license LGPL-3.0 DORMANT released

What it is and what it does

aiopath is a direct reimplementation of Python's pathlib module designed to work with asyncio and trio, making all filesystem I/O operations awaitable. Instead of blocking the event loop during file operations, aiopath lets you perform concurrent disk and network I/O in async code. It mirrors pathlib's class hierarchy and API closely—AsyncPath inherits from Path, and methods that perform I/O are async versions of their synchronous counterparts. Methods like glob() return async generators, and file operations like read_text() and write_bytes() are fully awaitable.

The package depends on aiofile, anyio, and typing-extensions. It's useful when you're writing async Python code and want to avoid mixing blocking and non-blocking I/O—for example, in web scrapers that need to fetch multiple URLs concurrently and save responses to disk without stalling the event loop. The implementation wraps os.scandir() and DirEntry to make globbing completely asynchronous.

Use it for:

  • Async web scrapers that fetch multiple URLs concurrently and write responses to disk without blocking the event loop.
  • Building async file utilities or CLI tools that need to read/write many files concurrently.
  • Replacing pathlib in async codebases where you need to traverse directories with glob() without blocking.
  • Async data processing pipelines that read input files and write results concurrently.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Async-compatible reimplementation of Python's pathlib with awaitable I/O operations, compatible with asyncio and trio.

Yes, if you are actively writing asyncio or trio code and need pathlib-like filesystem operations without blocking. The low install friction and zero known vulnerabilities are positive. However, the dormant maintenance status means no active support for bugs or Python version changes—verify that Python 3.12+ support meets your needs and that the package's behavior is stable for your use case before relying on it in production.

Install

aiopath on PyPI

pip

pip install aiopath

uv

uv add aiopath

poetry

poetry add aiopath

Installing aiopath

Before you install

Low install friction with a pure-wheel distribution. Maintenance is dormant—last release was over a year ago—so expect no active bug fixes or feature updates.

License in practice

Licensed under LGPL-3.0 (copyleft). Any derivative work or modification must be distributed under the same license; static linking and proprietary use are restricted.

Quickstart

from aiopath import AsyncPath
import asyncio

async def example():
    path = AsyncPath('example.txt')
    await path.write_text('hello')
    content = await path.read_text()
    print(content)

asyncio.run(example())

Requires Python 3.12 or later.

Verify before relying

  • Whether libaio integration on Linux (mentioned in description) is functional or requires additional setup.
  • Current status of the dormant repository and whether critical bug fixes are being accepted.
  • Stability and compatibility of the package with Python 3.12+ given the dormant maintenance status.

Package facts

License LGPL-3.0 (copyleft)
Python support supports the current Python release (>=3.12)
Install friction low — pure-Python wheel
Runtime dependencies 3 — aiofile, anyio, typing-extensions
Maintenance dormant — 1,033 days since the last release
First released
Downloads 209,724/month — #9,509 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: aiopath-0.7.7-py2.py3-none-any.whl

Tags

async pathlibasyncio file path operationsnon-blocking filesystem accessasync path manipulationconcurrent file I/Oasyncio path utilities
async-iopathlib-alternative

More Software Development packages