Daily Ticket-Count Automation: Gmail PDFs to BigQuery and Google Sheets
A Python job that reads daily Ticketmaster audit PDFs from email, stores every figure in BigQuery and publishes a Google Sheet that mirrors the team’s existing workbook.
Python Automation
Works with
Python
Gmail API
BigQuery
Google Sheets
pytest
The Problem
An events company received daily Ticketmaster audit PDFs by email and re-typed the figures into a workbook by hand.
The Solution
A daily job reads the report emails through the Gmail API (with an OAuth refresh token), downloads and parses the audit PDFs, stores every figure in BigQuery, and publishes a Google Sheet that mirrors the team’s existing workbook. It was built spec first: a design spec, then an implementation plan, then tests with fixture PDFs, then the pipeline.
The project repository, with the ticket-count source code, tests, scripts and design documents.The Google Sheet the job publishes: tickets sold per day against capacity, split into GA and VIP, with the percentage sold. Event names and some tab names are hidden.The Run Log tab, with one row for each run of the job and its time.
Built with
Python, the Gmail API (OAuth), PDF parsing, BigQuery, the Google Sheets API and pytest.