Skip to main content

Cool way to deal with 'headed' CSV

Project description

Cool way to deal with ‘headed’ CSV

Rules of the parser
1 - First row is a list of column names. 2 - All rows have the same numbers of columns. 3 - Empty column names are ignored. 4 - Columns without name are ignored.

Example:

name0 name1   name3  
v0   v2 v3 v4

Equivalent:

name0 name1 name3
v0   v2

Use:

>>> import csvcool
>>> cool = csvcool.read(open("path/to/csv"))
>>> cool[0]["name0"]
v0
>>> cool[0]["name0"] = 1
>>> cool[0]["name0"]
1
>>> csvcool.write(cool, open("path/to/csv", "w"))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for csvcool, version 0.3.5
Filename, size File type Python version Upload date Hashes
Filename, size csvcool-0.3.5.tar.gz (9.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page