KiWIS Store

KiWISStore class grants access to the time series data of the Kisters Web Interoperability Solution backend.

class kisters.water.time_series.kiwis.KiWISStore(base_url: str, datasource: int = 0, user: str = None, password: str = None)

Bases: kisters.water.time_series.core.time_series_store.TimeSeriesStore

Connector to KiWIS backend over KiWIS REST API

Parameters:
  • base_url – Base url of REST API.
  • data_source – Optional number identifying the data source.

Examples

from kisters.water.time_series.kiwis import KiWISStore
kiwis = KiWISStore('http://kiwis.kisters.de/KiWIS2/KiWIS')
kiwis.get_by_path('DWD/07367/Precip/CmdTotal.1h')
_get_time_series(ts_id: int = None, path: str = None, params: Mapping[str, Any] = None) → kisters.water.time_series.core.time_series.TimeSeries

Get a time series identified by id or by path and return a TimeSeries

Parameters:
  • ts_id – The time series id.
  • path – The time series path (ignored if ts_id is given).
  • params

    The additional parameters, which are passed to the rest api. in addition to the parameters defined by the REST API there are the following keys:

    metadata = comma separated list of additional meta information where the values are “site”, “station”, “parameter”.

    All time series specific information should be specified as is. All station, site and parameter specific information should be prefixed with “station.” etc.

Returns:

The found TimeSeries object.

Examples

kiwis.get_by_id(ts_id = 40765010)

# There is a special key 'all' which allows to retrieve all metadata keys of the specified object.
# But this should be handeld with care, because it is expensive.
ts = self.kiwis.get_by_id(ts_id=40765010, params={'metadata': 'station.all'})

# The following statement would retrieve all available information:
kiwis.get_by_id(ts_id=40765010, params={'metadata': 'all,parameter.all,station.all,site.all'})
_get_time_series_list(ts_filter: str = None, id_list: Iterable[int] = None, params: Mapping[str, Any] = None) → List[kisters.water.time_series.core.time_series.TimeSeries]

Get the time series list and return a list of TimeSeries objects

Parameters:
  • ts_filter – The ts filter.
  • id_list – The id list.
  • params

    The additional parameters, which are passed to rest api in addition to the parameters defined by the REST API there are the following keys:

    metadata = comma separated list of additional meta information where the values are “site”, “station”, “parameter”.
Returns:

The list of TimeSeries objects.

Examples

kiwis.get_by_filter(ts_filter="FR110031fb-e8e7-4381-a942-372aa8141945/CM0514*")