Germany Berlin Fetcher

Fetcher for Berlin river gauge data from Wasserportal Berlin.

class rivretrieve.germany_berlin.GermanyBerlinFetcher[source]

Bases: RiverDataFetcher

Fetches river gauge data from Wasserportal Berlin.

Data source:

https://wasserportal.berlin.de/

Supported variables:
  • ‘stage_daily_mean’ (m)

  • ‘discharge_daily_mean’ (m³/s)

  • ‘water-temperature_daily_mean’ (°C)

  • ‘stage_instantaneous’ (m)

  • ‘discharge_instantaneous’ (m³/s)

Data description and API:
Terms of use:
static get_available_variables() tuple[str, ...][source]

Returns a tuple of supported variables.

static get_cached_metadata() DataFrame[source]

Retrieves cached metadata (if available).

get_data(gauge_id: str, variable: str, start_date: str | None = None, end_date: str | None = None) DataFrame[source]

Fetches and parses time series data for a specific gauge and variable.

This method retrieves the requested data from the provider’s API or data source, parses it, and returns it in a standardized pandas DataFrame format.

Parameters:
  • gauge_id – The site-specific identifier for the gauge.

  • variable – The variable to fetch. Must be one of the strings listed in the fetcher’s get_available_variables() output. These are typically defined in rivretrieve.constants.

  • start_date – Optional start date for the data retrieval in ‘YYYY-MM-DD’ format. If None, data is fetched from the earliest available date.

  • end_date – Optional end date for the data retrieval in ‘YYYY-MM-DD’ format. If None, data is fetched up to the latest available date.

Returns:

A pandas DataFrame indexed by datetime objects ('time') with a single column named after the requested variable. The DataFrame will be empty if no data is found for the given parameters.

Return type:

pd.DataFrame

Raises:
  • ValueError – If the requested variable is not supported by this fetcher.

  • requests.exceptions.RequestException – If a network error occurs during data download.

  • Exception – For other unexpected errors during data fetching or parsing.

get_metadata() DataFrame[source]

Downloads and parses site metadata from Wasserportal Berlin.

Keeps all original columns, but renames and standardizes key fields. Converts UTM33N (EPSG:32633) → WGS84 (EPSG:4326) coordinates.