Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mskrasnov/swf
Console program to get current information about weather
https://github.com/mskrasnov/swf
console openweathermap openweathermap-api reqwest rust weather
Last synced: 3 days ago
JSON representation
Console program to get current information about weather
- Host: GitHub
- URL: https://github.com/mskrasnov/swf
- Owner: mskrasnov
- License: mit
- Created: 2024-05-07T17:34:54.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2024-05-10T12:10:59.000Z (8 months ago)
- Last Synced: 2024-11-02T14:35:35.156Z (about 2 months ago)
- Topics: console, openweathermap, openweathermap-api, reqwest, rust, weather
- Language: Rust
- Homepage:
- Size: 808 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ⛅ SWF - Simple Weather Forecast
[![](https://img.shields.io/badge/Telegram-Свалка-blue)](https://t.me/svalka07) [![](https://img.shields.io/bagde/README%20на%20русском-8A2BE2)](README_RU.md)
![](assets/swf.gif)
SWF is a console program for get weather data for a given location. Uses OpenWeatherMap API. Supports configuration files with description of the main program parameters.
Displays ASCII art of the current weather, the time at the selected location (the time for weather data was measured, not the current time), and the temperature. More features will be added in the future (maybe).
![](assets/swf.png)
## Usage
- `--location` - location where you want to display weather: `--location=Vladimir,Vladimir\ Oblast,RU`
- `--units=` - units in which you want to output the information. Valid values:
- `metric`;
- `imperial`;
- `--api-key=` - OWM API key;
- `--config=` - path to the alternate config (default: `~/.config/swf/toml`);Keys passed to the program have higher priority than data from the config.
## Configuration
The configuration is described in a TOML format file. It describes the following parameters:
- Location;
- Units;
- API Key;The configuration is contained in the `~/.config/swf.toml`.
Each of the parameters is *optional*, i.e. may not be in the config. If a parameter is not in the config, it must be specified by passing the value to the corresponding key.
Example:
```toml
location = "Vladimir,RU"
units = "metric"
```The `api_key` parameter is not specified here, so it must be specified in the `--api-key` passed to `swf`:
```bash
swf --api-key=8sdfg6sd79f69sd87f6gsd9679
```## Local build
### Dependencies
- `rustc` and `cargo` for build;
### Build
```bash
cargo build --release
cp -v ./target/release/swf ~/.local/bin
```## Support me (Russia)
Если вы хотите поддержать этот проект, вы можете либо принять участие в его разработке, либо отправить донат мне на карту сбербанка:
> 2202 2062 5233 5406 (Михаил Сергеевич К.)
Участие в разработке SWF или донаты покажут, что эта утилита ещё кому-то нужна, а значит будут мотивировать меня продолжать разработку и добавлять новые функции и исправлять ошибки.
## License
SWF distributed under MIT license.