Trackernet and the NaPTAN

Published on

At work I’ve been playing around with the TfL TrackerNet API to add real-time tube departure information to the Molly Project, in a similar way to how we provide real-time bus information from Oxontime.

The biggest problem I came across was the fact there’s no mapping (at least, I couldn’t find one – someone may now comment and show me I wasted an hour of work this afternoon) between the NaPTAN and the station and line codes that TrackerNet wants for its detailed predication API. So I had to go make one.

So if anyone wants a prepopulated Python dictionary mapping ATCO identifiers to lists of tuples of line codes and station codes, save yourself some pain and just use the one I just made (under the Academic Free License):