Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/martibosch/meteostations-geopy

Pythonic interface to access data from meteorological stations
https://github.com/martibosch/meteostations-geopy

Last synced: 4 days ago
JSON representation

Pythonic interface to access data from meteorological stations

Awesome Lists containing this project

README

        

[![PyPI version fury.io](https://badge.fury.io/py/meteostations-geopy.svg)](https://pypi.python.org/pypi/meteostations-geopy)
[![Documentation Status](https://readthedocs.org/projects/meteostations-geopy/badge/?version=latest)](https://meteostations-geopy.readthedocs.io/en/latest/?badge=latest)
[![CI/CD](https://github.com/martibosch/meteostations-geopy/actions/workflows/dev.yml/badge.svg)](https://github.com/martibosch/meteostations-geopy/blob/main/.github/workflows/dev.yml)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/martibosch/meteostations-geopy/main.svg)](https://results.pre-commit.ci/latest/github/martibosch/meteostations-geopy/main)
[![codecov](https://codecov.io/gh/martibosch/meteostations-geopy/branch/main/graph/badge.svg?token=hKoSSRn58a)](https://codecov.io/gh/martibosch/meteostations-geopy)
[![GitHub license](https://img.shields.io/github/license/martibosch/meteostations-geopy.svg)](https://github.com/martibosch/meteostations-geopy/blob/main/LICENSE)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/martibosch/meteostations-geopy/HEAD?labpath=docs%2Fuser-guide%2Fagrometeo.ipynb)

# Meteostations geopy

Pythonic interface to access data from meteorological stations

## Installation

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:

```bash
# 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
```

## Overview

This library provides a set of provider-specific clients to get observations from meteorological stations.

```python
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


```python
ts_df.resample("H").mean().plot()
```

![Agrometeo time series plot](https://github.com/martibosch/meteostations-geopy/raw/main/docs/figures/agrometeo-ts.png)

See [the user guide](https://meteostations-geopy.readthedocs.io/en/latest/user-guide.html) for more details.

## See also

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:

- [martibosch/agrometeo-geopy](https://github.com/martibosch/agrometeo-geopy)
- [martibosch/netatmo-geopy](https://github.com/martibosch/netatmo-geopy)

Eventually these packages will be fully integrated into meteostations-geopy.

## Acknowledgements

- Many utils such as the requests cache mechanism or the logging system are based on code from [gboeing/osmnx](https://github.com/gboeing/osmnx).
- This package was created with the [martibosch/cookiecutter-geopy-package](https://github.com/martibosch/cookiecutter-geopy-package) project template.
- With the support of the École Polytechnique Fédérale de Lausanne (EPFL).