2023-05-20 00:35:47 +02:00
# Open Meteo CLI
2023-06-13 18:48:32 +02:00
![Status ](https://ci.midefos.com/api/badges/midefos/open-meteo-cli/status.svg )
2023-05-20 00:35:47 +02:00
CLI to extract meteorology data from Open Meteo.
## Usage
### Current Weather
2023-05-23 01:17:03 +02:00
Displays the current weather for your IP address automatically or for specific coordinates.
2023-05-20 00:35:47 +02:00
2023-05-21 02:25:27 +02:00
```
2023-06-08 23:10:21 +02:00
open-meteo-cli current-weather [FLAGS] [OPTIONS]
2023-05-20 00:35:47 +02:00
```
#### Options
2023-06-14 19:18:31 +02:00
- `-l, --latitude <latitude>` : Latitude as a decimal number.
- `-L, --longitude <longitude>` : Longitude as a decimal number.
2023-06-08 23:10:21 +02:00
- `--temperature-unit <temperature-unit>` : Switches between Celsius or Fahrenheit. Default value is Celsius.
- `--speed-unit <speed-unit>` : Switches between km/h, m/s, mp/h or knots. Default value is Kmh.
2023-06-14 19:18:31 +02:00
- `--format <format>` : Switches data format between Normal, Clean or JSON. Default value is Normal.
2023-05-21 02:25:27 +02:00
#### Flags
2023-05-23 01:17:03 +02:00
- `-a, --all` : Displays all the information.
2023-06-14 19:18:31 +02:00
- `-d, --is-day` : Displays if it is day or night.
2023-06-08 23:10:21 +02:00
- `-t, --temperature` : Displays the decimal temperature.
- `-w, --windspeed` : Displays the decimal wind speed.
2023-06-14 19:18:31 +02:00
- `-W, --winddirection` : Displays the wind direction, in degrees.
2023-05-23 01:17:03 +02:00
- `--coords` : Displays the latitude and the longitude.
- `--city` : Displays the city.
2023-06-14 19:18:31 +02:00
- `-c, --clean` : Displays the output separated by commas. Same as '--format clean'.
2023-05-23 01:17:03 +02:00
- The order of values is as follows: latitude, longitude, city, is_day, temperature, windspeed, winddirection.
2023-06-14 19:18:31 +02:00
- `-j, --json` : Displays the output as JSON. Same as '--format json'
2023-05-21 02:25:27 +02:00
#### Examples
2023-05-23 01:17:03 +02:00
- Standard usage: `open-meteo-cli current-weather -a`
```
┌──────────────────────────────────────────────────┐
│ │
│ === Current weather for Zaragoza === │
│ Night │
│ Temperature: 18.8°C │
│ Wind speed: 6.6 km/h │
│ Wind direction: 22° │
│ Latitude: 41.6405, Longitude: -0.8814 │
│ === Weather data by Open-Meteo.com === │
│ │
└──────────────────────────────────────────────────┘
```
- Using coordinates: `open-meteo-cli current-weather -l 12.2 -L=-0.38 -t -w`
2023-05-21 02:25:27 +02:00
```
2023-05-23 01:17:03 +02:00
┌──────────────────────────────────────────────────┐
│ │
│ === Current weather === │
│ Temperature: 32.6°C │
│ Wind speed: 12.5 km/h │
│ === Weather data by Open-Meteo.com === │
│ │
└──────────────────────────────────────────────────┘
2023-05-21 02:25:27 +02:00
```
2023-05-23 01:17:03 +02:00
- Clean: `open-meteo-cli current-weather -d -t -w -c`
2023-05-21 02:25:27 +02:00
```
2023-05-23 01:17:03 +02:00
0,18.8,6.6
2023-05-21 02:25:27 +02:00
```
2023-05-20 00:35:47 +02:00
2023-06-14 19:24:31 +02:00
- JSON: `open-meteo-cli current-weather -d -t -w -j`
```
{"is_day":0,"temperature":18.8,"windspeed":6.6}
```
2023-05-20 00:35:47 +02:00
## Attribution
2023-05-21 02:25:27 +02:00
The weather data used in this application is provided by [Open-Meteo.com ](https://open-meteo.com/ ) under the [CC BY 4.0 ](https://creativecommons.org/licenses/by/4.0/ ) license.
We would like to express our gratitude to Open-Meteo.com for their contribution to this project.