Interface to Indian Railways(part 1)
Note: You can find the code backing this demo here and the part 2 here.
I hate the official website of
Indian Railways and I thought it would be
fun to know more about trains through an interface which is not
an absolute trainwreck. Here is my humble attempt towards that lofty goal, all aboard the (not so) crazy
train
(of thought):
Find station by name
We know the name of the station and want to find its station code:
import train_of_thought as tot
tot.find_station_by_name("mumbai")
Partial names work too:
tot.find_station_by_name("mum")
Find information about a particular station
Now that we know the station code, we can find more information about the corresponding station:
tot.code_info("CSTM")
We can see the station on an interactive map(we can zoom in or out and click on the marker to know more about the location it represents):
tot.find_station_on_map("CSTM")
We can zoom in and see the station and the railway tracks:
tot.find_station_on_map("CSTM", zoom_start_pioneer = 16)
Find nearby stations
We can also find all the nearby stations:
tot.find_nearby_stations_on_map("CSTM")
Find train by name
We know the (partial) name of the train and want to find its number:
tot.find_train_by_name("shan")
Find information about a particular train
Now that we know the train number, we can find more information about the corresponding train:
tot.get_train_info(12155)
We can also find its route:
tot.get_train_route(12155)
We can also see the train route on an interactive map:
tot.see_train_route(12155)
We can also see its live running status:
tot.see_live_train_status(12155, "11-08-2017")