Command line weather app
Project description
Weather Command
A command line weather app
Installation
Installation with pipx is recommended.
pipx install weather-command
Alternatively Weather Command can be installed with pip.
pip install weather-command
Usage
First an API key is needed from OpenWeather, A free account is all that
is needed. Once you have your API key create an environment variable named OPEN_WEATHER_API_KEY
that
constains your API key.
export OPEN_WEATHER_API_KEY=your-api-key
Each time the shell is restarted this variable will be cleared. To avoid this it can be added to your
profile. For example if your shell is zsh the API key can be added to the ~/.zshenv
file. Doing this
will prevent the need to re-add the key each time the shell is started.
To get the weather for a city:
weather-command city seattle
Once installed you can also add aliases to your shell to make it quick to get a forecast. For example
if your shell is zsh you can add something like the following to your ~/.zshrc
file:
alias we="weather-command zip 98109 -i --am-pm"
alias wed="weather-command zip 98109 -i --am-pm -f daily"
alias weh="weather-command zip 98109 -i --am-pm -f hourly"
After adding this to the ~/.zshrc
you will need to restart your terminal. After that typing we
will get the current forecast, wed
will get the daily forecast and weh
will get the hourly forecast.
Arguments
- [HOW]: How to get the weather. Accepted values are city and zip. [default: city]
- [CITY_ZIP]: The name of the city or zip code for which the weather should be retrieved. If the first argument is 'city' this should be the name of the city, or if 'zip' it should be the zip code. [required]
Options
- -s, --state-code: The name of the state where the city is located.
- -c, --country-code: The country code where the city is located.
- -i, --imperial: If this flag is used the units will be imperial, otherwise units will be metric.
- --am-pm: If this flag is set the times will be displayed in 12 hour format, otherwise times will be 24 hour format.
- -f, --forecast-type: The type of forecast to display. Accepted values are 'current' 'daily', and 'hourly'. [default: current]
- -t, --temp-only: If this flag is set only tempatures will be displayed.
- --terminal_width: Allows for overriding the default terminal width. copy it or customize the installation.
- --help: Show this message and exit.
Contributing
Contributions to this project are welcome. If you are interesting in contributing please see our contributing guide
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for weather_command-0.4.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40a01a9a1738b0c9395d02b34f27a30fa67dd1de8f6c0ee2432b61590f38f5e6 |
|
MD5 | 240c9c64e7a1558bddb48b48e732a73c |
|
BLAKE2b-256 | 3970366ed546b87ca7566402ee6d5bd70ae3a37b235178344476303cb4637d61 |