The lab

Treasury Bot

Reads photos of handwritten church offering slips with AI, then fills in the ledgers and cashbooks once someone has checked the figures.

Python, Flask, Gemini Vision, Google Drive, Render

Tech stack

  • Python
  • Flask
  • Gunicorn
  • Gemini Vision
  • openpyxl
  • Google Drive API
  • Gmail API
  • HTML, CSS and JavaScript
  • Render

My part

Built for a local church treasury.

What it does

  • Photograph handwritten weekly offering slips with the phone camera, or upload them from the browser
  • AI pulls out the date, receipt number, income items and deductions, cleans up names and drops empty or "Nil" entries
  • A review screen with the photo beside editable figures: zoom and rotate the photo, change categories, reorder rows, and watch the totals update
  • Each slip produces a weekly ledger and an entry in that month's cashbook, filled in from Excel templates
  • Opening balances carry forward by themselves, and are recalculated when a slip from an earlier month is saved late
  • A warning before the same slip is recorded twice
  • After each save, an email with a summary and both Excel files, and a Send to WhatsApp button with the summary filled in

How it works

  • Google Drive is the master copy for cashbooks, ledgers and slip photos. Slips waiting to be saved are copied there too, so a server restart can't lose them.
  • Saves happen one at a time.
  • Email goes through the Gmail API, with ordinary mail sending as a fallback.
  • Hosted on Render, which redeploys on every push to main. It sits behind a login password, and no secrets are stored in the repo.