Python 2/3 unicode CSV compatibility layer
Project description
csv23 provides the unicode-based API of the Python 3 csv module for Python 2 and 3. Code that should run under both versions of Python can use it to hide the bytes vs. text difference between 2 and 3 and stick to the newer unicode-based interface.
The package also provides simple convenience functionality such as the open_csv() context manager for opening a CSV file in the right mode and returning a csv.reader or csv.writer:
>>> import csv23
>>> with csv23.open_csv('spam.csv') as reader: # doctest: +SKIP
... for row in reader:
... print(', '.join(row))
Spam!, Spam!, Spam!'
Spam!, Lovely Spam!, Lovely Spam!'
It uses utf-8 as default encoding everywhere.
Links
GitHub: https://github.com/xflr6/csv23
Documentation: https://csv23.readthedocs.io
Changelog: https://csv23.readthedocs.io/en/latest/changelog.html
Issue Tracker: https://github.com/xflr6/csv23/issues
Download: https://pypi.org/project/csv23/#files
Installation
This package runs under Python 2.7, and 3.4+, use pip to install:
$ pip install csv23
See also
License
This package is distributed under the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for csv23-0.1.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7efa54c1ca28a8678ced55e4b1107c7c1b18308800b904437ebbdce7dda3434a |
|
MD5 | ef803a90b49b6a356509b3ad1fa57a05 |
|
BLAKE2b-256 | 563d5a64e03285f14d6d6d18420fa15b5700792a33dabdac4efc3ced01a5e569 |