// free agents / invoice-logger
🧾 Invoice & receipt logger
“Log every invoice and receipt I get by email into a spreadsheet: date, vendor, amount.”
Free, no sign-up. MIT licence. Python standard library only, so there's nothing to pip install.
What it does
Finds invoice and receipt emails over IMAP, reads the email text and any text-based PDF attached, and adds one row per invoice to a CSV file (opens in Excel, Numbers or Google Sheets): date, vendor, amount, currency, invoice number. Optionally it also adds the row to a Google Sheet. Already-logged emails are skipped.
What you need
- Python 3.9+ (no extra packages) or n8n
- IMAP access to your mailbox (app password for Gmail/Outlook)
- Optional: a Google Sheet plus the included 10-line Apps Script (no Google Cloud project needed)
5-minute setup
Python
- Install Python 3.9+ and unzip the download.
- Try it with no accounts:
python3 invoice_logger.py --eml-dir sample_emails --dry-run - Copy
.env.exampleto.envand fill it in. - Run:
set -a; . ./.env; set +a; python3 invoice_logger.py(Windows steps in the README).
n8n (no code)
- Workflows, then Import from file, then
invoice-logger.n8n.json. - Follow the yellow “Read me” note (credentials or webhook).
- Test workflow, then switch it to Active.
Run it on a schedule
Every day at 07:00 with cron:
0 7 * * * cd /path/to/invoice-logger && set -a && . ./.env && set +a && python3 invoice_logger.py >> run.log 2>&1On Windows use Task Scheduler. With n8n, the Schedule node does it for you.
Settings
| Variable | What it does |
|---|---|
IMAP_HOST / IMAP_USER / IMAP_PASSWORD | Your mailbox |
DAYS | How far back to look, default 30 |
KEYWORDS | Subject/file words that mean 'invoice', default invoice,receipt,facture,rechnung,order confirmation... |
FROM_CONTAINS | Optional: only these senders, e.g. stripe,aws,billing@ |
CSV_FILE | Default ./invoices.csv |
SHEET_WEBHOOK_URL | Optional: your Apps Script web app URL (see google_sheet_webhook.gs) |
What we tested
- Ran on the included samples: a PDF invoice ($24.00, number from inside the PDF), a euro receipt with comma decimals (18,00 €) and a £1,049.99 order were parsed correctly, and a personal email was ignored.
- A second run added nothing (duplicates skipped).
- Fake IMAP test (read-only, BODY.PEEK) and the Google Sheet push tested against a mock Apps Script endpoint.
- n8n workflow imported into a real n8n install and its parsing step run on test data. The IMAP and Google Sheets nodes need your accounts, so we didn't run them.
Honest limits
- Parsing is best effort (patterns, not AI). Check the amounts before you file taxes.
- Scanned/image PDFs have no text, so the amount stays empty; the row is still logged.
- Only simple text PDFs are read (no OCR). The n8n version reads the email text only.
- Not tested against a real mailbox or a real Google Sheet.
Related guides
Want one built for your task?
Describe it in one sentence. We build it, test it and email it to you, usually within 24h. Free while we're in beta.