{ "info": { "author": "Nikhil Kumar Singh", "author_email": "nikhilksingh97@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "|PyPI| |license|\n\npyinrail\n========\n\nA python wrapper for Indian Railways Enquiry API!\n\n- Get trains between stations\n- Get seat availability\n- Get train fare\n- Get train schedule\n- Get train live running status\n- Get PNR status\n\n...and much more!\n\n**Note:** This is not an official package and using it for commercial\npurposes is not recommended.\n\nInstallation\n------------\n\nTo install pyinrail, simply,\n\n::\n\n $ pip install pyinrail\n\nYou will also need to install tesseract-ocr. Find instructions to\ninstall tesseract-ocr\n`here `__.\n\nUsage\n-----\n\n- Importing pyinrail\n\n.. code:: python\n\n from pyinrail import pyinrail\n\n- Create **RailwayEnquiry** object\n\n .. code:: python\n\n enq = pyinrail.RailwayEnquiry(src='new delhi', dest='ahmedabad', date='12-05-2018')\n\n- Get trains between stations\n\n.. code:: python\n\n df = enq.get_trains_between_stations(as_df=True)\n print(df)\n\n::\n\n trainName trainNumber fromStnCode toStnCode departureTime arrivalTime duration distance avlClasses\n 0 ADI SJ RAJDHANI 12958 NDLS ADI 19:55 09:40 13:45 935 [1A, 2A, 3A]\n 1 GUJRAT S KRANTI 12918 NZM ADI 13:55 06:10 16:15 1085 [2A, 3A, SL]\n 2 ASHRAM EXPRESS 12916 DLI ADI 15:20 07:40 16:20 934 [1A, 2A, 3A, SL]\n 3 ALA HAZRAT EXP 14311 DLI ADI 11:45 06:15 18:30 933 [2A, 3A, SL]\n 4 YOGA EXPRESS 19032 DSA ADI 21:26 17:10 19:44 963 [1A, 2A, 3A, SL]\n 5 DEE BDTS G RATH 12215 DEE ADI 09:20 01:10 15:50 951 [3A]\n\n- Get seat availability\n\n.. code:: python\n\n df = enq.get_seat_availability(12958, classc='2A', as_df=True)\n print(df)\n\n::\n\n availablityDate availablityStatus availablityType currentBkgFlag reason reasonType waitListType\n 0 12-5-2018 TRAIN DEPARTED 8224 Y W 8224\n 1 13-5-2018 GNWL68/WL24 8224 N S 9\n 2 14-5-2018 GNWL41/WL8 8224 N S 9\n 3 15-5-2018 GNWL25/WL6 8224 N S 9\n 4 16-5-2018 GNWL33/WL14 8224 N S 9\n 5 17-5-2018 GNWL20/WL9 8224 N S 9\n\n- Get train schedule\n\n.. code:: python\n\n df = enq.get_train_schedule(12958, as_df=True)\n print(df)\n\n::\n\n stationCode stationName departureTime arrivalTime routeNumber haltTime distance dayCount stnSerialNumber\n 0 NDLS NEW DELHI 19:55 -- 1 -- 0 1 1\n 1 DEC DELHI CANTT 20:25 20:23 1 02:00 16 1 2\n 2 GGN GURGAON 20:43 20:41 1 02:00 32 1 3\n 3 JP JAIPUR 00:30 00:20 1 10:00 309 2 4\n 4 AII AJMER JN 02:29 02:25 1 04:00 443 2 5\n 5 FA FALNA 04:53 04:52 1 01:00 650 2 6\n 6 ABR ABU ROAD 06:05 06:01 1 04:00 748 2 7\n 7 PNU PALANPUR JN 07:12 07:10 1 02:00 801 2 8\n 8 MSH MAHESANA JN 08:05 08:03 1 02:00 866 2 9\n 9 SBIB SABARMATI BG 09:02 09:00 1 02:00 929 2 10\n 10 ADI AHMEDABAD JN -- 09:40 1 -- 935 2 11\n\n- Get train fare\n\n.. code:: python\n\n fare_data = enq.get_train_fare(12958, classc='2A')\n print(fare_data)\n\n::\n\n {'baseFare': 1841,\n 'cateringCharge': 225,\n 'dynamicFare': 921,\n 'fuelAmount': 0.0,\n 'goodsServiceTax': 143.0,\n 'otherCharge': 0,\n 'reservationCharge': 50,\n 'superfastCharge': 45,\n 'tatkalFare': 0,\n 'totalCollectibleAmount': 3225.0,\n 'totalConcession': 0,\n 'totalFare': 3225,\n 'travelInsuranceCharge': 0.0,\n 'travelInsuranceServiceTax': 0.0,\n 'wpServiceCharge': 0.0,\n 'wpServiceTax': 0.0}\n\n- Get train's live running status\n\n.. code:: python\n\n train_detail, instances, detailed_instances = enq.get_train_status(12958, as_df=True)\n print(train_detail)\n print(instances)\n print(detailed_instances[0])\n\n::\n\n {'dayCnt': '1',\n 'from': 'NDLS',\n 'runsOn': '1111111',\n 'schArrTime': '09:40',\n 'schDepTime': '19:55',\n 'to': 'ADI',\n 'trainName': 'ADI SJ RAJDHANI',\n 'trainNo': '12958'}\n\n\n startDate departed curStn terminated lastUpdated totalLateMins\n 0 12 May 2018 True RE False 12 May 2018 21:43 6\n 1 11 May 2018 True ADI True 12 May 2018 9:27 -14\n\n\n stnCode arr schArrTime actArr delayArr dep schDepTime actDep delayDep dayCnt schDayCnt distance\n 0 NDLS False 00:00 00:00 0 True 19:55 19:55 0 0 0 0\n 1 DEC True 20:23 20:27 4 True 20:25 20:29 4 0 0 15\n 2 GGN True 20:41 20:47 6 True 20:43 20:49 6 0 0 32\n 3 RE True 21:30 21:41 11 True 21:30 21:41 11 0 0 83\n 4 JP False 00:20 00:20 0 False 00:30 00:30 0 1 1 308\n 5 AII False 02:25 02:25 0 False 02:29 02:29 0 1 1 442\n 6 FA False 04:52 04:52 0 False 04:53 04:53 0 1 1 649\n 7 ABR False 06:01 06:01 0 False 06:05 06:05 0 1 1 747\n 8 PNU False 07:10 07:10 0 False 07:12 07:12 0 1 1 800\n 9 MSH False 08:03 08:03 0 False 08:05 08:05 0 1 1 865\n 10 SBIB False 09:00 09:00 0 False 09:02 09:02 0 1 1 927\n 11 ADI False 09:40 09:40 0 False 00:00 00:00 0 1 1 934\n\nTODOs\n-----\n\n- [ ] A command line client\n- [ ] A GUI interface\n\nWant to contribute?\n-------------------\n\n- Clone the repository\n\n ::\n\n $ git clone http://github.com/nikhilkumarsingh/pyinrail\n\n- Install dependencies\n\n ::\n\n $ pip install -r requirements.txt\n\n- To test local version of pyinrail:\n\n ::\n\n $ pip install -U .\n\n OR :\n\n ::\n\n $ pip install -e .\n\n.. |PyPI| image:: https://img.shields.io/badge/PyPi-v1.0.0-f39f37.svg\n :target: https://pypi.python.org/pypi/pyinrail\n.. |license| image:: https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000\n :target: https://github.com/nikhilkumarsingh/pyinrail/blob/master/LICENSE.txt\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/nikhilkumarsingh/pyinrail", "keywords": "indian railways enquiry api wrapper", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pyinrail", "package_url": "https://pypi.org/project/pyinrail/", "platform": "", "project_url": "https://pypi.org/project/pyinrail/", "project_urls": { "Homepage": "https://github.com/nikhilkumarsingh/pyinrail" }, "release_url": "https://pypi.org/project/pyinrail/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "Python Wrapper for Indian Railways Enquiry API", "version": "1.0.0" }, "last_serial": 3856926, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "2cba5f12f911e607498ade4c8734bba6", "sha256": "abf57e4b3e68e81388360b5a3595570ff5a1c287828a4cbcd0d163201835d5ad" }, "downloads": -1, "filename": "pyinrail-1.0.0.tar.gz", "has_sig": false, "md5_digest": "2cba5f12f911e607498ade4c8734bba6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 153114, "upload_time": "2018-05-12T16:44:58", "url": "https://files.pythonhosted.org/packages/54/9a/2bf8d0c83b55b32b9b4cb6429a26225b47d91984e0c9daeb3b529ee91c77/pyinrail-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2cba5f12f911e607498ade4c8734bba6", "sha256": "abf57e4b3e68e81388360b5a3595570ff5a1c287828a4cbcd0d163201835d5ad" }, "downloads": -1, "filename": "pyinrail-1.0.0.tar.gz", "has_sig": false, "md5_digest": "2cba5f12f911e607498ade4c8734bba6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 153114, "upload_time": "2018-05-12T16:44:58", "url": "https://files.pythonhosted.org/packages/54/9a/2bf8d0c83b55b32b9b4cb6429a26225b47d91984e0c9daeb3b529ee91c77/pyinrail-1.0.0.tar.gz" } ] }