Skip to main content

edata means 'easy data', is a wrapper of csv, xlrd, xlwt, pylightxl

Project description

edata

edata means 'easy data', is a wrapper of csv, xlrd, xlwt, pylightxl. edata can be used to read csv, xls, xlsx format file as dict list data and write dict list data to those format file.

install

pip install edata

example

import edata

data_list = [{'id': 1, 'name': 'Lena'},
             {'id': 2, 'name': 'Java'},
             {'id': 3, 'name': 'Gaga'}]

# write data to file
edata.write('test.csv', data_list[0:100])
edata.write('test.xls', data_list[0:100])
edata.write('test.xlsx', data_list[0:100])
# read data from file
print(edata.read('test.csv'))
print(edata.read('test.xls'))
print(edata.read('test.xlsx'))
# get sheet names
print(edata.get_sheet_names('test.xls'))
print(edata.get_sheet_names('test.xlsx'))

3 file will be created and console will print:

[{'id': '1', 'name': 'Lena'}, {'id': '2', 'name': 'Java'}, {'id': '3', 'name': 'Gaga'}]
[{'id': 1, 'name': 'Lena'}, {'id': 2, 'name': 'Java'}, {'id': 3, 'name': 'Gaga'}]
[{'id': 1, 'name': 'Lena'}, {'id': 2, 'name': 'Java'}, {'id': 3, 'name': 'Gaga'}]
['Sheet1']
['Sheet1']

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

edata-0.0.1.tar.gz (3.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page