Skip to main content

read datafiles via the import system

Project description

data-import

import data files via import-hook trickery

Installation

 $ pip install dataimport

Usage

>>> import dataimport.test.csv as csv_file
>>> print(list(csv_file))
[['col1', 'col2', 'col3', 'col4'], ['1', '2', '3', '4'], ['5', '6', '7', '8'], ['9', '10', '11', '12'], ['13', '14', '15', '16'], ['17', '18', '19', '20']]

csv and json loaders are included, but adding or replacing a loader is easy!

>>> import dataimport
>>> import pandas
>>> dataimport.register('csv', pandas.read_csv)
>>> import dataimport.test.csv as datatable
>>> print(datatable)
   col1  col2  col3  col4
0     1     2     3     4
1     5     6     7     8
2     9    10    11    12
3    13    14    15    16
4    17    18    19    20

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

dataimport-0.1.0.tar.gz (3.1 kB view hashes)

Uploaded Source

Built Distribution

dataimport-0.1.0-py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 3

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