All projects
Open Source | 2026 |
Running on cron

Tarjetazo

A bot that reads my credit card statement and sends me the breakdown

Role: Creator

Rol: Creador

Overview

A small, self-contained automation that watches my inbox for the monthly BNA VISA statement, decrypts the password-protected PDF, extracts and categorizes every transaction, and sends a Telegram summary compared against the previous month. Built because reading a bank PDF every month to find out where the money went is exactly the kind of thing a computer should do.

The Challenge

The statement arrives as an encrypted PDF with no consistent structure, merchant names are cryptic strings, and the job runs unattended — so a silent failure means finding out months later that nothing was tracked.

The Approach

One module per step — email, PDF parsing, categorization, formatting, history, delivery — orchestrated by a main script that only commits state when every step passed. Categorization is rules-first with an LLM fallback so the API cost stays near zero, and known merchants persist to a local cache.

The Outcome

Running unattended on a cron every six hours. Every month I get a categorized breakdown with subtotals and a month-over-month comparison, without opening a single PDF.

Key Highlights

01 Idempotent by design: the email is only marked as read once the whole pipeline succeeds
02 Keyword rules first, Claude only for merchants the rules don't recognize — and the answer is cached
03 Validates the computed total against the statement balance and flags any mismatch
04 Dead man's switch: alerts me if too long goes by without a new statement, in case the bot broke