No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-23 10:46:40 +01:00
.gitignore Add SumUp receipt downloader 2026-10-23 10:38:31 +01:00
download_receipts.py Handle ISO timestamps 2026-10-23 10:46:40 +01:00
README.md Include time in receipt filenames 2026-10-23 10:46:34 +01:00
requirements.txt Add SumUp receipt downloader 2026-10-23 10:38:31 +01:00

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 format query parameter is always forced to pdf, so html links work too, and the https:// 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 2025 and March 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 1 if any receipt failed, otherwise 0.

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.