hafas - Interface to HAFAS (e.g. Deutsche Bahn) itinerary services
hafas [-d date] [-t time] [-m motlist] [-s service] [-l language] [-v] from [via ...] to
version 0.09
hafas is a command line client for HAFAS-based public transit itinerary services, e.g. the one operated by Deutsche Bahn. It requests connections between two stops and prints the results.
Request connections that arrive at the destination before hh:mm. Overrides --time / --depart.
Request connections with no more than count changeovers.
Request connections with scheduled changeover durations of at least minutes. Note that this does not account for real-time data: the backend may return delayed connections that violate the specified changeover duration.
Planned departure (or arrival) date. Default: today.
Show intermediate stops of each connection.
Show journey IDs. These can be used to obtain details on individual journeys via hafas-m.
Request free-text messages to be provided in language. See --list for a list of languages supported by individual HAFAS instances. Note that requesting an invalid/unsupported language may lead to garbage output.
List known HAFAS installations and exit. Use -s|--service to select an operator from this list for a HAFAS request.
By default, hafas considers all modes of transport for routing. With motlist, it is possible to either exclude a list of modes, or exclusively show only a select list of modes.
To exclude modes, set motlist to !mot1,!mot2,...
To show them exclusively, set motlist to mot1,mot2,...
The mot types depend on the used service. Use -m help
to list them.
Use the API provided by service for routing; defaults to DB (Deutsche Bahn). See --list for a list of known services.
Request connections that depart from the origin after hh:mm. Default: now.
Show more HAFAS messages, e.g. related to construction sites or Wi-Fi availability. Repeating -v increases the verbosity. The level, and thus number of different message types that hafas displays, ranges from 0 (no -v) to 3 (-vvv).
Show version information and exit.
HAFAS responses include journeys that are infeasible e.g. due to delayed or cancelled trips. By default, hafas displays those with an XX.XX. departure date. When this option is set, hafas silently ignores them instead.
0 upon success, 1 upon internal error, 2 upon backend error.
None.
The non-default services (anything other than DB) are not well-tested.
Copyright (C) 2023 by Birte Kristina Friesel <derf@finalrewind.org>
This program is licensed under the same terms as Perl itself.