FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

siddht2/pnrapi-python: A Python web-scraper for Indian Railways' PNR Status. · GitHub

 
 

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

pnrapi-python

A Python web-scraper for Indian Railways' PNR Status.

Requirements

  • Beautiful Soup 4
    • pip install beautifulsoup4 or easy_install beautifulsoup4
  • Requests
    • pip install requests or easy_install requests

Sample Request

import pnrapi
p = pnrapi.PNRAPI("1234567890") #10-digit PNR Number
if p.request() == True:
	response = p.get_json()
	print response
else:
	print "Service unavailable"

Sample Response

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.

About

A Python web-scraper for Indian Railways' PNR Status.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages


Back | FazBrowse Home | New Git URL