Core#


Todo

Add more modules.

Core#

class wetterdienst.core.core.Core#

Core class for any related requests of wetterdienst

abstract property provider: Provider#

Abstract representation of source that is related to the request, used for identification of returned data

property tz: timezone#

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, humanize=None, tidy=None, si_units=None, skip_empty=None, skip_threshold=None, dropna=None, interp_use_nearby_station_until_km=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(dms)#

Convert degree minutes to decimal degree

Return type:

Series

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 (Optional[int]) – 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)#

Overhauled column names for metadata fields

class wetterdienst.provider.dwd.metadata.datetime.DatetimeFormat(value)#

An enumeration.