Progress on my printable timetable generator

Amtrak Unlimited Discussion Forum

Help Support Amtrak Unlimited Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
A simple edge weighted graph where the nodes are stations, edges connection and weight the length of it may be extractable from past Amtrak timetables. I remember @PRR 60 used to compute such distance on the OTOL to file mileage travel reports from each member. Maybe he can help somehow.
 
Just a note of encouragement and thanks to all for offering suggestions.

When I worked for the City of Edmonton on recovery from the 1981 Pepin cutbacks, I typeset a schedule for a train to be run by VIA that I called Panorama. Because I used their typeface it seems that people in their office thought it came from somewhere in their organization.

These schedules look so real that they will need a disclaimer stating that they are not official. Or maybe I should fake a schedule for the Pioneer and put into the company mail ;)?
 
Thanks for doing this. As a retired software developer I can appreciate what goes into doing something like this.

According to the current information gleaned from the reservation system, painstakingly I might add, since there appears to be no simple way bypassing the well known British Library Algorithm :) that is still true. Baggage Service only at CHI and MKE.
I wonder if baggage checked between MKE and CHI gets carried on the Empire Builder rather than the Hiawatha. Just because a train uses NCPU "Cabbage" cars doesn't mean they always use them for baggage. The Downeaster for example.
 
The OTOL mileage database is in MS Access and has all the timetable mileages for each station and each service - what I called the station "mileposts." These mileposts were entered the hard way - manually, one-at-a-time from the Amtrak system timetables (after first having produced a table of every Amtrak station, also manually, one-at-a-time). The database currently has 621 active stations and 1095 active mileposts. It was a lot of grunt work at the beginning, but now is fully automated only requiring tweaking if a train changes route (Cascades/Coast Starlight Point Defiance bypass) or a station is added or moved (MSP).

When a trip is entered for mileage, the train number finds the train name, that points to the correct set of mileposts, and the start and end station mileposts calculate the trip length. The end result is mileage that matches the mileage on the Amtrak timetables (at least when there were Amtrak timetables).

If it would be any help to you, I could provide the currently accurate train, train name and milepost tables in a csv files.
 
I wonder if baggage checked between MKE and CHI gets carried on the Empire Builder rather than the Hiawatha. Just because a train uses NCPU "Cabbage" cars doesn't mean they always use them for baggage. The Downeaster for example.

In the past I've been able to check it on the Hiawatha train and it arrives with the corresponding Hiawatha train (not later in the day or the next day when the Builder comes through.) It also shows the checked baggage service on each individual train, which only occurs if that particular train carries baggage (not just if baggage service exists between those two points.)
 
These schedules look so real that they will need a disclaimer stating that they are not official. Or maybe I should fake a schedule for the Pioneer and put into the company mail ;)?

Yeah, I've been thinking about the disclaimers. You'll notice I already have two disclaimers!

In the past I've been able to check it on the Hiawatha train and it arrives with the corresponding Hiawatha train (not later in the day or the next day when the Builder comes through.) It also shows the checked baggage service on each individual train, which only occurs if that particular train carries baggage (not just if baggage service exists between those two points.)

This is the most annoying data gap for me: I can't get it programmatically. I can find out which stations have checked baggage service, but finding out which trains are carrying checked baggage is a matter of scraping together third-party data (my current choice) or poking at the website one at a time right now. I think it's a critical thing to have in a timetable though.
 
Very impressive work; Amtrak should hire you as a consultant for this project.

Hope you will be able to display all services on a route in addition to individual trains such as the Silver/Palmetto trains.

That’s helpful to see where possible train meets will occur and, more importantly, seeing at a glance different options for booking a trip. Early Amtrak timetables showed the host railroad too. While that would be nice I’m sure that’s of interest only to railfans.
 
