KSeF invoice merger
Turns Polish KSeF PDF invoices into one clean Excel sheet.
- Status
- Internal tool
- What it is
- Invoice data extraction
- Made for
- Businesses and accountants handling Polish KSeF invoices
- Started
- Feb 2026
- Built with
- Python, pdfplumber, openpyxl
The problem
Poland’s national e-invoicing system, KSeF, stores invoices as structured data, but plenty of businesses still receive and handle them as PDFs. The line items often run across several pages, and the product codes (index, PKWiU and CN) sit in a separate table. Getting both into a spreadsheet means retyping or a lot of careful copying.
What it does
Give it a KSeF invoice PDF and get back one Excel sheet with every line item and its codes side by side, formatted and ready to check or import.
What we learned
Most PDF extraction handles headers and totals well and falls apart on long tables that break across pages. That’s exactly the part that matters here, so it’s where most of the effort went: stitching together rows split by a page break, and lining up two tables that don’t share a layout.
Where it’s at
It works on real invoices and gets used. We’re considering a general version for accountants that handles any supplier’s layout, not just KSeF.
Questions
- What does the KSeF invoice merger do?
- It extracts the line items from a KSeF invoice PDF, including tables that run across several pages, matches them with the index, PKWiU and CN codes table, and writes the result to one formatted Excel sheet.
- Can I download the KSeF invoice merger?
- Not at the moment. It's an internal tool. If you have the same problem, email us, because we're considering a more general version.