The weather package contains modules which include getting the latest weather forecast.
- tzlocal
- PyOWM
- Register a new account on OpenWeatherMap Sign Up unless you already have one.
- Generate a new API key on OpenWeatherMap API keys.
- Duplicate the file
packages/weather/config/config.sample.json
and rename itconfig.json
. - Copy the API key in
packages/weather/config/config.json
and set the other options to your liking. - This package uses PyOWM. To install it: from inside leon directory
cd bridges/python
pipenv install tzlocal pyowm
- Done!
(en-US)
- "What's the weather like in Milan?"
- "When is the sun going to set in Rome?"
- "Is it windy in Chicago?"
(it-IT)
- "Che tempo fa a Milano?"
- "Quando tramonta il sole a Roma?"
...
pro
: Set this totrue
if you have a premium subscription.temperature_units
: Choose which temperature scale to use. ["celsius", "fahrenheit"]wind_speed_units
: Choose which units to use for the wind speed. ["meters per second", "miles per hour"] More units coming soon.
- Implement some sort of caching mechanism. PyOWM does support caching, but it's a bit messy. It might be easier to implement it from scratch, perhaps with some sort of db like TinyDb which is already supported by leon.
- Implement
pro
functionality for OWM. - Add more weather services and related (UV, pollution, sky events, etc.).