Demo python package of a CLI application fetching and displaying weather data for a given city.
git clone
cd weather
pip install .
Usage: weather [OPTIONS] CITY
Arguments:
* city TEXT The city for which to display the weather forecast [default: None] [required]
Options:
* --unit [metric|imperial] Units to use for weather data [default: metric]
* --help Show this message and exit.
This app uses OpenWeatherMap service to fetch the weather information. To use this app, you first need to create a personal API key (see here).
Do once:
export OPENWEATHERMAP_KEY=<YOUR_API_KEY>
Then:
weather --help
weather London
weather London --unit metric
Use pre-commit hooks which will run the ruff
linter and formatter, and run the mypy
type-checker:
pre-commit install
pytest