2026-04-12 22:39:58 +02:00
2026-04-05 22:01:50 +02:00
2026-04-04 20:31:37 +02:00
2026-04-04 20:38:40 +02:00
2026-04-05 22:22:49 +02:00
2026-04-12 22:37:35 +02:00
2026-04-12 22:39:58 +02:00
2026-04-05 22:22:49 +02:00

Backblaze Invoice Downloader

Download Backblaze invoices as PDF using browser automation.

Backblaze only provides invoices via a web page that must be printed — this tool automates that process using Playwright, filling in configurable fields (VAT ID, document type, company, notes) and exporting each invoice to PDF.

Setup

pip install -r requirements.txt
playwright install chromium

Or with Nix:

nix develop

Configuration

Create a .env file (see .env.example):

BACKBLAZE_EMAIL=you@example.com
BACKBLAZE_PASSWORD=your_password

INVOICE_VAT_ID=DE123456789
INVOICE_DOCUMENT_TYPE=Invoice
INVOICE_COMPANY=My Company GmbH
INVOICE_NOTES=Internal ref: 12345\nLine 2\nLine 3

OUTPUT_DIR=./invoices
BROWSER_HEADLESS=true
DOWNLOAD_ALL_YEARS=false

Notes can include literal \n to create line breaks in the invoice “Other” field.

Usage

python main.py

Options

-o, --output DIR       Output directory (default: ./invoices)
--headless             Run browser headless
--no-headless          Show browser window (useful for debugging)
--vat-id ID            VAT ID to fill on invoices
--document-type TYPE   Document type to select
--company NAME         Company name to fill
--notes TEXT           Notes to fill on invoices
--all-years            Download invoices for all years (default: first year only)
-v, --verbose          Verbose logging

CLI arguments override .env values.

How it works

  1. Logs in to secure.backblaze.com
  2. Navigates to the billing page
  3. Iterates over all billing groups and the selected year(s) (first year by default)
  4. For each invoice, opens the invoice page, fills the configured fields, and exports to PDF
  5. Skips already-downloaded invoices
Description
No description provided
Readme 208 KiB
Languages
Python 95.2%
Nix 4.8%