This script allows you to check the status of a Passenger Name Record (PNR) for Indian Railways. It performs the following tasks:
- Accepts a 10-digit PNR number from the user.
- Encrypts the PNR number using AES CBC encryption with PKCS7 padding.
- Sends a POST request to the
https://railways.easemytrip.com/Train/PnrchkStatus
API endpoint with the encrypted PNR. - Parses the response from the API and prints the formatted PNR status information, including boarding station, destination station, quota, class name, train number, train name, date of journey, and passenger details.
- Displays the total time taken to complete the program execution.
To run this script, you need to have the following:
- Python 3.x installed on your system. You can download and install Python from the official Python website: https://www.python.org/downloads/
- Clone the repository or download the script file (
PNR_STATUS.py
). - Open a terminal or command prompt.
- Navigate to the directory where the script is located.
- Run the script using the command:
python PNR_STATUS.py
. - Follow the prompts to enter the 10-digit PNR number when prompted.
If the required packages (cryptography
and requests
) are not already installed on your system, the script will attempt to install them automatically.
Note: This automatic installation requires an internet connection and assumes that pip
is available and associated with the correct Python interpreter on your system.
If you encounter any issues with the automatic package installation, you can manually install the required packages using the following commands:
pip install cryptography requests
Author is not responsible for any losses incurrred to any individual, company or property either directly or indirectly as a result of using this script. Also, there is no warranty of any kind with this script.