kiwis_pie package

Submodules

kiwis_pie.kiwis module

class kiwis_pie.kiwis.KIWIS(server_url, strict_mode=True)[source]

Bases: object

Provides access to the KiWIS API at a specified end point.

Parameters:
  • server_url (string) – The URL to the KiWIS server.
  • strict_mode (boolean) – Perform validation on query options passed as kwargs and the return_fields list if True. Otherwise pass through to the KiWIS API which may result in a 500 error if the query option/return field isn’t valid. Default: True
get_parameter_list(return_fields=None, keep_tz=False, **kwargs)

Python method to query the ‘getParameterList’ KiWIS method.

Keyword arguments are those available in the ‘Query field’ name list below. That is the keywords match the Queryfield names used by KiWIS.

Parameters:
  • keep_tz (boolean) – Set to true to prevent the series datetimes from being converted to UTC. This optional argument only applies when the returned data includes data with timestamps.
  • return_fields (list(string)) –

    Optional keyword argument, which is a list made up from the following available fields:

    • station_no,
    • station_id,
    • station_name,
    • site_no,
    • site_id,
    • site_name,
    • stationparameter_id,
    • stationparameter_name,
    • stationparameter_no,
    • stationparameter_longname,
    • parametertype_id,
    • parametertype_name,
    • parametertype_longname,
    • parametertype_shortunitname,
    • parametertype_unitname.
  • kwargs – Queryfield name for keyword argument. Refer to table:
Queryfield name * as wildcard accepts list
station_no no yes
site_name yes yes
parametertype_longname yes yes
parametertype_name yes yes
stationparameter_id no yes
station_id no yes
stationparameter_no no yes
stationparameter_longname yes yes
site_id no yes
stationparameter_name yes yes
station_name yes yes
parametertype_id no yes
site_False no yes
Returns:Pandas DataFrame with columns based on the default return from KiWIS or based on the return_fields specified.
Return type:pandas.DataFrame
get_parameter_type_list(return_fields=None, keep_tz=False, **kwargs)

Python method to query the ‘getParameterTypeList’ KiWIS method.

Keyword arguments are those available in the ‘Query field’ name list below. That is the keywords match the Queryfield names used by KiWIS.

Parameters:
  • keep_tz (boolean) – Set to true to prevent the series datetimes from being converted to UTC. This optional argument only applies when the returned data includes data with timestamps.
  • return_fields (list(string)) –

    Optional keyword argument, which is a list made up from the following available fields:

    • .
  • kwargs – Queryfield name for keyword argument. Refer to table:
Queryfield name * as wildcard accepts list
parametertype_id no yes
parametertype_name yes yes
Returns:Pandas DataFrame with columns based on the default return from KiWIS or based on the return_fields specified.
Return type:pandas.DataFrame
get_site_list(return_fields=None, keep_tz=False, **kwargs)

Python method to query the ‘getSiteList’ KiWIS method.

Keyword arguments are those available in the ‘Query field’ name list below. That is the keywords match the Queryfield names used by KiWIS.

Parameters:
  • keep_tz (boolean) – Set to true to prevent the series datetimes from being converted to UTC. This optional argument only applies when the returned data includes data with timestamps.
  • return_fields (list(string)) –

    Optional keyword argument, which is a list made up from the following available fields:

    • site_no,
    • site_id,
    • site_name,
    • site_latitude,
    • site_longitude,
    • site_carteasting,
    • site_cartnorthing,
    • site_type_name,
    • site_type_shortname,
    • parametertype_id,
    • parametertype_name,
    • stationparameter_name,
    • site_georefsystem,
    • custom_attributes.
  • kwargs – Queryfield name for keyword argument. Refer to table:
Queryfield name * as wildcard accepts list
site_name no yes
site_id no yes
parametertype_name yes yes
stationparameter_name yes yes
site_no no yes
parametertype_id no yes
bbox n/a n/a
Returns:Pandas DataFrame with columns based on the default return from KiWIS or based on the return_fields specified.
Return type:pandas.DataFrame
get_station_list(return_fields=None, keep_tz=False, **kwargs)

Python method to query the ‘getStationList’ KiWIS method.

Keyword arguments are those available in the ‘Query field’ name list below. That is the keywords match the Queryfield names used by KiWIS.

