A simple evaluation bot run daily to check if the commute to work will be better done by bike or car
Publishes notifications via Telegram, runs via docker and cron
- Python 83.5%
- Shell 12%
- Dockerfile 4.5%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
All checks were successful
/ Prepare / CI Environment (push) Successful in 2s
/ Validate / mypy (push) Successful in 10s
/ Validate / pylint (push) Successful in 12s
/ Validate (push) Successful in 0s
/ Build / package (push) Successful in 8s
/ Publish / pypi (push) Successful in 2s
/ Publish / forgejo (push) Has been skipped
/ Build / docker (push) Successful in 45s
|
||
| .forgejo/workflows | ||
| scripts | ||
| src/biking_bot | ||
| .gitignore | ||
| .python-version | ||
| Dockerfile | ||
| LICENSE.md | ||
| pyproject.toml | ||
| README.md | ||
| uv.lock | ||
biking-bot
A simple evaluation bot run daily to check if the commute to work will be better done by bike or car
config
Set the following env variables:
TELEGRAM_BOT_TOKEN=<bot token>
TELEGRAM_CHAT_ID=<chat id>
WAYPOINTS_JSON=[{"name": "<name1>", "lat": <lat of name1>, "lon": <lon of name 1>}, ...]
PRECIPITATION_LIMIT_MM=<desired percipitation limit>
WIND_GUST_LIMIT_KMH=<desired wind speed limit>
COMMUTE_HOURS=<desired commute hours>
WAYPOINTS_JSON is an array of waypoints, each comprised of the following:
{
"name": "start", # name of the waypoint
"lat": 0.0, # "latitude of the waypoint"
"lon": 0.0 # "longitude of the waypoint"
}
Recommendation: set start, end and a waypoint every few km (my case: every 3km)
PRECIPITATION_LIMIT_MM is typically a value between 0.0 and 1.0 (mm of rain), default is 0.5 - reduce accordingly if not even light rain is okay
WIND_GUST_LIMIT_KMH is the windspeed in km/h - default is 50
COMMUTE_HOURS is a comma-separated string of hours where the commute is to be evaluated, 7,8 as default