Local-first Windows desktop tool for collecting invoices and receipts from email accounts, converting attachments to PDF, keeping a private archive, and preparing DATEV-style CSV exports.
Deutsche Dokumentation: README-DE.md
| Need | Start with |
|---|---|
| Collect invoices from mailboxes | IMAP or Gmail API account setup in the app |
| Find receipts from shops or providers | Profile filters for sender, subject, body text, dates, and Gmail raw queries |
| Keep a local invoice archive | Target folders under your Windows user profile or a local sync folder |
| Prepare accounting handoff | Editable EUR amounts and DATEV-style cp1252 CSV export |
| Understand portable data | EXPORTFORMAT.md for the planned redacted exchange bundle |
- Universal IMAP for Gmail, Outlook, GMX, Web.de, T-Online, and other providers
- Optional Gmail API integration for faster and more robust Gmail runs
- Optional per-profile Gmail query builder for Gmail API and Gmail IMAP with
X-GM-RAW - Profile-based filters for sender, subject, body, and date ranges
- Downloads PDF attachments and converts other attachment types to PDF
- Supported conversions: images (
.png,.jpg,.jpeg,.bmp,.tif,.tiff,.webp),.docx,.xlsx - Optional legacy conversion for
.docand.xlsvia Word/Excel-COM or LibreOffice - Optional OCR for image-based PDFs (Tesseract +
pypdfium2) - Manual invoice amount column plus DATEV export for selected invoices
- Hash-based duplicate detection across local archive folders
- Secure credential storage via
keyring
- Run
start.bat - Add a mail account
- Configure a profile or shop template
- Set date range and target folder
- Click "Fetch Invoices"
pip install -r requirements.txt
python UniversalInvoiceMail.py- Add an IMAP or Gmail API account
- Configure a search profile with filters and target folder
- Optionally enable OCR and PDF mode
- Start a scan
- Enter invoice amounts for entries that should flow into accounting
- Review results in the local invoice archive or export them as DATEV CSV
Runtime data is stored in %USERPROFILE%\.universal_invoice_mail\:
%USERPROFILE%\.universal_invoice_mail\
├── config.json
├── invoices.json
├── credentials.json
└── token.json
Archived files are written to %USERPROFILE%\Documents\Rechnungen\ by default.
- Gmail API:
google-api-python-client,google-auth,google-auth-oauthlib - OCR:
pytesseract,pypdfium2,pypdf, Tesseract OCR - Legacy Office:
pywin32or a local LibreOffice withsoffice.exe - DATEV export uses the bundled
datev_exporter.pyand writes cp1252 CSV files
When no OCR or Office backend is available, unsupported steps are logged and skipped; the run remains robust.
- The invoice table exposes an editable amount column in EUR.
DATEV exportierencreates DATEV booking batches from the selected invoices.berater_nrandmandant_nrare configurable in the export dialog.- Invoices without an entered amount are skipped deliberately and called out after export.
UniversalInvoiceMail is intended for searches such as local invoice email archive, Gmail invoice downloader, IMAP receipt extractor, DATEV CSV export from email, PySide6 invoice manager, OCR invoice attachment archive, and privacy-first accounting document workflow. It is unrelated to hosted invoice platforms, mailbox marketing automation, or cloud bookkeeping suites; the default workflow keeps credentials, tokens, archives, and generated CSV files local to the Windows profile.
PYTHONIOENCODING=utf-8 python -m pytest -q
QT_QPA_PLATFORM=offscreen python tests/linux_platform_smoke.pyThe repository currently has 53 mocked tests for helper functions, IMAP/Gmail workflows, DATEV-adjacent behavior and compact UI control accessibility.
For Linux, an additional headless smoke covers the desktop start path, missing-keyring handling, LibreOffice fallback detection and CSV export without requiring a visible session.
- Credentials and Gmail OAuth tokens are stored under
%USERPROFILE%\.universal_invoice_mail\, not in the repository. .gitignoreexcludescredentials.json,client_secret*.json,token.json, local databases, sample output folders, and portable OCR bundles.- Real invoices, attachments, and generated release artifacts should remain local.
Part of the doc-bricks mail suite:
| Tool | Description |
|---|---|
| MailProcessor | System tray launcher for all Universal Mail Tools |
| UniversalMailCleaner | Rule-based IMAP mailbox cleaner with safe mode |
| UniversalDocsGrabber | Download documents and attachments from IMAP mail |
