Skip to content

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:

ParserInputBest for
Email parserForwarded .eml / .msg or pasted body textBooked-but-not-yet-flown flights you have a confirmation for
Boarding pass scannerPhoto of the pass or the PDFRight after check-in, or for old paper passes you scan in retroactively
User templatesA reference example you mark up onceCarriers TravStats doesn’t have a built-in template for, that you fly often
Bulk importJSON / CSV / XLSX fileBackfilling 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.

You don’t pick “which parser” yourself most of the time. The flow:

  1. You drop the input — paste an email, snap a photo, upload a file.
  2. TravStats picks the right parser for that input type. Email body → email parser, image → boarding-pass scanner, file → bulk import.
  3. 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
  4. 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.

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:

IATAAirlineNotes
LHLufthansaTwo formats supported: modern HTML, and the older “Buchungsdetails” plain-text
LXSwiss International
OSAustrian
SNBrussels Airlines
FRRyanair
U2easyJet
EWEurowings
W6Wizz Air

For other airlines without Ollama, your options are: record a user template, or enter manually.

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.

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.