Last edited:
The OTOL mileage database is in MS Access and has all the timetable mileages for each station and each service - what I called the station "mileposts." These mileposts were entered the hard way - manually, one-at-a-time from the Amtrak system timetables (after first having produced a table of every Amtrak station, also manually, one-at-a-time). The database currently has 621 active stations and 1095 active mileposts. It was a lot of grunt work at the beginning, but now is fully automated only requiring tweaking if a train changes route (Cascades/Coast Starlight Point Defiance bypass) or a station is added or moved (MSP).

When a trip is entered for mileage, the train number finds the train name, that points to the correct set of mileposts, and the start and end station mileposts calculate the trip length. The end result is mileage that matches the mileage on the Amtrak timetables (at least when there were Amtrak timetables).

If it would be any help to you, I could provide the currently accurate train, train name and milepost tables in a csv files.
I could absolutely use this. Thank you. I will follow up on it after I've done some higher-priority stuff (baggage baggage bagggggage)
 
Last edited:
Hope you will be able to display all services on a route in addition to individual trains such as the Silver/Palmetto trains.

Oh, definitely. Here's another prototype (again, I'm waiting to release these until I can get baggage and wheelchair access implemented) -- this for westbound weekday Empire Service. This also displays a number of other subtle bugs I'm trying to work out (I have to detect cells which are the first or last station a train stops at within the timetable). (I also have to get the "days of operation" into a row at the top for this type of timetable.)

And yes, I know I'm getting a little into the future with "Continues to Burlington, VT"
 

Attachments

  • tt_empire.pdf
    35.9 KB · Views: 44
Last edited:
Nice!!!
The OTOL mileage database is in MS Access and has all the timetable mileages for each station and each service - what I called the station "mileposts." These mileposts were entered the hard way - manually, one-at-a-time from the Amtrak system timetables (after first having produced a table of every Amtrak station, also manually, one-at-a-time). The database currently has 621 active stations and 1095 active mileposts. It was a lot of grunt work at the beginning, but now is fully automated only requiring tweaking if a train changes route (Cascades/Coast Starlight Point Defiance bypass) or a station is added or moved (MSP).

When a trip is entered for mileage, the train number finds the train name, that points to the correct set of mileposts, and the start and end station mileposts calculate the trip length. The end result is mileage that matches the mileage on the Amtrak timetables (at least when there were Amtrak timetables).

If it would be any help to you, I could provide the currently accurate train, train name and milepost tables in a csv files.
Could I use this as well for my trip tracking spreadsheet? 🥺
 
We should collectively figure out the maintenance and upkeep issue for @PRR 60 's mileage database. It will change over time as routes are added/modified, and the updates will need to be captured. Some gentleman's understanding of synching should be in order. But it is easily done as long it is kept in the workflow for generating new releases.
 
We should collectively figure out the maintenance and upkeep issue for @PRR 60 's mileage database. It will change over time as routes are added/modified, and the updates will need to be captured. Some gentleman's understanding of synching should be in order. But it is easily done as long it is kept in the workflow for generating new releases.
Storing this data in a text format (like csv) in a versioned repository (like GitHub) seems like a good way to go.
 
I had better give some hints about the font if other people are gonna start using this, and also strip out the default "created by Nathanael Nerode" !!!

I've got some questions for you about installation. It looks like you didn't manage to download/install the fonts and icons. How did you do the install? I'd like to get the font & icon installs so they'll work for you.
 
I've got some questions for you about installation. It looks like you didn't manage to download/install the fonts and icons. How did you do the install? I'd like to get the font & icon installs so they'll work for you.
I cloned the project from GitHub, then installed the dependencies noted in README.rst (GTFS Kit, PANDAS, Weasyprint). Weasyprint had the most issues on my Windows 11 machine. I then starting running timetable.py and resolving issues. With the Crescent work, there seem to be issues with the GTFS data - multiple instances of the same train. I commented line 269 of feed_enhanced.py to work around this.
 
