Convenience wrappers for the standard library csv module.
Project description
csvy
Basic context wrappers for stardard library csv.read and csv.write methods.
Writer Example
B
The writer returns a straight up csv.writer object:
import csvy
with csvy.writer('csvpath.csv') as csvfile:
csvfile.writerow([1, 2, 3, 4])
Reader Example
The reader returns a proxy object that behaves a bit differently. You must
call the iter method that yield an enumerator:
import csvy
with csvy.reader('csvpath.csv') as csvfile:
for index, row in csvfile.iter():
print(f"{index}: {row}")
If a header row is detected, the row object will be a namedtuple based
on the values of the header line:
"""
src.csv:
A,B,C,column D
1,2,3,4
5,6,7,8
"""
import csvy
with csvy.reader('src.csv') as csvfile:
for index, row in csvfile.iter():
print(row.a)
print(row.column_d)
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file csvy-0.1.5.tar.gz.
File metadata
- Download URL: csvy-0.1.5.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.2 CPython/3.7.5 Linux/4.15.0-88-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34c2cd1e87dbc2ffd343c5b0d61376af1cd6578efbc87f74d37bbe1f5800fb58
|
|
| MD5 |
1edec84c409a4738f9741e1e3e5d4eb9
|
|
| BLAKE2b-256 |
aa493d8c1ffef76527f41536097c3611875045416df281769bfe4eb6ba660d83
|
File details
Details for the file csvy-0.1.5-py3-none-any.whl.
File metadata
- Download URL: csvy-0.1.5-py3-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.0.2 CPython/3.7.5 Linux/4.15.0-88-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d297fd3c49ade4c3dff49c4506edab8d08a5b216a020b0b015604f74887ce09
|
|
| MD5 |
dc1113cf19f9b67560b3f5e796959869
|
|
| BLAKE2b-256 |
6fe9cd33a669b1d85067c4db8c91c7dfe64480fd85897ba9b34cb261ea559eb5
|