{ "info": { "author": "kiliankoe", "author_email": "me@kilian.io", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "dvbpy\n-----\n\nAn unofficial python module giving you a few options to query a\ncollection of publicly accessible API methods for Dresden's public\ntransport system.\n\nIn case you're looking for something like this for node.js, check out\n`dvbjs `__. Or Swift?\nSee `DVB `__.\n\nThe documentation is located `here `__.\n\nGet dvbpy from PyPi :)\n\n.. code:: shell\n\n pip install dvbpy\n\nAnd then just import it.\n\n.. code:: python\n\n import dvb\n\n\nMonitor a single stop\n~~~~~~~~~~~~~~~~~~~~~\n\nMonitor a single stop to see every bus or tram leaving this stop after\nthe specified time offset.\n\n.. code:: python\n\n import dvb\n\n stop = 'Helmholtzstra\u00dfe'\n time_offset = 0 # how many minutes in the future, 0 for now\n num_results = 2\n city = 'Dresden'\n\n dvb.monitor(stop, time_offset, num_results, city)\n\n.. code:: python\n\n [{\n 'line': '85',\n 'direction': 'Striesen',\n 'arrival': 5\n },\n {\n 'line': '85',\n 'direction': 'L\u00f6btau S\u00fcd',\n 'arrival': 7\n }]\n\nYou can also call ``monitor()`` without city, num\\_results or\ntime\\_offset. City will default to Dresden.\n\nFind routes\n~~~~~~~~~~~\n\nQuery the server for possible routes from one stop to another. Returns\nmultiple possible trips, the bus-/tramlines to be taken, the single\nstops, their arrival and departure times and their GPS coordinates.\n\n.. code:: python\n\n import dvb\n import time\n\n origin = 'Zellescher Weg'\n city_origin = 'Dresden'\n destination = 'Postplatz'\n city_destination = 'Dresden'\n time = int(time.time()) # a unix timestamp is wanted here\n deparr = 'dep' # set to 'arr' for arrival time, 'dep' for departure time\n\n dvb.route(origin, destination, city_origin, city_destination, time, deparr)\n\n.. code:: python\n\n {\n 'trips': [{\n 'interchange': 0,\n 'nodes': [{\n 'line': '11',\n 'mode': 'Stra\u00dfenbahn',\n 'direction': 'Dresden B\u00fchlau Ullersdorfer Platz',\n 'path': [\n [13.745754, 51.02816],\n [13.745848, 51.028393],\n ...\n ],\n 'departure': {\n 'time': '18:01',\n 'stop': 'Zellescher Weg',\n 'coords': '13745754,51028160'\n },\n 'arrival': {\n 'time': '18:14',\n 'stop': 'Postplatz',\n 'coords': '13733717,51050544'\n }\n }],\n 'duration': '00:13',\n 'departure': '18:01',\n 'arrival': '18:14'\n },\n ...\n }],\n 'origin': 'Dresden, Zellescher Weg',\n 'destination': 'Dresden, Postplatz'\n }\n\nEverything besides origin and destination is optional and only needs to\nbe included if necessary. City for origin and destination defaults to\nDresden, time to now and is handled as the departure time.\n\nThe path property contains a list consisting of all the coordinates\ndescribing the path of this node. Useful for example if you want to draw\nit on a map.\n\nFind stops by name\n~~~~~~~~~~~~~~~~~~\n\nSearch for a single stop in the network of the DVB.\n\n.. code:: python\n\n import dvb\n\n dvb.find('zellesch')\n\n.. code:: python\n\n [{\n 'name': 'Zellescher Weg',\n 'city': 'Dresden',\n 'coords': [51.028366, 13.745847]\n }]\n\nThe fields ``city`` and ``coords`` are optional as they are not\navailable for every stop. So don't forget to check for their existence\nfirst.\n\n.. code:: python\n\n [stop for stop in dvb.find('Post') if 'city' in stop if stop['city'] == 'Dresden']\n\nFind other POIs with coordinates\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nSearch for all kinds of POIs inside a given square.\n\n.. code:: python\n\n import dvb\n\n southwest_lat = 51.04120\n southwest_lng = 13.70106\n northeast_lat = 51.04615\n northeast_lng = 13.71368\n\n pintypes = 'stop'\n # can be poi, platform, rentabike, ticketmachine, parkandride, carsharing or stop\n\n dvb.pins(southwest_lat, southwest_lng, northeast_lat, northeast_lng, pintypes)\n\n``pintypes`` defaults to 'stop' if no other input is given.\n\n.. code:: python\n\n [\n {\n \"connections\":\"1:7~8~9~10~11~12\",\n \"coords\":{\n \"lat\":51.04373256804444,\n \"lng\":13.70625638110702\n },\n \"id\":33000143,\n \"name\":\"Saxoniastra\u00dfe\"\n },\n {\n \"connections\":\"2:61~90\",\n \"coords\":{\n \"lat\":51.04159705545878,\n \"lng\":13.7053650905211\n },\n \"id\":33000700,\n \"name\":\"Ebertplatz\"\n },\n {\n \"connections\":\"1:6~7~8~9~10~11~12#2:61~63~90~A#3:333\",\n \"coords\":{\n \"lat\":51.04372841952444,\n \"lng\":13.703461228676069\n },\n \"id\":33000144,\n \"name\":\"Tharandter Stra\u00dfe\"\n }, ...\n ]\n\nLook up coordinates for POI\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nFind the coordinates for a given POI id.\n\n.. code:: python\n\n import dvb\n\n dvb.poi_coords(33000755)\n\n.. code:: python\n\n {'lat': 51.018745307424005, 'lng': 13.758700156062707}\n\nAddress for coordinates - WIP\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nLook up the address for a given set of coordinates.\n\n.. code:: python\n\n import dvb\n\n lat = 51.04373\n lng = 13.70320\n\n dvb.address(lat, lng)\n\n.. code:: python\n\n {\n 'city': u'Dresden',\n 'address': u'Kesselsdorfer Stra\u00dfe 1'\n }\n\nOther stuff\n~~~~~~~~~~~\n\nStop names in queries are very forgiving. As long as the server sees it\nas a unique hit, it'll work. 'Helmholtzstra\u00dfe' finds the same data as\n'helmholtzstrasse', 'N\u00fcrnberger Platz' = 'nuernbergerplatz' etc.\n\nOne last note, be sure not to run whatever it is you're building from\ninside the network of the TU Dresden. Calls to ``dvb.route()`` and\n``dvb.find()`` will time out. This is unfortunately expected behavior as\nAPI calls from these IP ranges are blocked.", "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/kiliankoe/dvbpy", "keywords": "dvb vvo tram bus public transport dresden", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "dvb", "package_url": "https://pypi.org/project/dvb/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/dvb/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/kiliankoe/dvbpy" }, "release_url": "https://pypi.org/project/dvb/1.2/", "requires_dist": null, "requires_python": null, "summary": "query Dresden's public transport system for current bus- and tramstop data in python", "version": "1.2" }, "last_serial": 2242400, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "8e9abe2a927a6e6ba0d05d937ca5dedb", "sha256": "21868940f7ad12d07f03697522a6e25c9c46af3378815207fb4c300946812f6e" }, "downloads": -1, "filename": "dvb-1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "8e9abe2a927a6e6ba0d05d937ca5dedb", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 9502, "upload_time": "2016-05-09T09:12:34", "url": "https://files.pythonhosted.org/packages/23/77/de733f3097f1fbc87554bce71d9e7cba718607da92192a391c307eda5926/dvb-1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0923a9d9c388ebf7c6387b96046f0bef", "sha256": "bef73ee9b421328df58da497b6567c77f09ff8dda8ed10de68051a4ced279875" }, "downloads": -1, "filename": "dvb-1.0.tar.gz", "has_sig": false, "md5_digest": "0923a9d9c388ebf7c6387b96046f0bef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6551, "upload_time": "2016-05-09T09:12:11", "url": "https://files.pythonhosted.org/packages/aa/8b/6966d2ea7ef0f2a937fae52b931a1fcf96ebc310f7cc3ce6ba989bfaca1f/dvb-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "e1313cb955bff04d4661ea6f2a5b33b9", "sha256": "965070984db33f5838fce5bd95b474530466dbcb04ade1ed6db0504879702ca7" }, "downloads": -1, "filename": "dvb-1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "e1313cb955bff04d4661ea6f2a5b33b9", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 9338, "upload_time": "2016-05-09T12:37:59", "url": "https://files.pythonhosted.org/packages/53/f0/1644b4f8760fe7f2418fb907457c778f3b10725ea6e1778f1d66018a2e84/dvb-1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "56b1ca1f5409eaf80ccf50612d20e010", "sha256": "8bbdeb72725b8e84c65724951ba7ee0640a793d536cfe1a0ea5db4455159bf36" }, "downloads": -1, "filename": "dvb-1.1.tar.gz", "has_sig": false, "md5_digest": "56b1ca1f5409eaf80ccf50612d20e010", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6492, "upload_time": "2016-05-09T12:37:54", "url": "https://files.pythonhosted.org/packages/b5/b3/6480c7604f283ea5b66323d9228e03eae66a2cfd1e656f883d46d38c4516/dvb-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "a76d061706dbdcb8918f504198d76100", "sha256": "30e4ed2f7bc3deb9b7d712582b2445a3a4d6cf1b7698e1ec09566f7bfc8672ec" }, "downloads": -1, "filename": "dvb-1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a76d061706dbdcb8918f504198d76100", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 9918, "upload_time": "2016-07-25T13:30:22", "url": "https://files.pythonhosted.org/packages/80/3f/c4578491c86c3f812df2ebb02b4b4b57552e8b71965b9b85ca9cd20578f4/dvb-1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4136f0ea7f5bb0e03b50f19593f09862", "sha256": "95cfd8f22a831417561aad5edb8a62f33478372a4c50381d7f200d8ed699ce02" }, "downloads": -1, "filename": "dvb-1.2.tar.gz", "has_sig": false, "md5_digest": "4136f0ea7f5bb0e03b50f19593f09862", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6915, "upload_time": "2016-07-25T13:30:19", "url": "https://files.pythonhosted.org/packages/19/d7/ad06a1fcc4d1000e02946e39ae8a8759598d2b435a73b6f4c4eda2df14ec/dvb-1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a76d061706dbdcb8918f504198d76100", "sha256": "30e4ed2f7bc3deb9b7d712582b2445a3a4d6cf1b7698e1ec09566f7bfc8672ec" }, "downloads": -1, "filename": "dvb-1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "a76d061706dbdcb8918f504198d76100", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 9918, "upload_time": "2016-07-25T13:30:22", "url": "https://files.pythonhosted.org/packages/80/3f/c4578491c86c3f812df2ebb02b4b4b57552e8b71965b9b85ca9cd20578f4/dvb-1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4136f0ea7f5bb0e03b50f19593f09862", "sha256": "95cfd8f22a831417561aad5edb8a62f33478372a4c50381d7f200d8ed699ce02" }, "downloads": -1, "filename": "dvb-1.2.tar.gz", "has_sig": false, "md5_digest": "4136f0ea7f5bb0e03b50f19593f09862", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6915, "upload_time": "2016-07-25T13:30:19", "url": "https://files.pythonhosted.org/packages/19/d7/ad06a1fcc4d1000e02946e39ae8a8759598d2b435a73b6f4c4eda2df14ec/dvb-1.2.tar.gz" } ] }