HKV tools voor operationeel waterbeheer


Keywords
hkv fews pi fews-pi fewspy
Licenses
BSD-3-Clause/BSD-3-Clause
Install
pip install hkvfewspy==0.8

Documentation

hkvfewspy

PyPI version License

Python wrapper for FEWS-Pi sevices supporting both the SOAP and REST protocol

installation

make sure you have all dependencies installed, and then install hkvfewspy.

pip install hkvfewspy

usage

SOAP backend

import hkvfewspy as hkv
pi = hkv.Pi() # or hkv.Pi(protocol='soap')
pi.setClient(wsdl='http://localhost:8081/FewsPiService/fewspiservice?wsdl')

REST backend

import hkvfewspy as hkv
pi = hkv.Pi(protocol='rest')
pi.setUrl(url='http://localhost:8080/FewsWebServices/rest/fewspiservice/v1/')

changelog

0.7

added REST protocol for the following functions

  • setUrl
  • getFilters
  • getParameters
  • getTimeSeries
  • getTimeZoneID
  • postTimeSeries

initiate using:

  • pi = hkv.Pi(protocol='rest')
  • (default protocol is soap for backwards compatibilty)
  • see this notebook for an example

0.6.3

  • removed geopandas as required dependencies
  • setPiTimeSeries now includes miliseconds (FEWS support this since 2017.02 inc latest patch)

available functions

  • setClient ( for soap only )
  • setUrl ( for rest only )
  • postTimeSeries
  • setQueryParameters
  • setPiTimeSeries
  • getFilters
  • getParameters
  • getTimeSeries
  • getTimeZoneID
  • getAvailableTimeZones
  • getWorkflows
  • getTaskRunStatus
  • runTask
  • putTimeSeriesForFilter ( for soap only )
  • postTimeSeries ( for rest only)

notebook

in the notebook folder are placed several jupyter notebooks with more examples. the module has been tested against both embedded and public fews-Pi webservices in python2 and python3.

credits

HKVFEWSPY is written by:

compiling notes

build distribution directory

python setup.py sdist bdist_wheel

upload to PyPI

from root directory twine upload --repository-url https://upload.pypi.org/legacy/ dist/* username password

this will update the wheel which can be installed through pip install --upgrade hkvfewspy