A Flask web app that turns an iCloud calendar into printed task receipts on a thermal printer driven by a Raspberry Pi. Each task prints as a receipt-style card with its name, due date, priority and reward; the web interface handles calendars, custom tasks and free-text messages. Personal project, in daily use on my desk.
The app reads calendars over iCloud, and an optional Gemini call formats events into tasks; without a key it falls back to basic task generation. Print jobs go to a service on the Raspberry Pi, which drives the printer. The web interface is Flask with Bootstrap: a dashboard of calendars and today's tasks, event add/edit/delete, a custom-task form with a live preview of the printed card, and a free-text print route with templates.
-
Install dependencies:
-
pip install -r requirements.txt
-
Configure environment variables. Use an app-specific password from your Apple ID settings, never your real iCloud password, and keep credentials in your environment or an untracked
.env: -
export APPLE_ID='your-icloud-email@example.com' export APPLE_PASSWORD='your-app-specific-password' export GEMINI_API_KEY='your-gemini-api-key' # optional, for AI task formatting
-
Point the app at the printer: make sure the Pi is running the receipt printer service and set
PI_IPintest.pyto the Pi's address. -
-
Run
./run.sh(orpython app.pyfrom an activated venv). The interface is athttp://localhost:3000. -
| Route | Does |
-
|---|---|
-
|
/| Dashboard: calendars and today's tasks | -
|
/calendars,/calendar/<name>| Browse calendars and their events | -
|
/add_event/<calendar>,/edit_event/<calendar>/<uid>,/delete_event/<calendar>/<uid>| Event management | -
|
/tasks,/print_task/<index>,/print_all_tasks| View and print processed tasks | -
|
/create_task| Custom task form with print preview | -
|
/print_message| Free-text printing with templates | -
Calendar connection issues: check the iCloud credentials and the app-specific password. Printer not responding: check the Pi service is running and
PI_IPis right. AI errors: check the Gemini key and quota, or run without one; the app falls back to basic task generation, and model availability changes are handled the same way.
-
-
-
