skillfed

aiocsv

aiocsv v1.4.1 1.6M downloads/30d#3,732 on PyPI74
Permissive license Active released

What it is and what it does

aiocsv is an async-first CSV library that mirrors Python's standard csv module but integrates with asyncio. It provides four main classes—AsyncReader, AsyncDictReader, AsyncWriter, and AsyncDictWriter—that accept objects with async read() or write() coroutines instead of file-like objects. This allows you to process CSV data without blocking the event loop, making it suitable for I/O-bound applications that need to handle multiple concurrent file operations or integrate CSV processing into larger async workflows.

The library implements its own custom CSV parser for reading (matching CPython's behavior) and wraps the synchronous csv module's serializers for writing. It requires Python 3.10+ and has a single runtime dependency on typing_extensions. The C extension provides performance optimization, though pre-built wheels are available for most platforms; you may need a compiler if your configuration is uncommon.

Use it for:

  • Process CSV files concurrently in an async application without blocking the event loop.
  • Stream large CSV datasets through an async pipeline while performing concurrent I/O operations.
  • Read or write CSV data from/to async sources using objects with async read/write coroutines.
  • Build async workflows that parse CSV input and write transformed CSV output simultaneously.
  • Handle tab-separated or other delimited formats asynchronously using dialect parameters.

Worth the install?

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

Provides async-compatible CSV reading and writing using AsyncReader, AsyncDictReader, AsyncWriter, and AsyncDictWriter classes that work with objects exposing async read/write coroutines.

Yes, if you need async CSV I/O in an asyncio application. The library is actively maintained, permissively licensed, has no known vulnerabilities, and offers a drop-in async replacement for the standard csv module. Install friction is moderate due to the C extension, but pre-built wheels cover common platforms. Not necessary if you only need synchronous CSV processing or are not using asyncio.

Install

aiocsv on PyPI

pip

pip install aiocsv

uv

uv add aiocsv

poetry

poetry add aiocsv

Installing aiocsv

Before you install

Medium install friction due to a C extension; pre-built wheels cover Python 3.10–3.12 on common platforms (x86_64, ARM, Windows, Linux, macOS), but you may need a C compiler and Python headers if your configuration lacks a pre-built binary. Active maintenance with recent releases.

License in practice

MIT license (permissive); you can use, modify, and distribute aiocsv freely in commercial and private projects with minimal restrictions.

Quickstart

import asyncio
from aiocsv import AsyncReader

async def main():
    # Requires an async file object with read(size: int) coroutine
    async for row in AsyncReader(asyncfile):
        print(row)  # row is a list

asyncio.run(main())

Requires Python 3.10+. You must provide an async file object with a read(size: int) coroutine; standard open() will not work.

Verify before relying

  • Whether the C extension significantly improves performance over pure-Python alternatives.
  • Compatibility with async frameworks beyond asyncio (e.g., Trio, Curio).
  • Memory overhead when processing very large CSV files in streaming mode.
  • Practical performance characteristics for typical workloads.

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.10)
Install friction medium — platform-specific wheel
Runtime dependencies 1 — typing_extensions
Maintenance actively maintained — 84 days since the last release
Last repo commit
First released
Downloads 1,593,923/month — #3,732 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: aiocsv-1.4.1-cp310-cp310-macosx_10_9_x86_64.whl; aiocsv-1.4.1-cp310-cp310-macosx_11_0_arm64.whl; aiocsv-1.4.1-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl; aiocsv-1.4.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; aiocsv-1.4.1-cp310-cp310-musllinux_1_2_aarch64.whl; aiocsv-1.4.1-cp310-cp310-musllinux_1_2_x86_64.whl; aiocsv-1.4.1-cp310-cp310-win32.whl; aiocsv-1.4.1-cp310-cp310-win_amd64.whl; aiocsv-1.4.1-cp311-cp311-macosx_10_9_x86_64.whl; aiocsv-1.4.1-cp311-cp311-macosx_11_0_arm64.whl; aiocsv-1.4.1-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl; aiocsv-1.4.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; aiocsv-1.4.1-cp311-cp311-musllinux_1_2_aarch64.whl; aiocsv-1.4.1-cp311-cp311-musllinux_1_2_x86_64.whl; aiocsv-1.4.1-cp311-cp311-win32.whl; aiocsv-1.4.1-cp311-cp311-win_amd64.whl; aiocsv-1.4.1-cp312-cp312-macosx_10_13_x86_64.whl; aiocsv-1.4.1-cp312-cp312-macosx_11_0_arm64.whl; aiocsv-1.4.1-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl; aiocsv-1.4.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl

Keywords: async, asynchronous, csv, tsv

Development Status :: 5 - Production/StableFramework :: AsyncIOLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3 :: Only

Tags

async csv reader writerasynchronous csv parsingasync file csv processingasyncio csv handlingnon-blocking csv operationsasync tsv readerconcurrent csv reading
async-iocsv-parsingdata-processing

More Text Processing packages