API#

Available clients#

Base abstract client#

Mixins#

Authentication mixins.

class meteostations.mixins.auth.APIKeyHeaderMixin#

API key as request header mixin.

property request_headers: dict#

Request headers.

class meteostations.mixins.auth.APIKeyMixin#

API key mixin.

class meteostations.mixins.auth.APIKeyParamMixin#

API key as request parameter mixin.

property request_params#

Request parameters.

Stations mixins.

class meteostations.mixins.stations.AllStationsEndpointMixin#

Mixin for APIs with an endpoint that returns all the stations.

In this case, a request gets all the stations, which are then spatially filtered based on the region attribute.

class meteostations.mixins.stations.StationsEndpointMixin#

Stations endpoint mixin.

property stations_gdf: GeoDataFrame#

Geo-data frame with stations data.

Variables mixins.

class meteostations.mixins.variables.VariablesEndpointMixin#

Variables endpoint mixin.

property variables_df: DataFrame#

Variables dataframe.

class meteostations.mixins.variables.VariablesHardcodedMixin#

Hardcoded variables mixin.

property variables_df: DataFrame#

Variables dataframe.

class meteostations.mixins.variables.VariablesMixin#

Variables Mixin.

Utils#

Utils.

Based on osmnx utils and downloader modules.

meteostations.utils.dms_to_decimal(ser)#

Convert a series from degrees, minutes, seconds (DMS) to decimal degrees.

Parameters:

ser (Series)

Return type:

Series

meteostations.utils.log(message, *, level=None, name=None, filename=None)#

Write a message to the logger.

This logs to file and/or prints to the console (terminal), depending on the current configuration of settings.LOG_FILE and settings.LOG_CONSOLE.

Parameters:
  • message (str) – The message to log.

  • level (int) – One of Python’s logger.level constants.

  • name (str) – Name of the logger.

  • filename (str) – Name of the log file, without file extension.

Return type:

None

meteostations.utils.ts(*, style='datetime', template=None)#

Get current timestamp as string.

Parameters:
  • style (str {"datetime", "date", "time"}) – Format the timestamp with this built-in template.

  • template (str) – If not None, format the timestamp with this template instead of one of the built-in styles.

Returns:

ts – The string timestamp.

Return type:

str