For accountants: monthly inbox → ledger
Bookkeeping teams do the same export every month. Automating it saves hours and removes copy-paste errors.
What monthly closings actually need
- All invoices received in the period, saved with stable names.
- A spreadsheet with date, vendor, invoice number, amount and file path.
- A way to prove nothing was missed — e.g. a count of messages scanned.
Audit-friendly naming
Rename attachments immediately: YYYY-MM-DD_vendor_invoice-no.pdf. This survives mailbox migrations and makes reconciliation trivial.
safe_vendor = re.sub(r"[^A-Za-z0-9]+", "-", vendor)[:40].strip("-")
name = f"{date:%Y-%m-%d}_{safe_vendor}_{invoice_no}.pdf"
Monthly run (15 minutes)
- Run the export with a date filter: first day of month → today.
- Check the message count against the mailbox search count.
- Open the Excel file, filter
status = review, fix the exceptions. - Archive the folder — it is your evidence trail for the period.
Common mistakes
| Mistake | Consequence |
|---|---|
| Overwriting files with the same name | Lost invoices |
| No date filter | Duplicate rows every month |
| Exporting “All Mail” | Duplicates from labels |
| No count check | Missed messages go unnoticed |
Keep the raw mailbox export and the final spreadsheet separately: raw is evidence, spreadsheet is work product.
Related guides
- Invoices from emailThe extraction workflow in detail.
- Bulk attachmentsSave every invoice file in one run.