{ "info": { "author": "Patrick Carey", "author_email": "paddy@wackwack.co.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7" ], "description": "===============================\nOpenTranslink\n===============================\n\n\nThe OpenTranslink project aims to provide a simple pythonic interface to public data on translink.co.uk e.g. timetables\n\n* Free software: MIT license\n* Documentation: http://github.com/paddycarey/opentranslink.\n\nFeatures\n~~~~~~~~\n\n* Route/Service listings\n* Bus Timetables\n\nFuture Features\n~~~~~~~~~~~~~~~\n\n* A better/nicer API.\n* Train timetables\n* Train status\n* Journey Planner\n* Route Maps\n\n\nUsage\n-----\n\nGetting started\n~~~~~~~~~~~~~~~\n\nOnce the library's a bit more mature, it'll be installable from pypi, but for now, just clone repo repo and run `python setup.py install`.\n\nThe top-level object in opentranslink (for now) is the `Service`, you should initialise the service you need after importing the module::\n\n import opentranslink\n\n # initialise a client for each available service\n goldline = opentranslink.Service('goldline')\n metro = opentranslink.Service('metro')\n ulsterbus = opentranslink.Service('ulsterbus')\n\nRetrieving route listings\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\nYou can retrieve a full list of routes for a given service using its `route()` method::\n\n >>> print metro.routes()\n [, , , ...]\n\nYou can also retrieve a specific route using its code::\n\n >>> print metro.route('1A')\n \n\nWorking with timetables\n~~~~~~~~~~~~~~~~~~~~~~~\n\nRoute objects contain a `timetable` property which is used to interact with any available timetable for the route::\n\n >>> route = goldline.route('273')\n >>> print route.timetable\n [\n (u'Mondays to Fridays', ),\n (u'Saturdays', ),\n (u'Sundays', ),\n (u'Mondays to Fridays', ),\n (u'Saturdays', ),\n (u'Sundays', )\n ]\n\n`timetable` returns a list of tuples. Each tuple returned contains a label for the corresponding dataset (better labels will be added soon, including inbound/outbound direction). the dataset objects shown are tablib.Dataset objects, you can read more about these in the `tablib documentation `_\n\nInteracting with the dataset objects is simple::\n\n >>> dataset = route.timetable[0][1]\n\n >>> # show list of stops on this route\n >>> print dataset.headers\n [u'Belfast City Centre, Europa Buscentre', u'Lurgan, Loughview Park and Ride Lough Road', ...]\n\n >>> # show the timetable for the fifth bus of the day\n >>> print zip(dataset.headers, dataset[4])\n [(u'Belfast City Centre, Europa Buscentre', u'0835'), (u'Lurgan, Loughview Park and Ride Lough Road', u'0900'), ...]\n\nYou can dump the timetable to a whole host of formats using tablib's export features::\n\n >>> print dataset.json\n >>> print dataset.csv\n >>> print dataset.yaml\n >>> print dataset.xls\n\n\nReporting Bugs\n~~~~~~~~~~~~~~\n\nReport bugs (there are lots, I know) at https://github.com/paddycarey/opentranslink/issues.\n\nIf you are reporting a bug, please include:\n\n* Your operating system name and version.\n* Any details about your local setup that might be helpful in troubleshooting.\n* Detailed steps to reproduce the bug.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/paddycarey/opentranslink", "keywords": "opentranslink", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "opentranslink", "package_url": "https://pypi.org/project/opentranslink/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/opentranslink/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/paddycarey/opentranslink" }, "release_url": "https://pypi.org/project/opentranslink/0.0.1/", "requires_dist": null, "requires_python": null, "summary": "The OpenTranslink project aims to provide a simple pythonic interface to public data on translink.co.uk e.g. timetables", "version": "0.0.1" }, "last_serial": 1035677, "releases": { "0.0.1": [] }, "urls": [] }