skip to navigation
skip to content 0.4.1

Consistent iterable API for reading and writing to external datasets

Latest Version: 1.0.0 is a collection of Python libraries for consuming (input) and generating (output) external data resources in various formats. It thereby facilitates interoperability between the wq framework and other systems and formats.

Getting Started

pip install
# Or, if using together with and/or wq.db
pip install wq
# To use's GIS capabilities also install Shapely and Fiona
pip install shapely fiona

See the documentation for more information.


The basic idea behind is to avoid having to remember the unique usage of e.g. csv, xlrd, or lxml every time one needs to work with an external dataset. Instead, abstracts these libraries into a consistent interface that works as an iterable of namedtuples. The field names for a dataset are automatically determined from the source file, e.g. the column headers in an Excel spreadsheet.

from import load_file
data = load_file('example.xls')
for row in data:

When fiona and shapely are available, can also open and create shapefiles and other OGR-compatible geographic data formats.

from import ShapeIO
data = ShapeIO(filename='sites.shp')
for id, site in data.items():
    print id, site.geometry.wkt

It is straightforward to extend by subclassing existing functionality with custom implementations.

File Type Py Version Uploaded on Size (md5) Source 2014-01-28 11KB