fews_py_wrapper.utils#

Functions

format_datetime(dt[, time_format])

Format a datetime object to a string suitable for FEWS web services.

convert_timeseries_response_to_xarray(...)

Convert the timeseries response content to a pandas DataFrame.

format_time_args(*args)

Format a list of datetime arguments to strings suitable for web services.

get_function_arg_names(func)

Get the argument names of a function.

replace_dots_attrs_values(attrs)

Replace dots in attribute keys with underscores.

fews_py_wrapper.utils.format_datetime(dt, time_format='%Y-%m-%dT%H:%M:%SZ')[source]#

Format a datetime object to a string suitable for FEWS web services.

Parameters:
  • dt (datetime)

  • time_format (str)

Return type:

str

fews_py_wrapper.utils.convert_timeseries_response_to_xarray(response_content)[source]#

Convert the timeseries response content to a pandas DataFrame.

Parameters:

response_content (dict[str, Any])

Return type:

Dataset

fews_py_wrapper.utils.format_time_args(*args)[source]#

Format a list of datetime arguments to strings suitable for web services.

Parameters:

args (None | datetime)

Return type:

list[None | str]

fews_py_wrapper.utils.get_function_arg_names(func)[source]#

Get the argument names of a function.

Parameters:

func (Callable[[...], Any])

Return type:

list[str]

fews_py_wrapper.utils.replace_dots_attrs_values(attrs)[source]#

Replace dots in attribute keys with underscores.

Parameters:

attrs (dict[str, Any])

Return type:

dict[str, Any]