Desktop tool for downloading, converting, and archiving invoices and receipts from email accounts.
Deutsche Dokumentation: README-DE.md
- Universal IMAP for Gmail, Outlook, GMX, Web.de, T-Online, and other providers
- Optional Gmail API integration for faster and more robust Gmail runs
- 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.
pytest tests -vUnit tests for helper functions and integration tests for IMAP and Gmail workflows with mocks.
- 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 |
