Contributing
On this page
Meteostat maintains an open directory of weather stations on GitHub. The Meteostat CLI ships a set of contributor commands which help you add, edit and check station records in a local copy of this repository before you submit a pull request.
All contributor commands live directly under meteo station:
meteo station
├── add
├── edit <id>
├── delete <id>
├── validate [<id>...]
├── duplicates
└── build📂 Setup#
First, fork the weather stations repository on GitHub and clone your fork:
git clone https://github.com/<your-username>/weather-stations.gitThe repository contains one JSON file per weather station in the stations directory. Each file is named after the station's Meteostat ID (e.g. stations/10637.json).
Repository Path#
The contributor commands need to know where your local clone is located. Set the path once using the stations_repo configuration key:
meteo config stations_repo ~/code/weather-stationsThe path must point to the root of the repository, i.e. the directory which contains the stations folder. You can check the current value at any time:
meteo config stations_repoTo use a different clone for a single command, pass the --repo option. It takes precedence over the configured path:
meteo station validate --repo ./weather-stationsIf neither --repo nor stations_repo is set, the CLI uses the current working directory if it looks like a stations repository and exits with an error otherwise.
🔄 Workflow#
A typical contribution looks like this:
# 1. Create a branch in your local clone
git -C ~/code/weather-stations checkout -b add-my-station
# 2. Add or edit station records
meteo station add
meteo station edit 10637
# 3. Check your changes
meteo station validate
meteo station duplicates
# 4. Commit, push and open a pull request
git -C ~/code/weather-stations commit -am "Add my station"
git -C ~/code/weather-stations push -u origin add-my-stationPlease make sure meteo station validate passes before opening a pull request. The same checks are run automatically on every pull request.
✍️ Guidelines#
- Names of weather stations are capitalized.
- Use short and descriptive names for a weather station.
- Refer to aerodromes which handle air cargo or passengers as airports and use the term airfield if they don't.
- Only include identifiers which are actually set. Don't add empty values.
- Prefer
editoverdelete+addso the Meteostat ID of a station stays stable.