- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .gitignore | ||
| download_receipts.py | ||
| README.md | ||
| requirements.txt | ||
SumUp Receipt Downloader
Downloads SumUp receipts as PDFs and names each file after the date found inside the PDF.
Output files are named YYYY-MM-DD_HH-MM-SS_<receiptId>.pdf, so multiple receipts on one day don't collide (the time is 00-00-00 if none is found in the PDF). If no date can be found, the file is named undated_<receiptId>.pdf and a warning is printed.
Setup
Requires Python 3.9+.
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
Dependencies are listed in requirements.txt: requests (downloads) and pypdf (reads the date from the PDF).
Usage
Pass receipt URLs directly, or give one or more text files containing one URL per line (blank lines and lines starting with # are ignored):
# From a file
.venv/bin/python download_receipts.py urls.txt
# Directly
.venv/bin/python download_receipts.py "https://receipts-ng.fleet.live.eu-west-1.sumup.net/v0.1/receipts/TAAA6KP7K7R?mid=MKA99ZJ0&format=pdf"
# Custom output directory (default: receipts)
.venv/bin/python download_receipts.py urls.txt -o my_receipts
Quote URLs on the command line so the shell doesn't treat & specially.
Example urls.txt:
# March receipts
https://receipts-ng.fleet.live.eu-west-1.sumup.net/v0.1/receipts/TAAA6KP7K7R?mid=MKA99ZJ0&format=pdf
receipts-ng.fleet.live.eu-west-1.sumup.net/v0.1/receipts/TAAA6KP7K7S?mid=MKA99ZJ0&format=html
Behaviour
- The
formatquery parameter is always forced topdf, sohtmllinks work too, and thehttps://scheme is optional. - The date is the first one found in the PDF text. Supported formats include
2026-10-23,23/10/2026,23.10.2026,5 Mar 2025andMarch 5, 2025. Numeric dates are read day-first. - Existing files with the same name are overwritten.
- A failed download is reported on stderr and the script carries on. The exit code is
1if any receipt failed, otherwise0.
Troubleshooting
If a receipt comes out undated, extract its text (e.g. with pypdf) and add a matching pattern to DATE_PATTERNS in download_receipts.py.