Skip to main content

Python library for accessing a Kisters WISKI system via the KiWIS API.

Project description

Python library for querying WISKI via KiWIS (KISTERS Web Interoperability Solution). See: http://www.kisters.net/NA/products/wiski/options/web-services/

https://raw.githubusercontent.com/amacd31/kiwis_pie/master/kiwis_and_pie.jpg

Dependencies

Requires the Python libraries requests, pandas and tabulate.

Installation

Install from PyPI:

pip install kiwis-pie

or install directly from github:

pip install git+https://github.com/amacd31/kiwis_pie.git

Usage

Example fetching some data from the KiWIS service that backs: http://kna.kisters.net/sjr/kiwidgets/tests/SanJoaquinRiver/

from datetime import date
from kiwis_pie import KIWIS
k = KIWIS('http://kna.kisters.net/grassland/KiWIS')

# Get station ID for 'SAN JOAQUIN RIVER NEAR PATTERSON'
station_id = k.get_station_list(station_name = 'SAN JOAQUIN RIVER NEAR PATTERSON').station_id.values[0]

# Get timeseries ID for 3-Hourly streamflow (Q) at SAN JOAQUIN RIVER NEAR PATTERSON
ts_id = k.get_timeseries_list(station_id = station_id, parametertype_name = 'Q', ts_name = '3-Hourly').ts_id.values[0]

# Read one day of 3-Hourly flow data for SAN JOAQUIN RIVER NEAR PATTERSON
k.get_timeseries_values(ts_id = ts_id, to = date(2016,1,1), **{'from': date(2016,1,1)})

Example using the KiWIS service that backs the Australian Bureau of Meteorology’s Water Data Online service: http://www.bom.gov.au/waterdata/

from datetime import date
from kiwis_pie import KIWIS
k = KIWIS('http://www.bom.gov.au/waterdata/services')

# Get station ID for 'Cotter River at Gingera'
station_id = k.get_station_list(station_name = 'Cotter R. at Gingera').station_id.values[0]

# Get timeseries ID for daily mean streamflow (Q) at Cotter River at Gingera
ts_id = k.get_timeseries_list(station_id = station_id, ts_name = 'DMQaQc.Merged.DailyMean.24HR', parametertype_name = 'Water Course Discharge').ts_id.values[0]

# Read 31 days of daily water course discharge data for Cotter River at Gingera
k.get_timeseries_values(ts_id = ts_id, to = date(2016,1,31), **{'from': date(2016,1,1)})

# Optionally use the `keep_tz` option to return in local timezone instead of UTC
k.get_timeseries_values(ts_id = ts_id, to = date(2016,1,31), **{'from': date(2016,1,1)}, keep_tz=True)

Documentation

The methods on the KIWIS class all have docstrings detailing the keyword arguments they take. Rendered documentation is available on Read the Docs: http://kiwis-pie.readthedocs.io/en/latest/

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

kiwis-pie-0.10.3.tar.gz (22.4 kB view details)

Uploaded Source

File details

Details for the file kiwis-pie-0.10.3.tar.gz.

File metadata

  • Download URL: kiwis-pie-0.10.3.tar.gz
  • Upload date:
  • Size: 22.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.11 tqdm/4.64.0 importlib-metadata/4.11.3 keyring/23.4.0 rfc3986/2.0.0 colorama/0.4.5 CPython/3.9.7

File hashes

Hashes for kiwis-pie-0.10.3.tar.gz
Algorithm Hash digest
SHA256 623e1401bb6604c08bab935692eee158082de9a2467282db9892dee2e2a814d0
MD5 34470081bc14b1e0256cde9845daa48c
BLAKE2b-256 6a37e82bb84768260bbef9596f9cef3d50ff5eab78d3919ebf770d019f077dff

See more details on using hashes here.

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