A csv library that supports 2 and 3, does the unicode thing properly, and lets you read rows as ordered dictionaries so that the ordering stays correct by default.
Which makes things pretty easy.
Example. You’ve got a csv you want to sanitize by removing a column of passwords.
Here’s how that looks.
import csvx
with csvx.OrderedDictReader('unsanitized.csv') as csv_in:
rows = list(csv_in)
for r in rows:
del r['password']
with csvx.DictWriter('sanitized.csv') as csv_out:
csv_out.write_dicts(rows)
Documentation
Full documentation is at https://csvx.readthedocs.org.
Install
Simply install with pip:
$ pip install csvx
Metadata
Release files for csvx 0.1.1456544203
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| csvx-0.1.1456544203.tar.gz | 3.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| csvx-0.1.1456544203-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 8.7 kB
Release files / csvx-0.1.1456544203.tar.gz
| Download URL | csvx-0.1.1456544203.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ccaef2b344689e14e7a603437dab35979187f9cfb33e137f187c7c3affac34d2
|
|
BLAKE2b-256 checksum How to use checksums |
26fdc10463676f59bd2d29b695b9339a42e24dfc3303adf0c73f47b469d16828
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / csvx-0.1.1456544203-py2.py3-none-any.whl
| Download URL | csvx-0.1.1456544203-py2.py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
9b4567a382d124a7e039fb9e16861fee210ded75ec2c6f6a0672f0163a386324
|
|
BLAKE2b-256 checksum How to use checksums |
c77206568f5434610f31ec9c9eb3d2b2b565c45eed90e0673371c5156f698d42
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |