Imports & Parsers
The defining feature of TravStats: most flights you log don’t need to be typed. The data is already in your inbox or on the boarding pass; we just have to extract it.
Four parsers handle that, each with a separate page in this section:
| Parser | Input | Best for |
|---|---|---|
| Email parser | Forwarded .eml / .msg or pasted body text | Booked-but-not-yet-flown flights you have a confirmation for |
| Boarding pass scanner | Photo of the pass or the PDF | Right after check-in, or for old paper passes you scan in retroactively |
| User templates | A reference example you mark up once | Carriers TravStats doesn’t have a built-in template for, that you fly often |
| Bulk import | JSON / CSV / XLSX file | Backfilling years of past flights, migrating from another tool |
Plus an admin-only Parser-Statistiken view that surfaces hit rates, common-miss fields, and an anonymised JSONL export — useful for spotting when an airline’s mail layout drifted.
How the parsers fit together
Section titled “How the parsers fit together”You don’t pick “which parser” yourself most of the time. The flow:
- You drop the input — paste an email, snap a photo, upload a file.
- TravStats picks the right parser for that input type. Email body → email parser, image → boarding-pass scanner, file → bulk import.
- The parser cascades through providers:
- For email (Ollama-First when configured): user template (if confidence ≥ 80 %) → Ollama LLM → built-in regex templates → regex-only fallback
- For boarding pass: Ollama vision → OpenAI → Claude → Tesseract OCR → manual
- You see a review screen with whatever was extracted, and confirm before anything saves.
Nothing is ever saved without your review. If the parser misfires on a particular email or pass, you fix the wrong field on the review screen and continue — no need to delete-and-retry.
Recommendation: enable Ollama
Section titled “Recommendation: enable Ollama”For email parsing, the strongly recommended setup is Ollama —
the local LLM. With Ollama configured (default model gemma3:12b,
runs in a sidecar container at no extra cost), the parser:
- Handles multi-flight bookings correctly (regex templates often only catch the first leg or fail completely on outbound + return + connecting itineraries)
- Works for any airline, not just the eight that have built-in regex templates
- Tolerates HTML-heavy / image-only / template-redesigned emails that break regex matchers
Without Ollama, the parser still works — it falls back to the built-in regex templates (8 carriers) and a generic regex extractor. Single-leg bookings on supported airlines parse fine that way. Multi-leg or multi-flight emails are where regex-only struggles — if you frequently book complex itineraries, Ollama is the difference between “works most of the time” and “works”.
The bundled docker-compose.yml already includes the Ollama
sidecar, so for most users the recommendation is “leave it on”.
Setup details: Ollama page.
Built-in regex airline templates (the fallback)
Section titled “Built-in regex airline templates (the fallback)”When Ollama is unavailable or returns no flight, the parser falls back to regex templates for these eight European carriers:
| IATA | Airline | Notes |
|---|---|---|
LH | Lufthansa | Two formats supported: modern HTML, and the older “Buchungsdetails” plain-text |
LX | Swiss International | |
OS | Austrian | |
SN | Brussels Airlines | |
FR | Ryanair | |
U2 | easyJet | |
EW | Eurowings | |
W6 | Wizz Air |
For other airlines without Ollama, your options are: record a user template, or enter manually.
Privacy
Section titled “Privacy”All parsers run inside your TravStats container. Email bodies and boarding-pass images are processed locally — they only leave your network if you’ve configured a cloud-based vision parser (OpenAI / Claude) and the boarding-pass cascade reaches that tier.
For email parsing, the recommended Ollama setup runs in a sidecar
container next to TravStats — email content does not leave your
network. Only if you’ve deliberately pointed OLLAMA_URL at a
hosted Ollama service does the email body cross your network
boundary; TravStats doesn’t recommend that, and the bundled
docker-compose default is the local sidecar.
The marketing site at travstats.de has a privacy-friendly demo of the parser using pre-canned fictional sample emails — no real data ever sent. Worth a click if you want to see the parsing flow before importing your own emails.
Saving and re-importing
Section titled “Saving and re-importing”Parser results land on a review screen before anything is saved. From there you can:
- Edit any field that came through wrong before saving
- Delete unwanted suggestions (e.g. multi-leg bookings where you only flew the outbound leg)
- Save all to commit the lot, or pick rows individually
If you re-import the same email or pass for a flight that already exists, TravStats fills in missing fields without overwriting manually-curated ones. Boarding-pass scans after manual entry, or re-imports of an updated email confirmation, enrich the existing flight in place rather than creating duplicates. The dashboard surfaces a flightMerged toast that reports how many fields were filled in.