https://github.com/berrnd/deutsche-bahn-online-ticket-parser
A little PowerShell script to parse Deutsche Bahn Online-Ticket PDFs
https://github.com/berrnd/deutsche-bahn-online-ticket-parser
bahn powershell
Last synced: about 1 year ago
JSON representation
A little PowerShell script to parse Deutsche Bahn Online-Ticket PDFs
- Host: GitHub
- URL: https://github.com/berrnd/deutsche-bahn-online-ticket-parser
- Owner: berrnd
- License: mit
- Created: 2018-05-05T15:07:32.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-06T11:45:10.000Z (about 8 years ago)
- Last Synced: 2025-05-29T06:03:58.345Z (about 1 year ago)
- Topics: bahn, powershell
- Language: PowerShell
- Size: 1.32 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# deutsche-bahn-online-ticket-parser
A little PowerShell script to parse Deutsche Bahn Online-Ticket PDFs
## Why?
I needed this, because I had a whole lot of tickets in PDF form and I wanted to have
a list with the information for my Einkommensteuererklärung - unfortunately, Deutsche Bahn
does not provide any API or something for this - we call this Digitalisierung.
This script reads Deutsche Bahn Online-Ticket PDFs from a folder,
extracts various information and writes to them to the specified CSV file
(see the script for paths and so on).
## Example output
```
Auftrag: SXXXXQ
Preis: 8,80
Hinfahrt: Bobingen -> Egling
Rueckfahrt: Egling -> Bobingen
Datum: 11.10.2017
Ticket-Typ: Flexpreis (Hin- und Rückfahrt)
Reisende: 1 mit 1 BC50
Auftrag: NXXXXD
Preis: 4,40
Hinfahrt: Bobingen -> Egling
Datum: 12.10.2017
Ticket-Typ: Flexpreis (Einfache Fahrt)
Reisende: 1 mit 1 BC50
```
## Example CSV file
```
11.10.2017 Bahn Fahrkarte (Typ: Flexpreis Hin- und Rückfahrt, Reisende: 1 mit 1 BC50, Strecke: Bobingen -> Egling und Egling -> Bobingen, Auftragsnummer: SXXXXQ) 8,80
12.10.2017 Bahn Fahrkarte (Typ: Flexpreis Einfache Fahrt, Reisende: 1 mit 1 BC50, Strecke: Bobingen -> Egling, Auftragsnummer: NXXXXD) 4,40
```
## Credits
- PDF parsing: iTextSharp (https://github.com/itext/itextsharp)
## License
The MIT License (MIT)