Skip to content

About

Flask web app driving a Pi thermal printer: daily agenda from an iCloud calendar

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

Repository files navigation

Receipt printer

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 thermal printer mid-print, with a cascade of printed task receipts piling up in front of it

How it works

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.

Setup

  1. Install dependencies:

  2. pip install -r requirements.txt
    1. 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:

    2. 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
      1. Point the app at the printer: make sure the Pi is running the receipt printer service and set PI_IP in test.py to the Pi's address.

        1. Run ./run.sh (or python app.py from an activated venv). The interface is at http://localhost:3000.

        2. Endpoints

        3. | Route | Does |

        4. |---|---|

        5. | / | Dashboard: calendars and today's tasks |

        6. | /calendars, /calendar/<name> | Browse calendars and their events |

        7. | /add_event/<calendar>, /edit_event/<calendar>/<uid>, /delete_event/<calendar>/<uid> | Event management |

        8. | /tasks, /print_task/<index>, /print_all_tasks | View and print processed tasks |

        9. | /create_task | Custom task form with print preview |

        10. | /print_message | Free-text printing with templates |

        11. Troubleshooting

        12. Calendar connection issues: check the iCloud credentials and the app-specific password. Printer not responding: check the Pi service is running and PI_IP is 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.

About

Flask web app driving a Pi thermal printer: daily agenda from an iCloud calendar

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages