stationdata module

Interface for extracting station data from JSON objects fetched from the Internet.

stationdata.build_station_dataframe(stations)

Create a pandas DataFrame containing data for all monitoring stations.

Parameters

stations (list[MonitoringStation]) – generated using build_station_list.

Returns

df – the output dataframe.

Return type

pandas DataFrame

stationdata.build_station_list(use_cache=True, test=False)

Build and return a list of all river level monitoring stations based on data fetched from the Environment agency. Each station is represented as a MonitoringStation object.

The available data for some station is incomplete or not available.

If the flag test is set to true then fixed test data is used so results may be compared to known values for the data

Parameters
  • use_cache (bool, optional) –

  • test (bool, optional) –

Returns

stations

Return type

list[MonitoringStations]

stationdata.update_water_levels(stations, use_cache=False)

Attach level data contained in measure_data to stations.