Travel...e::Part(3pm)

πŸ“¦
version 2.24 Β· 3 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

🌸 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, 0 if unknown. so if it says 0, 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 in DD.MM.YYYY format.
  • $part->arrival_time β€” Actual arrival time in HH:MM format.
  • $part->arrival_sdate β€” Scheduled arrival date in DD.MM.YYYY format.
  • $part->arrival_stime β€” Scheduled arrival time in HH:MM format.
  • $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 of Travel::Routing::DE::EFA::Route::Message(3pm) objects.
  • $part->delay β€” alias for departure_delay. same energy, shorter name πŸ’…
  • $part->departure_delay β€” departure delay in minutes, 0 if 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 in DD.MM.YYYY format.
  • $part->departure_time β€” Actual departure time in HH:MM format.
  • $part->departure_sdate β€” Scheduled departure date in DD.MM.YYYY format.
  • $part->departure_stime β€” Scheduled departure time in HH:MM format.
  • $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 of footpath_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 of type and level comes directly from the EFA backend. at the moment, the following values are known:
    • type: ESCALATOR, LEVEL, STAIRS
    • level: 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 from 1 (low occupancy) to 3 (very high occupancy). so 3 is giving packed-train main character energy 😭
  • $part->regular_notes β€” remarks about the line serving this connection part. returns a list of Travel::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 of train_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_destination and train_line are 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 between departure_stop and arrival_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->via does 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