Core#

Todo

Add more modules.

Core#

class wetterdienst.core.core.Core#

Core class for any related requests of wetterdienst

property tz: ZoneInfo#

timezone of country that may be used for internal date parsing or reflection of release schedules

Settings#

class wetterdienst.settings.Settings(cache_disable=None, cache_dir=None, fsspec_client_kwargs=None, ts_humanize=None, ts_shape=None, ts_si_units=None, ts_skip_empty=None, ts_skip_threshold=None, ts_skip_criteria=None, ts_dropna=None, ts_interpolation_use_nearby_station_distance=None, ts_interpolation_station_distance=None, ignore_env=False)#

Wetterdienst class for general settings

classmethod default()#

Ignore environmental variables and use all default arguments as defined above

Return type:

Settings

reset()#

Reset Wetterdienst Settings to start

Return type:

Settings

Data models#

class wetterdienst.util.geo.Coordinates(latitudes, longitudes)#

Class for storing and retrieving coordinates

Parameters:
  • latitudes (array) – latitudes in degree

  • longitudes (array) – longitudes in degree

get_coordinates()#
Return type:

array

Returns: coordinates in degree where the first column is the latitudes

and the second column the longitudes

get_coordinates_in_radians()#
Returns: coordinates in radians where the first column is the latitudes

and the second column the longitudes

wetterdienst.util.geo.convert_dm_to_dd(dm)#

Convert degree minutes (floats) to decimal degree :type dm: Series :param dm: :rtype: Series :return:

wetterdienst.util.geo.convert_dms_string_to_dd(dms)#

Convert degree minutes seconds (string) to decimal degree e.g. 49 18 21 :type dms: Series :param dms: :rtype: Series :return:

wetterdienst.util.geo.derive_nearest_neighbours(latitudes, longitudes, coordinates, number_nearby=1)#

A function that uses a k-d tree algorithm to obtain the nearest neighbours to coordinate pairs

Parameters:
  • latitudes (np.array) – latitude values of stations_result being compared to

  • coordinates (Coordinates) –

  • longitudes (np.array) – longitude values of stations_result being compared to

  • coordinates

  • coordinates – the coordinates for which the nearest neighbour

  • searched (is) –

  • number_nearby (int) – Number of stations_result that should be nearby

Return type:

Tuple[Union[float, ndarray], ndarray]

Returns:

Tuple of distances and ranks of nearest to most distant stations_result

Download#

class wetterdienst.util.network.NetworkFilesystemManager#

Manage multiple FSSPEC instances keyed by cache expiration time.

wetterdienst.util.network.download_file(url, settings, ttl=CacheExpiry.NO_CACHE)#

A function used to download a specified file from the server.

Parameters:
  • url (str) – The url to the file on the dwd server

  • ttl (Union[int, CacheExpiry, None]) – How long the resource should be cached.

Return type:

BytesIO

Returns:

Bytes of the file.

wetterdienst.util.network.list_remote_files_fsspec(url, settings, ttl=CacheExpiry.FIVE_MINUTES)#

A function used to create a listing of all files of a given path on the server.

The default ttl with CacheExpiry.FILEINDEX is “5 minutes”.

Parameters:
  • url (str) – The URL which should be searched for files.

  • ttl (CacheExpiry) – The cache expiration time.

Return type:

List[str]

Returns:

A list of strings representing the files from the path.

Enumerations#

class wetterdienst.metadata.columns.Columns(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)#

Overhauled column names for metadata fields