Automated monitoring of Bakalari school messages with Google Calendar integration.
Checks kids' Bakalari accounts daily for new messages, detects action items, and automatically creates Google Calendar events. Kids are configured via KID_N_* environment variables in .env.
- Tests/exams: test, zkouška, písemka, prověrka, čtvrtletní
- Oral exams: zkoušení
- Homework: úkol, domácí, odevzdat
- School events: exkurze, akce, program, návštěva, výlet
- Meetings: schůzka, setkání, hovorovky, konzultace
- Deadlines: termín
- Things to bring: přinést, s sebou
- Date extraction from Czech text (12.3., 15. května, zítra, ve čtvrtek, etc.)
- Time extraction (v 16:00, od 7:35)
- Subject detection — infers school subject from message title abbreviations and teacher-subject mapping via the timetable API
- Class-aware filtering — skips dates on lines meant for other classes (e.g. 6.A vs 6.B)
- Duplicate detection — skips events already in the calendar or previously created (locally logged in
logs/created_events.json, so manually deleted calendar events won't be recreated) - Past event filtering — skips events that already happened
- School Events API — fetches events from the Bakalari Events API in addition to messages
- Noticeboard — checks both private messages and the bulletin board (nástěnka)
- Ankety (surveys) — checks parent accounts for open surveys, creates deadline events
- Dark mode support — strips black-colored HTML from calendar descriptions for readability
- Color coding — configurable per kid via
KID_N_COLOR - Independent mode —
KID_N_INDEPENDENT=truelimits events to exams and parent meetings - Teacher filtering —
KID_N_SKIP_TEACHERSto ignore messages from specific teachers - Attendee assignment — kid required for school events, parent required for meetings
- Email summary — HTML email with all detected items and created events
- Run-once guard — prevents duplicate runs on the same day
- Python 3.10+
- Google account with Calendar API access
python3 -m venv .venv
source .venv/bin/activate
pip install -e .Copy .env.example to .env and fill in your credentials:
cp .env.example .envsource .venv/bin/activate
python reauth_with_tasks.pyOpen the printed URL in a browser, authorize, and the token is saved to ~/.gcalcli_oauth.
- Generate an app password at https://myaccount.google.com/apppasswords
- Save it:
echo "your-app-password" > ~/.gmail_app_password chmod 600 ~/.gmail_app_password
source .venv/bin/activate
python bakalari_daily_check.pyOptions:
python bakalari_daily_check.py --force # bypass the daily run-once guard
python bakalari_daily_check.py --kid "Name" # filter by kid name (substring match)
python bakalari_daily_check.py --sender "TeacherName" # filter by sender (substring match)
python bakalari_daily_check.py --date 2026-05-08 # filter by sent dateFilters can be combined. Targeted runs (with --kid, --sender, or --date) skip the run-once guard and ankety checks automatically.
0 18 * * * cd /path/to/bakalari && .venv/bin/python bakalari_daily_check.py >> logs/bakalari_check.log 2>> logs/bakalari_error.logEvents are prefixed with KID_N_PREFIX from .env (e.g. DO - Event Name).
Duration: 1 hour for tests/meetings, 2 hours for excursions/events.
Edit the ACTION_KEYWORDS dictionary in bakalari_daily_check.py.
The script checks messages from the last 2 days by default. Change the days parameter in is_recent_message() calls.