Skip to content

Releases: gatemedia/swiss-netex

Release list

1.0.0

Choose a tag to compare

@thibaudgg thibaudgg released this 13 Aug 08:39
449c081

First public release. Download, inspect, and filter Swiss national NeTEx
timetable packages from opentransportdata.swiss.

Added

  • CLI binary swiss-netex with help, version, download, operators,
    lines, filter, and extract
  • download — resolve the latest (or year-pinned) national NeTEx zip via the
    public catalog + dataset page HTML, stream to disk, cache under
    ~/.cache/swiss-netex (override with --cache-dir / --force)
  • operators / lines — discovery tables from RESOURCE / SERVICE only
    (TSV when piped; aligned columns on a TTY). Optional --operator /
    --line filters on lines. Omit --from to download/cache first
    (-y / -d / -c / -f, same rules as extract)
  • filter — operator/line filter for a local zip or directory package:
    streaming SERVICE + TIMETABLE passes, transitive RESOURCE / SERVICE /
    SITE / SERVICECALENDAR / COMMON rewrite, drop empty timetable shards,
    README.txt in the output zip
  • extract — download (when --from omitted) + filter in one command
  • Operator aliases: GO number, ch:1:Operator:*, SBOID, ShortName
    (repeatable --operator = union). Line aliases: PublicCode, id, SLNID,
    ShortName, Name. With explicit --line, journeys must carry a matching
    LineRef (operator-only fallback only when no line filter is set)
  • COMMON connection entities (JourneyMeeting, InterchangeRule) kept only
    when every tracked journey/stop/line ref still resolves in the package
  • Bare -o stem without extension becomes stem.zip for filter/extract;
    existing directories / trailing / still get the default *_op-….zip
    name inside
  • National-scale streaming: short-lived fork workers for TIMETABLE shards
    and support frames, parent byte pre-scan to skip empty shards, streamed
    kept-journey bodies, non-DOM COMMON scanner
  • Env knobs: SWISS_NETEX_TT_WORKERS (default CPU count; 1 = serial),
    SWISS_NETEX_TT_BATCH (default 1 shard/child), SWISS_NETEX_NO_FORK=1
  • SwissNetex::Package, ResourceFrame, Operators, Lines, Filter,
    Download, Extract library entry points
  • Minitest suite (fixture packages only; no national zip in CI), GitHub
    Actions CI + tag publish gated on test/lint, minimal RuboCop, RubyGems
    trusted-publish on version tags
  • rake publish VERSION=x.y.z dates CHANGELOG, verifies, tags, and pushes;
    the tag workflow creates the GitHub Release from that version section

Fixed

  • Filtered XML no longer keeps blank “holes” where dropped entities used to sit
    (streaming whitespace collapse in SERVICE/SITE/RESOURCE/SERVICECALENDAR,
    TIMETABLE, and COMMON writers — no full DOM pretty-print)

Notes

  • Tool is MIT; timetable data remains under OpenTransportData terms
  • Cache key is the remote filename (export timestamp embedded); a positive-size
    file must also open as a zip before it counts as a hit. Use --force to
    re-download
  • Downloads request Accept-Encoding: identity so size checks compare
    wire Content-Length to the bytes written on disk
  • Filter/extract write the output zip via a same-directory temp file + rename
  • TIMETABLE TrainNumber defs are kept whether they appear before or after
    vehicleJourneys (defs-first inputs may emit trainNumbers after journeys)
  • Filtered-package README.txt and public README document Swiss-profile
    expectations: ValidDayBits calendars, closed COMMON connections, sparse
    TIMETABLE shard indices
  • Peak system RSS scales roughly with worker count × largest kept shard;
    prefer a machine with several GB free RAM for full national filters
  • extract / operators / lines: --from cannot be combined with
    --dataset / --year / --force / --cache-dir (download-only flags)

See CHANGELOG.md for the full history.