--- id: csv23 version: "0.3.4" license: MIT license_treatment: permissive maintenance: active --- # csv23 — Python 2/3 unicode CSV compatibility layer License: permissive · Maintenance: active · Downloads: 327.6K/mo ## What it is and what it does csv23 bridges the Python 2/3 divide for CSV handling by exposing the Python 3 csv module API (which uses unicode strings) to both Python 2.7 and Python 3 code. The core problem it solves is that Python 2's csv module works with byte strings while Python 3's works with unicode, making it difficult to write CSV code that runs on both versions. csv23 hides this difference and defaults to UTF-8 encoding throughout. Beyond basic compatibility, it provides convenience utilities like open_csv() context managers for simpler file handling, and on Python 3 it adds read_csv() and write_csv() functions that work with file-like objects (useful for reading/writing CSV data from binary streams). It also includes workarounds for specific stdlib CSV bugs related to escape characters and embedded newlines. Use it for: - Writing CSV parsing/writing code that must run unchanged on both Python 2.7 and Python 3 without conditional logic. - Reading or writing CSV data directly to binary streams without intermediate disk writes. - Calculating checksums over CSV output by piping to hashlib objects without writing to disk. - Transparently handling compressed CSV files (.bz2, .gz, .xz) with the autocompress option. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a Python 3-style unicode CSV API that works consistently across Python 2.7 and Python 3, with UTF-8 as the default encoding and workarounds for stdlib CSV bugs. Yes, if you maintain Python 2.7 code or need to support both Python 2 and 3 in the same codebase. The package is stable, has no known vulnerabilities, and low install friction. However, if you are writing new code for Python 3 only, the standard library csv module is sufficient—install this only if cross-version compatibility is a real requirement. ## Install pip install csv23 uv add csv23 poetry add csv23 ## Installing csv23 Before you install: Low friction: pure Python wheel with a single mock dependency. Repository is active with recent commits (last commit 2026-07-06), though the latest release was 2022-06-12, suggesting the package is stable rather than actively developed. License in practice: MIT license (permissive) means you can use this freely in commercial and open-source projects with minimal restrictions—just include the license notice. Quickstart: pip install csv23 import csv23 with csv23.open_csv('data.csv') as reader: for row in reader: print(row) Verify before relying: - Whether the package is still maintained or in maintenance-only mode given the gap between last release (2022-06-12) and recent commits. - Scope of the stdlib CSV bugs fixed (bpo-12178, bpo-31590) and whether they remain relevant in current Python versions. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 327.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags python 2 3 csv compatibility, unicode csv reader writer, cross-version csv handling, utf-8 csv python 2, csv module wrapper, bytes text csv abstraction, python-2-compat, csv-handling [View on SkillFed](https://skillfed.io/packages/csv23) · [View on PyPI](https://pypi.org/project/csv23/)