{ "info": { "author": "Leo Terray", "author_email": "leoterray@yahoo.com.au", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Programming Language :: Python :: 3.6" ], "description": "# Public Transport Victoria (PTV) Python API Wrapper\nPython3 API Wrapper for Public Transport Victoria (https://www.ptv.vic.gov.au/)\n\nFor the full API Documentation as well as information on how to request an API key, check out PTV [Documentation](https://www.ptv.vic.gov.au/footer/data-and-reporting/datasets/ptv-timetable-api/) and [Swagger](http://timetableapi.ptv.vic.gov.au/swagger/ui/index)\n\n## Installation\n```\n$ pip install ptv-python-wrapper\n```\n\n## Usage\nInstantiate client by passing in Developer ID and API Key from PTV\n```\nfrom ptv.client import PTVClient\n\nclient = PTVClient(DEV_ID, API_KEY)\n```\n\n### Get Departures from Stop\nView departures from a stop\n```\nParameters\n----------\nroute_type : integer\n Number identifying transport mode; values returned via RouteTypes API\nstop_id : integer\n Identifier of stop; values returned by Stops API\n\nOptional Parameters\n-------------------\nroute_id : string\n Identifier of route; values returned by RoutesAPI - v3/routes\nplatform_numbers : Array[integer]\n Filter by platform number at stop\ndirection_id : integer\n Filter by indentifier of direction of travel; values returned by Directions Api - /v3/directions/route/{route_id}\nlook_backwards : boolean\n Indicates if filtering runs (and their departures) to those that arrive at destination before date_utc (default = false). Requires max_results > 0.\ngtfs : boolean\n Indicates that stop_id parameter will accept \"GTFS stop_id\" data\ndate_utc : string\n Filter by the date and time of the request (ISO 8601 UTC format) (default = current date and time)\nmax_results : integer\n Maximum number of results returned\ninclude_cancelled : boolean\n Indicates if cancelled services (if they exist) are returned (default = false) - metropolitan train only\nexpand : Array[string]\n List objects to be returned in full (i.e. expanded) - options include: all, stop, route, run, direction, disruption\n\nReturns\n-------\nDepartures : dict\n Dictionary of departures\n```\nExample:\n```\nclient.get_departure_from_stop(0, 1071)\n```\n\n### Get Directions for Route\nView directions for route\n```\nParameters\n----------\nroute_id : int\n Identifier of route; values returned by Routes API - v3/routes\n \nOptional Parameters\n-------------------\nroute_type : int\n Number identifying transport mode; values returned via RouteTypes API\n\nReturns\n-------\nDirections : dict\n Dictionary of directions\n```\nExample:\n```\nclient.get_directions_for_route(1)\n```\n\n### Get Route for Direction\nView Routes for Direction\n```\nParameters\n----------\ndirection_id : int\n Identifier of direction of travel; values returned by Directions API - /v3/directions/route/{route_id}\n\nReturns\n-------\nRoutes : dict\n All routes that travel in the specified direction.\n```\nExample:\n```\nclient.get_route_for_direction(1)\n```\n\n### Get Disruptions\nView all disruptions\n```\nOptional Parameters\n-------------------\nroute_id : int\n Identifier of route; values returned by Routes API - v3/routes\nstop_id : int \t\n Identifier of stop; values returned by Stops API - v3/stops\ndisruption_status : str\n Filter by status of disruption\n\nReturns\n-------\ndisruptions : dict\n All disruption information (if any exists).\n```\nExample\n```\nclient.get_disruptions()\n```\n\n### View a specific disruption\nView a specific disruption\n```\nParameters\n----------\ndisruption_id : int\n Identifier of disruption; values returned by Disruptions API - /v3/disruptions OR /v3/disruptions/route/{route_id}\n\nReturns\n-------\ndisruptions : dict\n Disruption information for the specified disruption ID.\n```\nExample\n```\nclient.get_disruption(12345)\n```\n\n### Get all disruption modes\nGet all disruption modes\n```\nReturns\n-------\nmodes : dict\n Disruption specific modes\n```\nExample\n```\nclient.get_disruption_modes()\n```\n\n### List ticket outlets\nList ticket outlets\n```\nOptional Parameters\n-------------------\nlatitude : int\n Geographic coordinate of latitude\nlongitude : int\n Geographic coordinate of longitude\nmax_distance : int\n Maximum number of results returned \nmax_results : int\n Maximum number of results returned (default = 30)\n\nReturns\n-------\noutlets : dict\n Ticket outlets\n```\nExample\n```\nclient.get_outlets()\n```\n\n### View the stopping pattern for a specific trip/service run\nView the stopping pattern for a specific trip/service run\n```\nParameters\n----------\nrun_id : int\n Identifier of a trip/service run; values returned by Runs API - /v3/route/{route_id} and Departures API\nroute_type : int\n Number identifying transport mode; values returned via RouteTypes API\nexpand : Array[str]\n Objects to be returned in full (i.e. expanded) - options include: all, stop, route, run, direction, disruption. By default disruptions are expanded.\n\nOptional Parameters\n-------------------\nstop_id : int\n Filter by stop_id; values returned by Stops API\ndate_utc : str\n Filter by the date and time of the request (ISO 8601 UTC format)\n\nReturns\n-------\npattern : dict\n The stopping pattern of the specified trip/service run and route type.\n```\nExample\n```\nclient.get(12345, 0, ['all'])\n```\n\n### View route names and numbers for all routes\nView route names and numbers for all routes\n```\nOptional Parameters\n-------------------\nroute_types : Array[int]\n Filter by route_type; values returned via RouteTypes API\nroute_name : str\n Filter by name of route (accepts partial route name matches)\n\nReturns\n-------\nroutes : dict\n Route names and numbers for all routes of all route types.\n```\nExample\n```\nclient.get_routes()\n```\n\n### View route name and number for specific route ID\nView route name and number for specific route ID\n```\nParameters\n----------\nroute_id : int\n Identifier of route; values returned by Departures, Directions and Disruptions APIs\n\nReturns\n-------\nroute : dict\n The route name and number for the specified route ID.\n```\nExample\n```\nclient.get_route(1)\n```\n\n### View all route types and their names\nView all route types and their names\n```\nReturns\n-------\nRouteTypes : dict\n All route types (i.e. identifiers of transport modes) and their names.\n```\nExample\n```\nclient.get_route_types()\n```\n\n### View the trip/service for a specific run ID and route type\nView the trip/service for a specific run ID and route type\n```\nParameters\n----------\nrun_id : int\n Identifier of a trip/service run; values returned by Runs API - /v3/route/{route_id} and Departures API\n\nOptional Parameters\n-------------------\nroute_type : int\n Number identifying transport mode; values returned via RouteTypes API\n\nReturns\n-------\nrun : dict\n The trip/service run details for the run ID and route type specified.\n```\nExample\n```\nclient.get_run(12345, 0)\n```\n\n### View all trip/service runs for a specific route ID\nView all trip/service runs for a specific route ID\n```\nParameters\n----------\nroute_id : int\n Identifier of route; values returned by Routes API - v3/routes.\n\nOptional Parameters\n-------------------\nroute_type : int\n Number identifying transport mode; values returned via RouteTypes API\n\nReturns\n-------\nruns : dict\n All trip/service run details for the specified route ID.\n```\nExample\n```\nclient.get_runs_for_route(1)\n```\n\n### View stops, routes and myki outlets that match the search term\nView stops, routes and myki outlets that match the search term\n```\nParameters\n----------\nsearch_term : str\n Search text (note: if search text is numeric and/or less than 3 characters, the API will only return routes)\n\nOptional Parameters\n-------------------\nroute_types : Array[int]\n Filter by route_type; values returned via RouteTypes API (note: stops and routes are ordered by route_types specified)\nlatitude : float\n Filter by geographic coordinate of latitude\nlongitude : float\n Filter by geographic coordinate of longitude\nmax_distance : float\n Filter by maximum distance (in metres) from location specified via latitude and longitude parameters\ninclude_addresses : bool\n Placeholder for future development; currently unavailable\ninclude_outlets : bool\n Indicates if outlets will be returned in response (default = true)\nmatch_stop_by_suburb : bool\n Indicates whether to find stops by suburbs in the search term (default = true)\nmatch_route_by_suburb : bool\n Indicates whether to find routes by suburbs in the search term (default = true)\nmatch_stop_by_gtfs_stop_id : bool\n Indicates whether to search for stops according to a metlink stop ID (default = false)\n\nReturns\n-------\nSearchResponse : dict\n Stops, routes and myki ticket outlets that contain the search term (note: stops and routes are ordered by route_type by default).\n```\nExample\n```\nclient.search('asdf')\n```\n\n### View facilities at a specific stop (Metro and V/Line stations only)\nView facilities at a specific stop (Metro and V/Line stations only)\n```\nParameters\n----------\nstop_id : int\n Identifier of stop; values returned by Stops API\nroute_type : int\n Number identifying transport mode; values returned via RouteTypes API\n\nOptional Parameters\n-------------------\nstop_location : bool\n Indicates if stop location information will be returned (default = false)\nstop_amenities : bool \n Indicates if stop amenity information will be returned (default = false)\nstop_accessibility : bool\n Indicates if stop accessibility information will be returned (default = false)\nstop_contact : bool\n Indicates if stop contact information will be returned (default = false)\nstop_ticket : bool\n Indicates if stop ticket information will be returned (default = false)\ngtfs : bool\n Incdicates whether the stop_id is a GTFS ID or not\nstop_staffing : bool\n Indicates if stop staffing information will be returned (default = false)\nstop_disruptions : bool\n Indicates if stop disruption information will be returned (default = false)\n\nReturns\n-------\nStop : dict\n Stop location, amenity and accessibility facility information for the specified stop (metropolitan and V/Line stations only).\n```\nExample\n```\nclient.get_stop(1071, 0)\n```\n\n### View all stops on a specific route\nView all stops on a specific route\n```\nParameters\n----------\nroute_id : int\n Identifier of route; values returned by Routes API - v3/routes\nroute_type : int\n Number identifying transport mode; values returned via RouteTypes API\n\nOptional Parameters\n-------------------\ndirection_id : int\n An optional direction; values returned by Directions API. When this is set, stop sequence information is returned in the response.\nstop_disruptions : bool\n Indicates if stop disruption information will be returned (default = false)\n\nReturns\n-------\nstops : dict\n All stops on the specified route.\n```\nExample\n```\nclient.get_stops_for_route(1, 0)\n```\n\n### View all stops near a specific location\nView all stops near a specific location\n```\nParameters\n----------\nlatitude : float\n Geographic coordinate of latitude\nlongitude : float\n Geographic coordinate of longitude\n\nOptional Parameters\n-------------------\nroute_types : Array[int]\n Filter by route_type; values returned via RouteTypes API\nmax_results : int\n Maximum number of results returned (default = 30)\nmax_distance : double \n Filter by maximum distance (in metres) from location specified via latitude and longitude parameters (default = 300)\nstop_disruptions : bool\n Indicates if stop disruption information will be returned (default = false)\n\nReturns\n-------\nstops : dict\n All stops near the specified location.\n```\nExample\n```\nclient.get_stops_for_location(123,123)\n```\n\n## Contribution\nIf you've found a bug or would like a new feature, please open an issue or create a pull request.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/lucky962/ptv-python-wrapper", "keywords": "ptv,melbourne,victoria,public transport", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "ptv-python-wrapper", "package_url": "https://pypi.org/project/ptv-python-wrapper/", "platform": "", "project_url": "https://pypi.org/project/ptv-python-wrapper/", "project_urls": { "Homepage": "https://github.com/lucky962/ptv-python-wrapper" }, "release_url": "https://pypi.org/project/ptv-python-wrapper/0.2.0/", "requires_dist": null, "requires_python": ">=3.6", "summary": "An API Wrapper for Public Transport Victoria (PTV)", "version": "0.2.0" }, "last_serial": 5801171, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "f0be39586612d00650baf0c1bb4bc12f", "sha256": "830217ec2a20e7c53d9c26398aa5363cee45f7ed9b3237fd2e228b6d9f9bb03e" }, "downloads": -1, "filename": "ptv_python_wrapper-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "f0be39586612d00650baf0c1bb4bc12f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 10271, "upload_time": "2019-06-25T13:01:21", "url": "https://files.pythonhosted.org/packages/b9/ac/76d93977876f6e99ba015e394bc3f62ea030e0860a33bd7240dc760b09ea/ptv_python_wrapper-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c378ee9d411fa1ba706e35bdb902619f", "sha256": "aa56bc4ad2d30bbb9299f466d0b323acd97f057da0a4bbb03028e0818c14c837" }, "downloads": -1, "filename": "ptv-python-wrapper-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c378ee9d411fa1ba706e35bdb902619f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 10025, "upload_time": "2019-06-25T13:01:25", "url": "https://files.pythonhosted.org/packages/5d/b5/ff56d753f2e467b6a37851fe68b3438b989ef76b3343fa9a1c7c9f7aefa8/ptv-python-wrapper-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "6e66708aee6cc6d9d4804ee1d1b93775", "sha256": "1e17ab78805786664b9fc884cc9e687c67254b493026938e70baad8dcc422583" }, "downloads": -1, "filename": "ptv_python_wrapper-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "6e66708aee6cc6d9d4804ee1d1b93775", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 9891, "upload_time": "2019-07-26T04:45:27", "url": "https://files.pythonhosted.org/packages/36/65/af675592412170bd8441a4b320b14e1a4fa439608e4516c6487f4254907f/ptv_python_wrapper-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a7b81b9048e4dc4b32a88dc5993f93db", "sha256": "5d65994cbfaff277b961b87d4f6aa3738c4564f1cfc7ecb55c06e273a4fc8ff4" }, "downloads": -1, "filename": "ptv-python-wrapper-0.1.1.tar.gz", "has_sig": false, "md5_digest": "a7b81b9048e4dc4b32a88dc5993f93db", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 9025, "upload_time": "2019-07-26T04:45:30", "url": "https://files.pythonhosted.org/packages/80/55/2c2531aa3b5142742b1a14a5460b9728a6234e5aa037dcf030ecfa826cda/ptv-python-wrapper-0.1.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "3853b6ad2ee4abe151ab43de5d65688e", "sha256": "9dd2f66b4837d3c93d68abd59a0358d63c4e0534895dc7a4912480a9c975a784" }, "downloads": -1, "filename": "ptv-python-wrapper-0.2.0.tar.gz", "has_sig": false, "md5_digest": "3853b6ad2ee4abe151ab43de5d65688e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 9086, "upload_time": "2019-09-09T01:02:25", "url": "https://files.pythonhosted.org/packages/e3/1e/018207ebdeff1f2ac15ab442f2cd9aea6a2d17da7ff5f180bcafe2dacb50/ptv-python-wrapper-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3853b6ad2ee4abe151ab43de5d65688e", "sha256": "9dd2f66b4837d3c93d68abd59a0358d63c4e0534895dc7a4912480a9c975a784" }, "downloads": -1, "filename": "ptv-python-wrapper-0.2.0.tar.gz", "has_sig": false, "md5_digest": "3853b6ad2ee4abe151ab43de5d65688e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 9086, "upload_time": "2019-09-09T01:02:25", "url": "https://files.pythonhosted.org/packages/e3/1e/018207ebdeff1f2ac15ab442f2cd9aea6a2d17da7ff5f180bcafe2dacb50/ptv-python-wrapper-0.2.0.tar.gz" } ] }