Parameters:
  • keep_tz (boolean) – Set to true to prevent the series datetimes from being converted to UTC. This optional argument only applies when the returned data includes data with timestamps.
  • return_fields (list(string)) –

    Optional keyword argument, which is a list made up from the following available fields:

    • station_no,
    • station_id,
    • station_name,
    • catchment_no,
    • catchment_id,
    • catchment_name,
    • station_latitude,
    • station_longitude,
    • station_carteasting,
    • station_cartnorthing,
    • site_no,
    • site_id,
    • site_name,
    • parametertype_id,
    • parametertype_name,
    • stationparameter_name,
    • object_type,
    • station_georefsystem,
    • station_longname,
    • custom_attributes.
  • kwargs – Queryfield name for keyword argument. Refer to table:
Queryfield name * as wildcard accepts list
station_no yes yes
site_name no yes
catchment_id no yes
station_id no yes
parametertype_name yes yes
catchment_name yes yes
catchment_no no yes
parametertype_id no yes
site_id no yes
stationparameter_name yes yes
station_name yes yes
site_no no yes
stationgroup_id no no
Returns:Pandas DataFrame with columns based on the default return from KiWIS or based on the return_fields specified.
Return type:pandas.DataFrame
get_timeseries_list(return_fields=None, keep_tz=False, **kwargs)

Python method to query the ‘getTimeseriesList’ KiWIS method.

Keyword arguments are those available in the ‘Query field’ name list below. That is the keywords match the Queryfield names used by KiWIS.

Parameters:
  • keep_tz (boolean) – Set to true to prevent the series datetimes from being converted to UTC. This optional argument only applies when the returned data includes data with timestamps.
  • return_fields (list(string)) –

    Optional keyword argument, which is a list made up from the following available fields:

    • station_no,
    • station_id,
    • station_name,
    • station_latitude,
    • station_longitude,
    • station_carteasting,
    • station_cartnorthing,
    • station_georefsystem,
    • station_longname,
    • ts_id,
    • ts_name,
    • ts_shortname,
    • ts_pat,
    • parametertype_id,
    • parametertype_name,
    • stationparameter_name,
    • stationparameter_longname,
    • ts_unitname,
    • ts_unitsymbol,
    • ts_unitname_abs,
    • ts_unitsymbol_abs,
    • coverage,
    • ts_density,
    • datacart.
  • kwargs – Queryfield name for keyword argument. Refer to table:
Queryfield name * as wildcard accepts list
station_no yes yes
ts_id no yes
ts_name yes yes
parametertype_name yes yes
station_id no yes
stationparameter_no no yes
ts_shortname yes yes
ts_path yes yes
stationparameter_name yes yes
ts_type_id no yes
station_name yes yes
timeseriesgroup_id no no
parametertype_id no yes
fulltext yes no
ts_unitname yes yes
Returns:Pandas DataFrame with columns based on the default return from KiWIS or based on the return_fields specified.
Return type:pandas.DataFrame
get_timeseries_values(return_fields=None, keep_tz=False, **kwargs)

Python method to query the ‘getTimeseriesValues’ KiWIS method.

Keyword arguments are those available in the ‘Query field’ name list below. That is the keywords match the Queryfield names used by KiWIS.

Parameters:
  • keep_tz (boolean) – Set to true to prevent the series datetimes from being converted to UTC. This optional argument only applies when the returned data includes data with timestamps.
  • return_fields (list(string)) –

    Optional keyword argument, which is a list made up from the following available fields:

    • Timestamp,
    • Value,
    • Interpolation Type,
    • Quality Code,
    • Aggregation,
    • Accuracy,
    • Absolute Value,
    • AV Interpolation,
    • Type,
    • AV Quality Code,
    • Runoff Value,
    • RV Interpolation,
    • Type,
    • RV Quality Code.
  • kwargs – Queryfield name for keyword argument. Refer to table:
Queryfield name * as wildcard accepts list
period n/a n/a
ts_id no yes
from n/a n/a
timezone no n/a
timeseriesgroup_id no yes
to n/a n/a
ts_path yes yes
Returns:Pandas DataFrame with columns based on the default return from KiWIS or based on the return_fields specified.
Return type:pandas.DataFrame
exception kiwis_pie.kiwis.KIWISError[source]

Bases: Exception

Exception for when the KiWIS service responds with an error.

exception kiwis_pie.kiwis.NoDataError[source]

Bases: Exception

Exception for when there was no data returned by the KiWIS service.

class kiwis_pie.kiwis.QueryOption(wildcard, list, parser)

Bases: tuple

list

Alias for field number 1

parser

Alias for field number 2

wildcard

Alias for field number 0

Module contents