csvx: painless csv for python
Python Makefile
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
csvx
docs
tests/unit
.gitignore
.travis.yml
LICENSE
Makefile
README.rst
requirements-dev.txt
requirements.txt
setup.py
tox.ini

README.rst

csvx: painless csv

Join the chat at https://gitter.im/djrobstep/csvx

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