{"id":22968158,"url":"https://github.com/anurag1101/train_reservation","last_synced_at":"2025-04-02T05:21:36.431Z","repository":{"id":267652685,"uuid":"866608119","full_name":"Anurag1101/Train_Reservation","owner":"Anurag1101","description":"A Python-based Train Reservation System that simulates ticket booking, allowing users to input passenger details and receive a confirmed berth, coach number, and fare based on the selected coach type (AC, Sleeper, or Unreserved). The application features a simple command-line interface and random berth assignments, making it an excellent resource.","archived":false,"fork":false,"pushed_at":"2025-02-04T14:42:19.000Z","size":75,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-04T15:36:10.620Z","etag":null,"topics":["class","methods","objects","oops-in-python","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Anurag1101.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-02T15:03:37.000Z","updated_at":"2025-02-04T14:42:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"16bb44aa-453c-4663-89ee-bd94aee8d18b","html_url":"https://github.com/Anurag1101/Train_Reservation","commit_stats":null,"previous_names":["anurag1101/train_reservation"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anurag1101%2FTrain_Reservation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anurag1101%2FTrain_Reservation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anurag1101%2FTrain_Reservation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anurag1101%2FTrain_Reservation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Anurag1101","download_url":"https://codeload.github.com/Anurag1101/Train_Reservation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246759500,"owners_count":20829109,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["class","methods","objects","oops-in-python","python","python3"],"created_at":"2024-12-14T21:16:26.320Z","updated_at":"2025-04-02T05:21:36.414Z","avatar_url":"https://github.com/Anurag1101.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Train Reservation System\n\n## Overview\nThis Python-based Train Reservation System allows users to simulate booking train tickets. The program asks for passenger details, such as name, age, gender, source and destination stations, and coach type (AC, Sleeper, or Unreserved). It then provides a confirmed berth, coach number, and calculates the fare based on the coach type.\n\n## Features\n- Simulates ticket booking with user inputs.\n- Provides random berth and coach number assignments.\n- Calculates fare based on the type of coach (AC, Sleeper, or Unreserved).\n- Includes a greeting message from Indian Railways.\n- Static methods to display welcome and farewell messages.\n\n## How to Use\n**Clone the repository**:\ngit clone https://github.com/Anurag1101/Train_Reservation.git\n\nNavigate to the project directory:\ncd Train_Reservation\n\n**Run the program:** Run the Python script in your terminal or Python environment:\npython train_reservation.py\n\n**User Inputs:** The program will prompt you to enter the following information:\n\n    Train Number\n    Passenger Name\n    Passenger Age\n    Passenger Gender (M/F)\n    Source Station\n    Destination Station\n    Coach Type (AC, SL, Unreserved)**\n\n**Example Output:**\n\n  Welcome to Indian Railways\n  Ticket booked for Anurag 25M in Train no 1101 from Mumbai to Delhi.\n  Your berth no is 42 and Coach no is A3.\n  The fare of your journey is ₹1500.\n  Indian Railway wishes you a Happy and Safe journey.\n\n**Code Structure**:\n\n    **Train Class** : This class represents a train ticket booking system.\n    \n    __init__: Initializes passenger details (train number, name, age, gender, etc.).\n    \n    **book()**: Books a ticket for the passenger.\n    \n    **berth_and_fare()**: Assigns a random berth, coach number, and calculates the fare.\n    \n    **greet() \u0026 greet1()**: Static methods to display welcome and farewell messages.\n\n**Future Enhancements**:\n\nImplement an actual fare calculator based on distance.\n\nAdd more details such as seat preferences (Window, Middle, Aisle).\n\nInclude error handling for invalid inputs.\n\nImprove the user interface with a graphical or web-based version.\n\n**Requirements:**\n\nPython 3.x\n\nrandom module (standard library)\n\n**License**:\n\nThis project is licensed under the MIT License. See the LICENSE file for details.\n\n**Author**:\n\n**Anurag Tiwari**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanurag1101%2Ftrain_reservation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanurag1101%2Ftrain_reservation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanurag1101%2Ftrain_reservation/lists"}