{ "info": { "author": "Jonatha Daguerre", "author_email": "jonatha@daguerre.com.br", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython" ], "description": "# PyPoABus\n\n[![license](https://img.shields.io/pypi/l/pypoabus.svg)](https://pypi.python.org/pypi/pypoabus)\n[![pypi version](https://img.shields.io/pypi/v/pypoabus.svg)](https://pypi.python.org/pypi/pypoabus)\n[![python versions](https://img.shields.io/pypi/pyversions/pypoabus.svg)](https://pypi.python.org/pypi/pypoabus)\n[![Build Status](https://travis-ci.org/jonathadv/py-poa-bus.svg?branch=master)](https://travis-ci.org/jonathadv/py-poa-bus)\n\n\nModule to retrieve the bus timetables of Porto Alegre city from EPTC web site\n\n* **List bus line codes by zone: north, south, east, public (from Carris company)**\n* **Retrieve timetables by bus line**\n\n\nData source: www.eptc.com.br\n\n\n## Why this project?\n\nCurrently, Porto Alegre city hall doesn't provide an API to get the oficial information about bus timetables. This project aims to provide an interface to convert the oficial online information from EPTC web site to JSON representation.\n\n\n## Installation\n\n```\n$ pip install pypoabus\n```\nor\n```\n$ pipenv install pypoabus\n```\n* For usage as import go to [Usage](#usage).\n* To run as CMD, go to [CMD Tool](#cmd-tool).\n\n## Setup the project\nThis project uses [Pipenv](https://github.com/pypa/pipenv) as packaging tool.\n\nSo you can run:\n\n```bash\n# Installing dependencies\n$ pipenv install\n\n```\n\nRunning the same command using `make`: \n\n```bash\n# Using the Makefile\n$ make install\n\n```\n\n\n## Install as Python Module in a Virtual Env\n```bash\n$ git clone https://github.com/jonathadv/py-poa-bus.git\n$ cd py-poa-bus/\n$ pipenv install\n$ pipenv shell\n(py-poa-bus-owRTHeFi) $ ./setup.py install\n```\n\n## Usage\n\n**List bus lines**\n\n```Python\n>>> from pypoabus import pypoabus\n>>> zone = 'south'\n>>> list_bus_lines = pypoabus.list_bus_lines(zone)\n>>> for i in list_bus_lines:\n... print(i)\n... \n{\"code\": \"210-14\", \"name\": \"110 - RESTINGA NOVA VIA TRISTEZA\"}\n{\"code\": \"210-81\", \"name\": \"1101 - RESTINGA NOVA VIA TRISTEZA/DOMINGOS E FERIADOS\"}\n{\"code\": \"210-46\", \"name\": \"1102 - RESTINGA NOVA VIA TRISTEZA/BARRA SHOPPING\"}\n{\"code\": \"211-11\", \"name\": \"111 - RESTINGA VELHA (TRISTEZA)\"}\n{\"code\": \"211-12\", \"name\": \"1111 - RESTINGA VELHA(TRISTEZA)/SHOPPING\"}\n{\"code\": \"272-33\", \"name\": \"1112 - HIPICA/TRISTEZA\"}\n\n```\n\n**Get bus line timetable**\n\n```Python\n>>> from pypoabus import pypoabus\n>>> bus_line_code = '281-1'\n>>> timetable = pypoabus.get_bus_timetable(bus_line_code)\n>>> timetable.code\n'2811'\n>>> timetable.name\n'CAMPO NOVO / MORRO AGUDO'\n>>> timetable.to_json()\n'{\"code\": \"2811\", \"name\": \"CAMPO NOVO / MORRO AGUDO\", \"schedules\": [{\"direction\": \"BAIRRO/CENTRO\", \"schedule_day\": \"Dias \u00dateis\", \"timetable\": [\"05:30\", \"06:00\", \"06:30\", \"06:55\", \"07:25\", \"07:45\", \"09:00\", \"09:55\", \"10:35\", \"11:00\", \"11:35\", \"12:35\", \"13:30\", \"14:10\", \"14:40\", \"15:45\", \"16:25\", \"17:55\", \"19:10\", \"20:30\", \"21:30\", \"22:25\"]}, {\"direction\": \"BAIRRO/CENTRO\", \"schedule_day\": \"S\u00e1bados\", \"timetable\": [\"06:15\", \"06:55\", \"07:45\", \"08:30\", \"10:20\", \"11:20\", \"13:35\", \"14:25\", \"15:40\", \"16:55\", \"18:10\", \"19:25\", \"21:05\", \"22:45\"]}, {\"direction\": \"CENTRO/BAIRRO\", \"schedule_day\": \"Dias \u00dateis\", \"timetable\": [\"06:20\", \"06:50\", \"08:05\", \"08:25\", \"08:45\", \"10:00\", \"10:55\", \"11:35\", \"12:00\", \"12:35\", \"13:35\", \"14:30\", \"15:10\", \"15:40\", \"16:45\", \"17:25\", \"17:50\", \"18:45\", \"18:55\", \"20:00\", \"22:15\", \"23:10\"]}, {\"direction\": \"CENTRO/BAIRRO\", \"schedule_day\": \"S\u00e1bados\", \"timetable\": [\"07:05\", \"07:45\", \"08:35\", \"09:20\", \"10:05\", \"11:10\", \"12:10\", \"14:25\", \"15:15\", \"16:30\", \"20:15\", \"21:50\", \"23:30\"]}]}'\n>>> \n\n\n```\n\n\n## CMD Tool\n\nThis tool allows the user to access some features of PyPoaBus without to code a new module or Python script. It handles `stdout` and `stderr` messages, so `|` (pipe) can be used to send the output to another handler.\n\nThe below examples are using `jq` (https://stedolan.github.io/jq/) to format the JSON output.\n\n\n#### Help\n\n```bash\n$ python -m pypoabus\n\nusage: pypoabus [-h] [-l zone | -t line_code] [-f format] [-d]\n\noptional arguments:\n -h, --help show this help message and exit\n -l zone, --list zone List all line codes by zone: [north|south|east|public]\n -t line_code, --timetable line_code\n Line code like 281-1, 101-1, etc.\n -f format, --format format\n [json|table]\n -d, --debug-url Log the URL that pypoabus will call\n\n```\n#### Examples\n\n\n\n**List bus lines**\n\n```bash\n$ python -m pypoabus -l south -f json | jq # jq is only a external tool to format json (not included) :D\n```\n```JavaScript\n{\n \"list\": [\n {\n \"code\": \"210-14\",\n \"name\": \"110 - RESTINGA NOVA VIA TRISTEZA\"\n },\n {\n \"code\": \"210-81\",\n \"name\": \"1101 - RESTINGA NOVA VIA TRISTEZA/DOMINGOS E FERIADOS\"\n },\n {\n \"code\": \"210-46\",\n \"name\": \"1102 - RESTINGA NOVA VIA TRISTEZA/BARRA SHOPPING\"\n },\n {\n \"code\": \"211-11\",\n \"name\": \"111 - RESTINGA VELHA (TRISTEZA)\"\n }\n}\n```\n\n```bash\n$ python -m pypoabus -l south -f table # format output as table\n```\n```bash\n\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 List of Bus lines (South) \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Code \u2502 Name \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 210-14 \u2502 110 - RESTINGA NOVA VIA TRISTEZA \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 210-81 \u2502 1101 - RESTINGA NOVA VIA TRISTEZA/DOMINGOS E FERIADOS \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 210-46 \u2502 1102 - RESTINGA NOVA VIA TRISTEZA/BARRA SHOPPING \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 211-11 \u2502 111 - RESTINGA VELHA (TRISTEZA) \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 211-12 \u2502 1111 - RESTINGA VELHA(TRISTEZA)/SHOPPING \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 272-33 \u2502 1112 - HIPICA/TRISTEZA \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 149-0 \u2502 149 - ICARAI \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n```\n\n\n**Get bus line timetable**\n\n```bash\n$ python -m pypoabus -t 281-81 -f json | jq # jq is only a external tool to format json (not included) :D\n```\n```JavaScript\n{\n \"code\": \"R81\",\n \"name\": \"RAPIDA CAMPO NOVO\",\n \"schedules\": [\n {\n \"direction\": \"BAIRRO/CENTRO\",\n \"schedule_day\": \"Dias \u00dateis\",\n \"timetable\": [\n \"06:25\",\n \"06:45\",\n \"07:05\",\n \"07:25\",\n \"07:40\",\n \"08:00\"\n ]\n },\n {\n \"direction\": \"CENTRO/BAIRRO\",\n \"schedule_day\": \"Dias \u00dateis\",\n \"timetable\": [\n \"17:20\",\n \"17:45\",\n \"18:15\"\n ]\n }\n ]\n}\n```\n\n```bash\n$ python -m pypoabus -t 281-81 -f table \n\n\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 R81 - RAPIDA CAMPO NOVO \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\u250cBAIRRO/CENTRO\u2500\u2510\n\u2502 Dias \u00dateis \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 06:25 \u2502\n\u2502 06:45 \u2502\n\u2502 07:05 \u2502\n\u2502 07:25 \u2502\n\u2502 07:40 \u2502\n\u2502 08:00 \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n\u250cCENTRO/BAIRRO\u2500\u2510\n\u2502 Dias \u00dateis \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 17:20 \u2502\n\u2502 17:45 \u2502\n\u2502 18:15 \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n\n\n```\n\n\n\n\n", "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/jonathadv/py-poa-bus", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pypoabus", "package_url": "https://pypi.org/project/pypoabus/", "platform": "", "project_url": "https://pypi.org/project/pypoabus/", "project_urls": { "Homepage": "https://github.com/jonathadv/py-poa-bus" }, "release_url": "https://pypi.org/project/pypoabus/1.2.0/", "requires_dist": [ "requests", "beautifulsoup4", "terminaltables" ], "requires_python": ">=3.4.*", "summary": "Module/CLI to retrieve the bus timetables of Porto Alegre city from EPTC web site.", "version": "1.2.0" }, "last_serial": 3902489, "releases": { "1.1.0": [ { "comment_text": "", "digests": { "md5": "d597d2900117d3ce4fbfef27032c6cfb", "sha256": "850db90527df5535aefa636424cd01b898afeef651bc197aa56c4d72df0b283f" }, "downloads": -1, "filename": "pypoabus-1.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "d597d2900117d3ce4fbfef27032c6cfb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9928, "upload_time": "2018-05-25T04:20:37", "url": "https://files.pythonhosted.org/packages/e0/0e/10fc9683673549de4beb586f6f7d9bfa9d3852b1d9adf26eb3578168547a/pypoabus-1.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "32b829cf92d07ab2fcdbad39c2154b90", "sha256": "f6395aa355f401363ac77d424cbe4a5ec8aefca5d4a95195c006948e406692d8" }, "downloads": -1, "filename": "pypoabus-1.1.0.tar.gz", "has_sig": false, "md5_digest": "32b829cf92d07ab2fcdbad39c2154b90", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8794, "upload_time": "2018-05-25T04:20:38", "url": "https://files.pythonhosted.org/packages/22/da/5d2a92a19b1071f15f54f3c6e72ddbe4d3b0564ae8c1466c8e4f9de77234/pypoabus-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "7b9e5e349ae5e944e6fc911a0a981b8d", "sha256": "cc8b8ef524d43a942fc864c9d9c9102fa61774c754cf50944486bb7e8b12b559" }, "downloads": -1, "filename": "pypoabus-1.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "7b9e5e349ae5e944e6fc911a0a981b8d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4.*", "size": 9941, "upload_time": "2018-05-25T04:30:36", "url": "https://files.pythonhosted.org/packages/db/38/8632c51f75d3af8659f10799b2ec1f056475d93f20de951d77c26f40ab25/pypoabus-1.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b30fd6d9b8ba6cae2e235576ce67e257", "sha256": "fedfb78a667d9efacec0c4781579a4a0eff494ee07d2e35661b2546d28059f05" }, "downloads": -1, "filename": "pypoabus-1.1.1.tar.gz", "has_sig": false, "md5_digest": "b30fd6d9b8ba6cae2e235576ce67e257", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4.*", "size": 8843, "upload_time": "2018-05-25T04:30:38", "url": "https://files.pythonhosted.org/packages/6a/e3/22d0021e470b55a3175ce9315ab5fa8e75a9c324e40be32adea1e141aff7/pypoabus-1.1.1.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "a340c5c78ad875b929b612daefc598a2", "sha256": "4ef31effb74eca95473642d2487fd1963ed21c8396f10de4f3c6581f623b69c2" }, "downloads": -1, "filename": "pypoabus-1.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "a340c5c78ad875b929b612daefc598a2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4.*", "size": 10498, "upload_time": "2018-05-27T03:50:59", "url": "https://files.pythonhosted.org/packages/15/a1/804755763553149bfd70bf3ec16e3479f099e63ed0a1e1f3e779034f0f23/pypoabus-1.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2f992474ad54d895784d740985cf2db3", "sha256": "bf8dbf6ed7ed5c91366d964cf890e99cbfc4798750294b1f2f0a5f0d04e6a84a" }, "downloads": -1, "filename": "pypoabus-1.2.0.tar.gz", "has_sig": false, "md5_digest": "2f992474ad54d895784d740985cf2db3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4.*", "size": 9374, "upload_time": "2018-05-27T03:51:01", "url": "https://files.pythonhosted.org/packages/11/b6/5a7fdd278c24be8ba0588e5f444ea364abaa3f0e4a6d03d6844a15f1398c/pypoabus-1.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a340c5c78ad875b929b612daefc598a2", "sha256": "4ef31effb74eca95473642d2487fd1963ed21c8396f10de4f3c6581f623b69c2" }, "downloads": -1, "filename": "pypoabus-1.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "a340c5c78ad875b929b612daefc598a2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4.*", "size": 10498, "upload_time": "2018-05-27T03:50:59", "url": "https://files.pythonhosted.org/packages/15/a1/804755763553149bfd70bf3ec16e3479f099e63ed0a1e1f3e779034f0f23/pypoabus-1.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2f992474ad54d895784d740985cf2db3", "sha256": "bf8dbf6ed7ed5c91366d964cf890e99cbfc4798750294b1f2f0a5f0d04e6a84a" }, "downloads": -1, "filename": "pypoabus-1.2.0.tar.gz", "has_sig": false, "md5_digest": "2f992474ad54d895784d740985cf2db3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4.*", "size": 9374, "upload_time": "2018-05-27T03:51:01", "url": "https://files.pythonhosted.org/packages/11/b6/5a7fdd278c24be8ba0588e5f444ea364abaa3f0e4a6d03d6844a15f1398c/pypoabus-1.2.0.tar.gz" } ] }