The sensible way to work with tabular data
Project description
tabular-data
The sensible way to work with tabular data
Read CSV files with ease
Go from this 😡
import csv
with open('names.csv', newline='') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
print(row)
to this 😎
from tabular_data import csv_file
for row in csv_file('names.csv').read():
print(row)
Write CSV files with no effort
Go from this 🤮
import csv
with open('names.csv', 'w', newline='') as csvfile:
fieldnames = ['first_name', 'last_name']
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
writer.writeheader()
writer.writerow({'first_name': 'Baked', 'last_name': 'Beans'})
writer.writerow({'first_name': 'Lovely', 'last_name': 'Spam'})
writer.writerow({'first_name': 'Wonderful', 'last_name': 'Spam'})
to this 🤩
from tabular_data import csv_file
csv_file('names.csv').write(
[
{'first_name': 'Baked', 'last_name': 'Beans'},
{'first_name': 'Lovely', 'last_name': 'Spam'},
{'first_name': 'Wonderful', 'last_name': 'Spam'}
]
)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tabular_data-0.1.3.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for tabular_data-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b831e424e9df0d3f46e2714c0e591aaf48df7148768e503eac882dc52845e01 |
|
MD5 | ed1ba8fa42c8eece03d2a6dd3b3a92bb |
|
BLAKE2b-256 | e3cd3cf37a37fe930d34f65cd3274b718733f62179ed83445cb069dd0fd2b016 |