logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

efa - Command line client for EFA-based public transit routing services

Author

       Copyright (C) 2009-2023 by Birte Kristina Friesel <derf@finalrewind.org>

Bugs And Limitations

       The EFA backend is not able to calculate "two-way" routes, i.e. from -> via -> to routes with from == to.
       If from and to are the same stop, it doesn't even  try  to  calculate  a  route  ("we  recommend  walking
       instead"), if they are close to each other it may or may not work.  Workaround: Request from -> via using
       the  normal  four-argument efa invocation, read the time, use efa -t time via via to to to request via ->
       to.

Configuration

       None.

Dependencies

       This script requires perl 5.10 (or higher) with the following modules:

       •   Class::Accessor

       •   Exception::Class

       •   LWP::UserAgent

       •   XML::LibXML

Description

efa  is  a command line client for EFA-based public transit routing interfaces, e.g. <http://efa.vrr.de>.
       efa requests connections between two points and displays the results.

       By default, the EFA service at <http://efa.vrr.de> (operated  by  Verkehrsverbund  Rhein-Ruhr)  is  used,
       which  supports  most  places in Germany.  A list of all supported EFA instances can be retrieved with -l
       and a custom instance can be selected using -sservice or -uurl. It is also possible to probe all  known
       EFA services for a specific connection using the -A and -D options.

       If available, efa shows the expected occupancy of each route part.  It ranges from "[  ]" (low occupancy)
       to  "[!!]"  (very  high  occupancy).  Occupation  data appears to be limited to certain VRR trains at the
       moment.

Examples

       efa Do Hbf MH Hbf
           Look up a connection from Dortmund (Do) Hbf to Muelheim (MH) Hbf

       efa --include ice Essen Hbf Hamburg Dammtor
           Look up a connection with long-distance trains

       efa --arrive 18:00 -e zug,s-bahn -M E Wickenburgstr D Oststr
           Look  up  a  connection  from Essen Wickenburgstr to Duesseldorf Oststr.  Do not use any trains, make
           sure to arrive around 18:00 and print links to maps of all interchange stations.

       efa -s vvs Stuttgart Hbf Stuttgart Marienplatz
           Use the VVS (Verkehrsverbund Stuttgart) EFA service to look up a connection.

Exit Status

           0    Everything went well
           1    Invalid arguments, see error message
           2    Network error, unable to send request
           3    EFA did not return any parsable data
           4    EFA error: ambiguous input
           5    EFA error: no connections found
           10   Unknown Travel::Routing::DE::EFA error
           255  Other internal error

License

       This program is licensed under the same terms as Perl itself.

perl v5.36.0                                       2023-11-27                                            EFA(1p)

Name

       efa - Command line client for EFA-based public transit routing services

Options

