Introduction to Research Software Engineering with Python: London Tube Information
Disclaimer
The information provided by this service uses data from 2017, so does not necessarily reflect the current state of the London Underground. Tube enthusiasts be warned that some stations (and possibly line-links) might be missing!
Overview
The London underground ("tube") is a transport network that runs across Greater London. This web service is designed to imitate an service that allows the public to retrieve information about the setup and layout of the tube network, as well as check for any disruptions to journeys they might want to undertake.
For the purposes of this service, the London underground ("tube") network is divided up into twelve lines, with a total of 296 stations.
Each line is given a unique index so that it can be identified by the backend API of the web service; line indices run from 0
through to 11
(inclusive) and the corresponding names of the lines is listed on the line networks page.
The stations are also each given a unique index between 0
and 295
(inclusive), again used to identify and interact with the information the web service stores in the backend.
You can read more about the services that can be queried below.
General Information
You can retrieve a json
file containing:
- The number of stations in the network,
- The number of lines the London tube network is divided up into,
- The correspondence between the names of the underground lines and their indices (see the table on the line networks page for more information)
by querying the index/query
service (at the https://rse-with-python.arc.ucl.ac.uk/londontube-service/index/query
address).
This query does not take any keywords, and returns a json
file in the following format:
"n_stations" = 296,
"n_lines" = 12,
"lines" = {
0 : "line_0_name",
1 : "line_1_name",
...
}
Line Networks
The layout of the tube network is publicly available for the public and other third-parties to view and download, and this information is offered by the Line Networks service. This service provides information about which connections (between stations) belong to which line in the network.
Station Information
The stations in the network each have a name, however the primary piece of information attached to each station is its unique station index. The information provided by the other services identifies stations by this index. As such, the purpose of the Station Information service is to be able to translate between the station indices and their names. The service also provides information about the (physical) location of the stations, by providing latitude/longitude coordinates.
Disruption Events
The tube network undergoes continual maintenance and is subject to a number of delays and alterations due to changing demand of any particular day. When disruptions are known in advance, they can be fetched using this service so passengers can plan an alternative journey ahead of time. On the day of travel, additional unplanned disruptions may come to light, which this service also lists. The service also keeps an archive of disruptions that occurred in the past.