synoptic.services.TimeSeries#

class synoptic.services.TimeSeries(**params)[source]#

Get time series data for one or more stations.

Refer to the official documentation: https://docs.synopticdata.com/services/time-series

Parameters:
  • start (datetime or str, optional) – The start time of the desired time range as a datetime.datetime or a string in the form 'YYYYMMDDHHMM' or 'YYYY-MM-DD HH:MM'. Required if recent is not provided.

  • end (datetime or str, optional) – The end time of the desired time range as a datetime.datetime or a string in the form 'YYYYMMDDHHMM' or 'YYYY-MM-DD HH:MM'. Required if recent is not provided.

  • recent (timedelta, int, or str, optional) – A datetime.timedelta, integer (representing minutes), or a duration string (e.g., ‘3h’) that specifies the period of data to retrieve prior to the current time. Required if start and end are not provided.

  • **station_selection – Station selection parameters such as stid, state, county, radius, bbox, vars, varsoperator, etc. Refer to the Synoptic API documentation for details.

  • token (str, optional) – Synoptic API token. Required if the SYNOPTIC_TOKEN environment variable and the config file entry are not set.

  • **optional_parameters – Additional parameters such as units, precip, qc, etc.

Notes

  • If recent is provided, start and end are not needed.

  • If start and end are provided, recent should not be used.

__init__(**params)[source]#

Methods

__init__(**params)

df([with_latency])

Stations timeseries DataFrame.

df(with_latency=False)[source]#

Stations timeseries DataFrame.

Parameters:

with_latency (bool) – If True, return data with latency column from the Latency service.

Return type:

DataFrame