| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A Python web-scraper for Indian Railways' PNR Status.
import pnrapi
p = pnrapi.PNRAPI("1234567890") #10-digit PNR Number
if p.request() == True:
response = p.get_json()
print response
else:
print "Service unavailable"
The reponse is a json object as follows:
{
'pnr': '1234567890',
'ticket_type': 'E - TICKET',
'train_number': '12230'
'train_name': 'LUCKNOW MAIL',
'boarding_date': '14-3-2013',
'from': 'NDLS',
'to': 'LKO',
'reserved_upto': 'LKO',
'boarding_point': 'NDLS',
'class': '3A',
'total_passengers': 1,
'charting_status': 'CHART PREPARED',
'passenger_status': [
{'booking_status': 'W/L 10,GNWL', 'current_status': 'B4 , 17'}
]
}
The passenger_status array will contain total_passengers number of elements.
| Back | FazBrowse Home | New Git URL |