Travel...e::Part(3pm)
πΈ Travel::Routing::DE::EFA::Route::Part πΈ
okay so bestie, you've stumbled onto the Travel::Routing::DE::EFA::Route::Part(3pm) page and honestly? it's a good one. it's a Perl module, it's part of the User Contributed Perl Documentation, and it does exactly one job. let's get into it π
β¨ NAME β¨
Travel::Routing::DE::EFA::Route::Part β describes one connection between two points, without interchanges. like, one leg of the journey. no changing trains, no drama. just vibes from point A to point B π
π SYNOPSIS π
for my $part ( $route->parts ) {
if ( $part->regular_notes ) {
say join( "\n", $part->regular_notes );
}
if ( $part->current_notes ) {
say join( "\n", map [ $_->{summary} ] $part->current_notes );
}
printf(
"%s at %s -> %s at %s, via %s to %s",
$part->departure_time, $part->departure_stop,
$part->arrival_time, $part->arrival_stop,
$part->train_line, $part->train_destination,
);
}
π VERSION π
version 2.24 β that's the one, periodt.
π DESCRIPTION π
Travel::Routing::DE::EFA::Route::Part holds one specific connection (without interchanges) between two points. It tells you the start/stop point and time, the train line and where that train is headed, plus some optional extra data if the backend felt like sharing. π«Ά
you don't usually make one of these yourself β you get it by calling Travel::Routing::DE::EFA::Route(3pm)'s parts method. it's giving handed to you by the parent route, and honestly that's the only way it should be.
π¦ METHODS π¦
π ACCESSORS π
quick vocab check before we go, because the wording matters: "Actual" in these descriptions means the delay (if there even is one available) is already baked into the calculation. "Scheduled" means it isn't. iykyk. β¨
$part->arrival_delayβ arrival delay in minutes,0if unknown. so if it says0, it might genuinely be on time, or the backend just doesn't know. iconic ambiguity π$part->arrival_stopβ the arrival stop (city name plus station name).$part->arrival_platformβ the arrival platform, and it's either"Gleis x"or"Bstg. x".$part->arrival_stop_and_platformβ the"stop: platform"concatenation. convenience queen π$part->arrival_dateβ Actual arrival date inDD.MM.YYYYformat.$part->arrival_timeβ Actual arrival time inHH:MMformat.$part->arrival_sdateβ Scheduled arrival date inDD.MM.YYYYformat.$part->arrival_stimeβ Scheduled arrival time inHH:MMformat.$part->arrival_routemapsβ list of URLs, may be empty. each URL points to a transfer map for the arrival station, usually outlining how to transfer from this train to the next one (if applicable). πΊοΈ$part->arrival_stationmapsβ list of URLs, may be empty. each URL points to an HTML map of the arrival station.$part->current_notesβ remarks about unscheduled changes to the line serving this connection part, like cancelled stops. most times, the EFA service does not include this information in its route calculations. returns a list ofTravel::Routing::DE::EFA::Route::Message(3pm)objects.$part->delayβ alias fordeparture_delay. same energy, shorter name π$part->departure_delayβ departure delay in minutes,0if unknown.$part->departure_stopβ departure stop (city name plus station name).$part->departure_platformβ departure platform, either"Gleis x"or"Bstg. x".$part->departure_stop_and_platformβ the"stop: platform"concatenation.$part->departure_dateβ Actual departure date inDD.MM.YYYYformat.$part->departure_timeβ Actual departure time inHH:MMformat.$part->departure_sdateβ Scheduled departure date inDD.MM.YYYYformat.$part->departure_stimeβ Scheduled departure time inHH:MMformat.$part->departure_routemapsβ list of URLs, may be empty. each URL points to a PDF transfer map for the departure station, usually outlining how to transfer from the previous train (if applicable) to this one. πΊοΈ$part->departure_stationmapsβ list of URLs, may be empty. each URL points to an HTML map of the departure station.$part->footpath_durationβ walking duration when transferring before / after / during this trip, in minutes. the meaning depends on the value offootpath_type. keep that in mind bestie πΆβοΈ$part->footpath_partsβ returns a list of[type, level]arrayrefs describing the footpath. for instance,["ESCALATOR", "UP"],["LEVEL", "LEVEL"],["STAIRS", "UP"]means first taking an escalator up, then walking a while, and then taking a flight of stairs up again. the content oftypeandlevelcomes directly from the EFA backend. at the moment, the following values are known:type:ESCALATOR,LEVEL,STAIRSlevel:DOWN,LEVEL,UP
$part->footpath_typeβ type of this footpath, passed through from the EFA backend. the value"AFTER"indicates a footpath (transfer) after this route part. the value"IDEST"indicates that this route part already is a footpath (aka a walking connection between two stops), so the footpath accessors contain redundant information. other values such as"BEFORE"may also be returned, but this is unknown at this point. π$part->is_cancelledβ returns true if this part of the route has been cancelled (i.e., the entire route is probably useless), false otherwise. for unknown reasons, EFA may sometimes return routes which contain cancelled departures. yeah. it does that. π$part->occupancyβ returns expected occupancy, if available. values range from1(low occupancy) to3(very high occupancy). so3is giving packed-train main character energy π$part->regular_notesβ remarks about the line serving this connection part. returns a list ofTravel::Routing::DE::EFA::Route::Message(3pm)objects.$part->train_destinationβ destination of the line providing the connection. may be empty.$part->train_lineβ name / number of the line. may be empty.$part->train_productβ usually the prefix oftrain_line, for instance"U-Bahn"or"Niederflurstrab". however, it may also contain special values such as"Fussweg"(for a direct connection without transit vehicles) or"nicht umsteigen"(in case a vehicle changes its line number at a stop). in those cases,train_destinationandtrain_lineare usually empty. it's giving plot twist β¨$part->viaβ returns a list of"[ "DD.MM.YYYY", "HH:MM", stop, platform, delay ]"arrayrefs encoding the stops passed betweendeparture_stopandarrival_stop, if supported by the backend. returns nothing / an empty list otherwise. date and time refer to schedule data and do not account for delays.
π©Ί DIAGNOSTICS π©Ί
None. truly nothing to report, bestie. no errors, no warnings, we're just vibing π§
π¦ DEPENDENCIES π¦
that's it. that's the whole list. minimal queen π
π BUGS AND LIMITATIONS π
$part->viadoes not work reliably.
not me reading that and going π β yeah, it's just broken-ish. plan accordingly.
π SEE ALSO π
go read those next, they're the whole friend group π«Ά
π AUTHOR π
Copyright (C) 2011-2021 by Birte Kristina Friesel <derf@finalrewind.org>
π LICENSE π
This program is licensed under the same terms as Perl itself.
and that's the whole page, bestie π this was perl v5.36.0, dated 2023-11-27, and it ate. slay, go catch your train πβ¨π
π¦ where this page comes from
- debian trixie: libtravel-routing-de-vrr-perl 2.24-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtravel-routing-de-vrr-perl 2.24-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtravel-routing-de-vrr-perl 2.24-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtravel-routing-de-vrr-perl 2.24-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms