Skip to content

webservices

cortexmancer edited this page Jun 25, 2026 · 1 revision

webservices

Provides request functionalities to ANA HidroWebservices API


HidroEndpoint Objects

class HidroEndpoint(StrEnum)

Enum to hold endpoins.


request_hidro_ws

def request_hidro_ws(endpoint, headers, params={})

Make a request to ANA API and returns the json.


request_token

def request_token(client_id: str,
                  client_password: str,
                  max_retries=3,
                  retry_delay=2)

Request an token to ANA API and returns it.


request_data

def request_data(token: str, endpoint: HidroEndpoint,
                 params: dict) -> (bool, dict)

Request data to ANA API and returns it.


get_file_path

def get_file_path(endpoint: HidroEndpoint, params: dict) -> str

Returns file path to save returned json.

Clone this wiki locally