I cloned the project from GitHub, then installed the dependencies noted in README.rst (GTFS Kit, PANDAS, Weasyprint). Weasyprint had the most issues on my Windows 11 machine. I then starting running timetable.py and resolving issues. With the Crescent work, there seem to be issues with the GTFS data - multiple instances of the same train. I commented line 269 of feed_enhanced.py to work around this.
Not surprised about the GTFS issues. :-( I've already found several. For most of the trains, you can usually get better results by picking a different reference date with
Code:
--date 20220401
or similar; the multiple trains are usually only on one day or something like that. There are a few where the problem covers the whole calendar, though.

I'm not sure why you're not picking up the fonts and icons, but I know my process for loading resources (load_resources.py) is somewhat hackish and questionable (I overloaded the jinja2 system). You might want to poke around there.

Also... are you picking up the fonts and icons in HTML and not in Weasyprint? If so, that would be a clue. Weasyprint is basically reading an HTML file, and has to find fonts and icons as external items like it would if it were looking at a web server, which makes the path lookup rather fragile.

(Try looking at tt_crescent.html in a web browser and see if you pick up the baggage icon and the font)
 
Not surprised about the GTFS issues. :-( I've already found several. For most of the trains, you can usually get better results by picking a different reference date with
Code:
--date 20220401
or similar; the multiple trains are usually only on one day or something like that. There are a few where the problem covers the whole calendar, though.

I'm not sure why you're not picking up the fonts and icons, but I know my process for loading resources (load_resources.py) is somewhat hackish and questionable (I overloaded the jinja2 system). You might want to poke around there.

Also... are you picking up the fonts and icons in HTML and not in Weasyprint? If so, that would be a clue. Weasyprint is basically reading an HTML file, and has to find fonts and icons as external items like it would if it were looking at a web server, which makes the path lookup rather fragile.

(Try looking at tt_crescent.html in a web browser and see if you pick up the baggage icon and the font)
Golly, things sure have changed since I was coding COBOL IMS and DEC applications some 20 years ago and more.

Guess I dig my collection of IBM & DEC manuals out of storage and toss them. :)
 
This is a very exciting open source project! See attached Crescent/Carolina/VA timetables that were quite easy to produce.
updated pdfs with correct fonts - thanks neroden for helping with where to look

Not surprised about the GTFS issues. :-( I've already found several. For most of the trains, you can usually get better results by picking a different reference date with
Code:
--date 20220401
or similar; the multiple trains are usually only on one day or something like that. There are a few where the problem covers the whole calendar, though.

I'm not sure why you're not picking up the fonts and icons, but I know my process for loading resources (load_resources.py) is somewhat hackish and questionable (I overloaded the jinja2 system). You might want to poke around there.

Also... are you picking up the fonts and icons in HTML and not in Weasyprint? If so, that would be a clue. Weasyprint is basically reading an HTML file, and has to find fonts and icons as external items like it would if it were looking at a web server, which makes the path lookup rather fragile.

(Try looking at tt_crescent.html in a web browser and see if you pick up the baggage icon and the font)
Thanks for the suggestions! Issue was that I am running timetable.py down in amtrak\timetables so that I can stay separate from your work. fonts and icons are relative to working directory rather than timetable.py. I'm not a python person, so i really don't know what best practice is. I made a copy of fonts and icons down in my timetables folder and it works much better.

updated pdfs with new author variable used
 
Last edited by a moderator:
My partner just tested positive for Covid which she caught at a doctor's office -- the SECOND TIME she's caught Covid at a doctor's office -- so I'm gonna be a little distracted. I'm still testing negative so far. I still think I should be able to get the baggage implemented today...

I'm finding there are additional options I want to put in which don't fit neatly into the CSV-based tt-spec format. Notably, the page title, though also the author, portrait vs. landscape, etc. So far I've just been making them command-line options or hacking directly in the templates folder. My current thought is to have a second file ".tt-aux" or something similar for the options, since I like being able to load the tt-spec file directly into a spreadsheet for all the table-based layout (stuff specific to rows and columns).
 
Back
Top