Skip to content

iswiac/bakalari

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bakalari Daily Check

Automated monitoring of Bakalari school messages with Google Calendar integration.

What it does

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.

Detection keywords

  • 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

Smart features

  • 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 modeKID_N_INDEPENDENT=true limits events to exams and parent meetings
  • Teacher filteringKID_N_SKIP_TEACHERS to 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

Setup

Prerequisites

  • Python 3.10+
  • Google account with Calendar API access

Install

python3 -m venv .venv
source .venv/bin/activate
pip install -e .

Configure

Copy .env.example to .env and fill in your credentials:

cp .env.example .env

Google OAuth (first time)

source .venv/bin/activate
python reauth_with_tasks.py

Open the printed URL in a browser, authorize, and the token is saved to ~/.gcalcli_oauth.

Gmail notifications

  1. Generate an app password at https://myaccount.google.com/apppasswords
  2. Save it:
    echo "your-app-password" > ~/.gmail_app_password
    chmod 600 ~/.gmail_app_password

Usage

Manual run

source .venv/bin/activate
python bakalari_daily_check.py

Options:

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 date

Filters can be combined. Targeted runs (with --kid, --sender, or --date) skip the run-once guard and ankety checks automatically.

Cron (daily at 18:00)

0 18 * * * cd /path/to/bakalari && .venv/bin/python bakalari_daily_check.py >> logs/bakalari_check.log 2>> logs/bakalari_error.log

Calendar events

Events are prefixed with KID_N_PREFIX from .env (e.g. DO - Event Name).

Duration: 1 hour for tests/meetings, 2 hours for excursions/events.

Customization

Keywords

Edit the ACTION_KEYWORDS dictionary in bakalari_daily_check.py.

Detection window

The script checks messages from the last 2 days by default. Change the days parameter in is_recent_message() calls.

About

Automated Bakalari school system monitor — fetches messages, detects action items (tests, homework, events), creates Google Calendar events, and sends email summaries. Configurable for multiple kids.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages