Database Delving for Aviation Geekery
A couple of months ago, I wondered: what was the first plane I flew internationally in?
It's an easier question to answer for me than for some; I didn't take that flight until I was 26. On the other hand, it's long enough ago that it predates pretty much all of the flight tracking websites - and anyway, they typically charge for anything much older than a week. It also predates my use of Gmail, and I never did get around to importing my archive.
However, the US government - the DOT and more specifically the Bureau of Transportation Statistics - make available data on both international and domestic flight segments since 1990. It's pipe delimited, which is a bit weird, but nothing some database utilities couldn't handle, and so I rapidly had my candidate: Air India, which flew daily from Heathrow to New York (courtesy of what was called the "fifth freedom" - although it was between two countries that regulated air traffic heavily, it originated in India (either Delhi or Mumbai, apparently)). So, an Air India 747-400. Probably.
That wasn't the end of it, though. All of a sudden I had a database waiting to be explored. What planes flew LHR to JFK in 2001? What US destinations could you reach from Heathrow, or where could you fly from San Francisco? When exactly did Pan Am vanish, or TWA? And when did 747s stop ruling the skies?
Exposing the database - along with some support tables to demystify the carrier acronyms and non-standard government-assigned aircraft type IDs - was pretty easy thanks to Datasette, Simon Willison's project to make exploring data a bit more approachable. To answer just one of the questions above - 747s were common on LHR-JFK, but there were also plenty of 767s, a smattering of DC-10s and even Lockheed L-1011 tri-jets, and of course, Concorde.
For the others, I ended up with a bunch of saved queries. These let me pick from the top US airports (sorted by passenger, seats, departures, or freight); view the destinations from each, over time; view details of a flight pair (like San Francisco to Heathrow); and then look in more detail at just that one route for a year.
If you're interested in exploring this stuff yourself, I've thrown up a quick repo on GitHub. It'll install datasette, datasette-plot, and contains instructions on downloading the data to populate the SQLite database (since I didn't want to upload 497MB). Good luck, and enjoy.