Skip to main content

Consistent iterable API for reading and writing to external datasets

Project description

wq.io

wq.io 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 wq.io
# Or, if using together with wq.app and/or wq.db
pip install wq
# To use wq.io's GIS capabilities also install Shapely and Fiona
pip install shapely fiona

See the documentation for more information.

Features

The basic idea behind wq.io 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, wq.io 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 wq.io import load_file
data = load_file('example.xls')
for row in data:
    print row.name, row.date

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

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

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

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

wq.io-0.5.0.tar.gz (12.1 kB view details)

Uploaded Source

File details

Details for the file wq.io-0.5.0.tar.gz.

File metadata

  • Download URL: wq.io-0.5.0.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for wq.io-0.5.0.tar.gz
Algorithm Hash digest
SHA256 1ea66a393e1da7ef2ffaecc6dfe0d9c9b71d0aeb7fd0be6aba2b931699e38d45
MD5 6dd5150db303a206e2dea5d848571fcb
BLAKE2b-256 89208a7e9261a419f04ca5479168ab0e95409688a54d3a30e4530788727d93b6

See more details on using hashes here.

Supported by

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