--fromcitystop
           Departure place

       --tocitystop
           Arrival place

       --viacitystop
           Travel via this place

           In all cases, if you want stop to  be  an  address  or  "point  of  interest",  you  can  set  it  to
           'addr:something' or 'poi:something'.

       -a|--arrivehh:mm
           Journey end time (overrides --time/--depart)

       -A|--auto-url|--discover-and-print
           Probe  all  known EFA entry points for the specified connection. Print the first result which was not
           an error.

           Note that this may take a while and will not necessarily return the best result.   Also,  using  this
           option by default is not recommended, as it puts EFA services under considerable additional load.

       -b|--bike
           Request connections allowing the passenger to take a bike with them.  Note that this may cause efa to
           display  no  routes at all -- In that case, the backend was unable to find such connections or didn't
           know about their bike-support.

       -B|--bike-info
           Show information about bike support, but do not select routes based on it.  In essence,  this  option
           simply  changes  the  --ignore-info  default. It is useful when --bike did not return any routes even
           though most of the route has bike support.

       -d|--datedd.mm.[yyyy]
           Journey date. Also accepts the shortcut tomorrow.

       -D|--discover
           Probe all known EFA entry points for the specified connection. No routes are returned in  this  case.
           Instead, efa will print the URLs and names of all entry points which did not return an error.

       -u|--efa-urlurl
           URL  to the EFA entry point, defaults to <https://app.vrr.de/vrrstd/XML_TRIP_REQUEST2>.  Depending on
           your   location,   some   urls   may    contain    more    specific    data    than    others.    See
           Travel::Routing::DE::EFA(3pm) and the -l option for alternatives.

       -e|--excludetransports
           Exclude transports (comma separated list).

           Possible  transports:  zug,  s-bahn,  u-bahn,  stadtbahn,  tram,  stadtbus,  regionalbus, schnellbus,
           seilbahn, schiff, ast, sonstige

       -E|--extended-info
           Display more than just the basic route information. At the moment, the  following  is  displayed  (if
           available):

           •   Route duration

           •   Ticket fare

           •   transfer duration and elevation changes (via stairs / escalators) at each stop

       -f|--full-route
           Display  intermediate  stops  (with time and platform) of each train.  Note that these are not always
           available.

       -I|--ignore-info [ regex ]
           Ignore additional information matching regex (default: /Fahrradmitnahme|Einstiegshilfe/)

           If regex is not supplied, removes the default regex (-> nothing will be ignored)

       -i|--includetype
           Include connections using trains of type type, where type may be:

           •   local (default)

               only take local trains ("Verbund-/Nahverkehrslinien"). Slow, but the cheapest  method  if  you're
               not traveling long distance

           •   ic

               Local trains + IC

           •   ice

               All trains (local + IC + ICE)

       -l|--list
           List supported EFA services with their URLs (see -u) and abbreviations (see -s).

       -M|--maps
           Output links to maps of transfer paths and transfer stations where available.

       -m|--max-changenumber
           Print connections with at most number interchanges

       -n|--num-connectionsnumber
           Return up to number connections.  If unset, the default of the respective EFA server is used (usually
           4 or 5).

       -P|--prefertype
           Prefer connections of type:

           •   speed (default)

               The faster, the better

           •   nowait

               Prefer connections with less interchanges

           •   nowalk

               Prefer connections with less walking (at interchanges)

       -p|--proximity [minutes]
           Take stops close to the stop/start into account.  By default, up to 10 minutes of walking to/from the
           route's first/last stop is considered acceptable. You can specify minutes to use a custom value.

       -s|--servicename
           Shortname  of  the EFA entry point. See Travel::Routing::DE::EFA(3pm) and the -l option for a list of
           services.

       -t|--time|--departhh:mm
           Journey start time

       --timeoutseconds
           Set timeout for HTTP requests. Default: 60 seconds.

       -v|--version
           Print version information

       -w|--walk-speedspeed
           Set your walking speed to speed.  Accepted values: normal (default), fast, slow

       -x|--accessibilitytypes
           Request connections satisfying all of the specified accessibility types (comma-separated list, option
           may be repeated). Please note that this may cause the backend to return no  results  at  all,  either
           because no such connection exists or because the required lines do not have the correct accessibility
           attributes set.

           The following types are supported:

           e / no-escalators
               Transfers must be possible without taking an escalator.

           E / no-elevators
               Transfers must be possible without using an elevator.

           i / info
               Does  not  restrict  the  requested  connections.  However,  this  option  causes  efa to display
               additional accessibility information for each route part (where available). When -xw or -xl  do
               not return any connections, using -xi might be more helpful (though it cannot guarantee that any
               of the results satisfy the respective type).

           l / nf / low-platform
               All vehicles must be low-platform ("Niederflur").

           s / no-stairs
               Transfers must be possible without stairs (e.g. via escalators/elevators or ramps).

           w / wheelchair
               All vehicles must be wheelchair accessible.

Synopsis

efa--fromcitystop--tocitystop [ additionaloptions ]
       efa [ options ] from-cityfrom-stop [ via-cityvia-stop ] to-cityto-stop

Version

       version 2.24

See Also