Pythonic interface to access data from meteorological stations
Although meteostations-geopy is not available in PyPI and conda-forge yet (hopefully will be soon), it can be installed using conda/mamba and pip as follows:
# install GDAL-based requirements
conda install -c conda-forge contextily geopandas osmnx
# install meteostations-geopy from GitHub
pip install https://github.com/martibosch/meteostations-geopy/archive/main.zip
This library provides a set of provider-specific clients to get observations from meteorological stations.
from meteostations.clients import agrometeo
start_date = "2021-08-13"
end_date = "2021-08-16"
client = agrometeo.AgrometeoClient(region="Canton de Genève")
ts_df = client.get_ts_df(start_date=start_date, end_date=end_date)
ts_df.head()
name | DARDAGNY | LA-PLAINE | SATIGNY | PEISSY | ANIERES | LULLY | LULLIER | BERNEX | TROINEX | MEINIER |
---|---|---|---|---|---|---|---|---|---|---|
time | ||||||||||
2021-08-13 00:00:00 | 19.3 | 17.8 | 18.5 | 17.9 | 20.6 | 18.4 | 20.3 | 18.6 | 19.4 | 25.8 |
2021-08-13 00:10:00 | 19.6 | 17.9 | 18.4 | 17.7 | 20.0 | 18.3 | 19.6 | 18.7 | 19.1 | 28.6 |
2021-08-13 00:20:00 | 19.0 | 17.7 | 18.2 | 17.6 | 19.4 | 18.4 | 19.1 | 18.7 | 19.2 | 24.1 |
2021-08-13 00:30:00 | 18.3 | 18.0 | 18.1 | 17.4 | 19.1 | 18.3 | 19.1 | 18.6 | 18.9 | 22.5 |
2021-08-13 00:40:00 | 18.7 | 18.0 | 18.1 | 17.6 | 19.1 | 18.0 | 19.0 | 18.7 | 18.5 | 21.5 |
5 rows × 10 columns
ts_df.resample("H").mean().plot()
See the user guide for more details.
This library intends to provide a unified way to access data from meteorological stations from multiple providers. The following libraries provide access to data from a specific provider:
Eventually these packages will be fully integrated into meteostations-geopy.
- Many utils such as the requests cache mechanism or the logging system are based on code from gboeing/osmnx.
- This package was created with the martibosch/cookiecutter-geopy-package project template.
- With the support of the École Polytechnique Fédérale de Lausanne (EPFL).