Skip to content

pazurkota/console-weather

Repository files navigation

⛅ Console Weather project

Release Repo Size Downloads License

Console Weather project is a simple application project to check weather in console. You can get it on NuGet page

App Screenshot

Features

  • Show Temperature and Weather Condition
  • Show current Wind Speed and Direction
  • Show Air Pressure, Humidity and Cloud Cover
  • Show Weather Alerts
  • Show Weather Forecast for a next day
  • Show Air Quality
  • Show Weather Icons

Installation

If you installed .NET 7.0 or newer, just simply paste this command into console:

$ dotnet tool install --global console-weather --version 1.7.1

If you want to update, just type:

$ dotnet tool update --global console-weather

Usage

Commands:

# To use aplication, type:
$ weather

# To get weather info from a specified city, type:
$ weather -c "Warsaw"

# To get weather information without alerts, type:
$ weather --no-alerts

# To get forecast for the next day, type:
$ weather -f

# To use specific units, type:
$ weather -u Si

# To get air quality data, type:
$ weather -a

# To show weather without icons, type:
$ weather --dont-show-icons

# To show astronomical data, type:
$ weather --astronomy

# To show hourly weather forecast, type:
$ weather --hourly-weather

Default settings:

This project uses default settings that are stored in config.json file. You can change them by editing this file:

{
  "api-key": "api-key",
  "default-city": "Sydney",
  "dont-show-alerts": false,
  "show-forecast": false,
  "units": "EU",
  "air-quality": true,
  "dont-show-icons": false,
  "show-astronomy": false,
  "show-hourly-weather": false
}
  • "default-city" - default city that will be used if you don't specify it in command
  • "dont-show-alerts" - if set to true, weather alerts won't be shown
  • "show-forecast" - if set to true, weather forecast will be shown
  • "units" - units that will be used to show weather data. Possible values: eu, si, us, uk
  • "air-quality" - if set to true, air quality data will be shown
  • "dont-show-icons" - if set to true, weather icons won't be shown
  • "show-astronomy" - if set to true, astronomical data will be shown
  • "show-hourly-weather" - if set to true, hourly weather forecast (for 5 hours) will be shown

Note: These settings is not required. You can use application without them.

The config file is kept in:

  • Windows: C:\Users\USERNAME\Documents\weather_data\config.json
  • MacOS: /Users/USERNAME/Documents/weather_data/config.json
  • Linux: /home/USERNAME/Documents/weather_data/config.json

Demo

$ weather -c "Kansas City" --no-alerts -f -a

                :::
        .:      ===     .:.
       .===.    ===    .==-
         ==-           ==-
  .:.        .::---::.            ...
 .====:   .-===========-    ..............
    :-   -===--------====:....           ....
        ===------------=-...               ...
.....  :===-------::::.....                 ...
====-  :==------:.........                   ...
       .===---:...                           ...
        -===-:...                            .....
   :-=:  :=-:...                                ....
  ===:.   ....                                    ...
         ...                                      ...
        ...                                       ...
         ...                                     ....
         ....                                   ....
           .......................................

CURRENT WEATHER:
Current weather for Kansas City in United States of America is Partly cloudy
The temperature is 22,2°C, but feels like 24,6°C

Current Wind Speed: 11,2 kph (E)
Current Air Pressure: 1011,0 mbar
Current Visibility: 14,0 kilometers
Current Precipitation: 0,0 mm
Current Humidity: 71%
Current Cloud Cover: 25%
Current UV Index: 4,0 (Moderate)

FORECAST:
Tomorrow it will be Partly cloudy
Temperature Range: 13,8°C - 26,2°C (average: 19,9°C)
Maximum Wind Speed: 13,7 kph
Average Visibility: 10,0 kilometers
Maximum Precipitation: 0,0 mm
UV Index: 5,0 (Moderate)
Chance of rain/snow: 0% / 0%

AIR QUALITY:
Carbon Monoxide: 337,10 ug/m3
Nitrogen Dioxide: 13,0 ug/m3
Ozone: 37,90 ug/m3
Sulphur Dioxide: 2,30 ug/m3
Fine Particles Matter: 13,10 ug/m3
Coarse Particles Matter: 13,5 ug/m3
US Epa Index: 1 (Good)

Last Update: 2023-06-08 09:00

Contributing

Contributions are always welcome!

See contributing for ways to get started.

Please look also at the Code Of Conduct

Acknowledgements

Used frameworks:

API and Icons:

Lessons Learned

This project basically was created to learn how to work with the API (in this case, weather API) and creating CLI apps using C#