Python wrappers for the Deltares FEWS PI REST Web Service
get_filters(url, filter_id=None, document_format='PI_JSON', verify=False, logger=LOGGER)
Get FEWS qualifiers as a pandas DataFrame
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
str
|
url Delft-FEWS PI REST WebService. |
required |
E.g. |
http
|
//localhost:8080/FewsWebServices/rest/fewspiservice/v1/filters |
required |
filter_id |
str
|
the FEWS id of the filter to pass as request parameter |
None
|
document_format |
str
|
request document format to return. Defaults to PI_JSON. |
'PI_JSON'
|
verify |
bool
|
passed to requests.get verify parameter. |
False
|
logger |
Logger
|
Logger to pass logging to. By |
LOGGER
|
Returns:
Name | Type | Description |
---|---|---|
df |
DataFrame
|
Pandas dataframe with index "id" and columns |
List[dict]
|
"name" and "group_id". |
Source code in src\fewspy\wrappers\get_filters.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
|
get_locations(url, filter_id=None, document_format='PI_JSON', attributes=[], verify=False, logger=LOGGER, remove_duplicates=False)
Get FEWS qualifiers as a pandas DataFrame
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
str
|
url Delft-FEWS PI REST WebService. |
required |
E.g. |
http
|
//localhost:8080/FewsWebServices/rest/fewspiservice/v1/qualifiers |
required |
filter_id |
str
|
the FEWS id of the filter to pass as request parameter |
None
|
document_format |
str
|
request document format to return. Defaults to PI_JSON. |
'PI_JSON'
|
attributes |
list
|
if not emtpy, the location attributes to include as columns in the pandas DataFrame. |
[]
|
verify |
bool
|
passed to requests.get verify parameter. |
False
|
logger |
Logger
|
Logger to pass logging to. By default, a logger will ge created. |
LOGGER
|
Returns:
Name | Type | Description |
---|---|---|
df |
DataFrame
|
Pandas dataframe with index "id" and columns |
DataFrame
|
"name" and "group_id". |
Source code in src\fewspy\wrappers\get_locations.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
|
get_parameters(url, filter_id=None, document_format='PI_JSON', verify=False, logger=LOGGER)
Get FEWS qualifiers as a pandas DataFrame
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
str
|
url Delft-FEWS PI REST WebService. |
required |
E.g. |
http
|
//localhost:8080/FewsWebServices/rest/fewspiservice/v1/qualifiers |
required |
filter_id |
str
|
the FEWS id of the filter to pass as request parameter |
None
|
document_format |
str
|
request document format to return. Defaults to PI_JSON. |
'PI_JSON'
|
verify |
bool
|
passed to requests.get verify parameter. |
False
|
logger |
Logger
|
Logger to pass logging to. By |
LOGGER
|
Returns:
Name | Type | Description |
---|---|---|
df |
DataFrame
|
Pandas dataframe with index "id" and columns |
List[dict]
|
"name" and "group_id". |
Source code in src\fewspy\wrappers\get_parameters.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
|
get_qualifiers(url, verify=False, logger=LOGGER)
Get FEWS qualifiers as Pandas DataFrame
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
str
|
url Delft-FEWS PI REST WebService. |
required |
E.g. |
http
|
//localhost:8080/FewsWebServices/rest/fewspiservice/v1/qualifiers |
required |
verify |
bool
|
passed to requests.get verify parameter. |
False
|
logger |
Logger
|
Logger to pass logging to. By |
LOGGER
|
Returns:
Name | Type | Description |
---|---|---|
df |
DataFrame
|
Pandas dataframe with index "id" and columns |
DataFrame
|
"name" and "group_id". |
Source code in src\fewspy\wrappers\get_qualifiers.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
|
get_time_series(url, filter_id, location_ids=None, parameter_ids=None, qualifier_ids=None, start_time=None, end_time=None, thinning=None, only_headers=False, omit_missing=True, show_statistics=False, document_format='PI_JSON', verify=False, logger=LOGGER)
Get FEWS qualifiers as a pandas DataFrame
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
str
|
url Delft-FEWS PI REST WebService. |
required |
E.g. |
http
|
//localhost:8080/FewsWebServices/rest/fewspiservice/v1/qualifiers |
required |
filter_id |
str
|
the FEWS id of the filter to pass as request parameter |
required |
location_ids |
list
|
list with FEWS location ids to extract timeseries from. Defaults to None. |
None
|
parameter_ids |
list
|
list with FEWS parameter ids to extract timeseries from. Defaults to None. |
None
|
qualifier_ids |
list
|
list with FEWS qualifier ids to extract timeseries from. Defaults to None. |
None
|
start_time |
datetime
|
datetime-object with start datetime to use in request. Defaults to None. |
None
|
end_time |
datetime
|
datetime-object with end datetime to use in request. Defaults to None. |
None
|
thinning |
int
|
integer value for thinning parameter to use in request. Defaults to None. |
None
|
only_headers |
bool
|
if True, only headers will be returned. Defaults to False. |
False
|
omit_missing |
bool
|
if True, no missings values will be returned. Defaults to True. |
True
|
show_statistics |
bool
|
if True, time series statistics will be included in header. Defaults to False. |
False
|
document_format |
str
|
request document format to return. Defaults to PI_JSON. |
'PI_JSON'
|
verify |
bool
|
passed to requests.get verify parameter. |
False
|
logger |
Logger
|
Logger to pass logging to. By |
LOGGER
|
Returns:
Name | Type | Description |
---|---|---|
df |
DataFrame
|
Pandas dataframe with index "id" and columns |
DataFrame
|
"name" and "group_id". |
Source code in src\fewspy\wrappers\get_time_series.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|
get_time_series_async(url, filter_id, location_ids=None, parameter_ids=None, qualifier_ids=None, start_time=None, end_time=None, thinning=None, document_format='PI_JSON', omit_missing=True, verify=False, logger=LOGGER)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url |
str
|
url Delft-FEWS PI REST WebService. |
required |
E.g. |
http
|
//localhost:8080/FewsWebServices/rest/fewspiservice/v1/qualifiers |
required |
filter_id |
str
|
the FEWS id of the filter to pass as request parameter |
required |
location_ids |
list
|
list with FEWS location ids to extract timeseries from. Defaults to None. |
None
|
parameter_ids |
list
|
list with FEWS parameter ids to extract timeseries from. Defaults to None. |
None
|
qualifier_ids |
list
|
list with FEWS qualifier ids to extract timeseries from. Defaults to None. |
None
|
start_time |
datetime
|
datetime-object with start datetime to use in request. Defaults to None. |
None
|
end_time |
datetime
|
datetime-object with end datetime to use in request. Defaults to None. |
None
|
thinning |
int
|
integer value for thinning parameter to use in request. Defaults to None. |
None
|
document_format |
str
|
request document format to return. Defaults to PI_JSON. |
'PI_JSON'
|
omit_missing |
bool
|
if True, no missings values will be returned. Defaults to True |
True
|
verify |
bool
|
passed to requests.get verify parameter. |
False
|
logger |
Logger
|
Logger to pass logging to. By |
LOGGER
|
Returns:
Name | Type | Description |
---|---|---|
df |
DataFrame
|
Pandas dataframe with index "id" and columns |
DataFrame
|
"name" and "group_id". |
Source code in src\fewspy\wrappers\get_time_series_async.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
|