This program will check today’s weather forecast and tell you if you’re supposed to wear a sunblock or take an umbrella with you. Very handy for people who live in the basement and don’t have any windows!
if you do, don’t change your geoip too much - we use it to figure out your location.
If you’re running this on a server - check if it’s not configured to use UTC timezone.
store it in apikey
file
Running this software at 23:59 will still look at today’s weather data, so you can’t use this program to plan for tomorrow.
make build
Requires GNU Make, Docker and the user to be in the docker
group
(or run this as root - there’s little difference between being in a
docker group and root.)
make lint
Requires GNU Make, hadolint, pylint, python3.9 and mypy.
make test
Requires GNU make and Docker.
- Sign up on https://home.openweathermap.org/users/sign_up
- Copy the API key from https://home.openweathermap.org/api_keys
- Save it in apikey file like that:
API_KEY=435897efdsfwe8732j98fyq90eqwu0e4
- API key will be passed as an environmental variable to the
running container - you won’t leak it on accidental
docker push
.
You can either install dependencies (python3.9
, requests
) and
run it with
API_KEY=XXX python3.9 weather.py [-h] --weather {shine,rain}
or run it in docker containers:
make build
docker run --env-file apikey --rm -t weather:latest [-h] --weather {shine,rain}