{ "info": { "author": "Marco Nila", "author_email": "contact.marconila@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Ecobici python wrapper\n\n[![Build Status](https://travis-ci.com/sainoba/ecobici_py.svg?branch=master)](https://travis-ci.com/sainoba/ecobici_py)\n[![PyPI version](https://badge.fury.io/py/ecobici.svg)](https://badge.fury.io/py/ecobici)\n![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg)\n\n![Ecobici logo](https://raw.githubusercontent.com/sainoba/ecobici_py/master/img/ecobici.jpg)\n\n## Installation\n`pip install ecobici`\n\n## Usage\n\n```python\n# Import module\nfrom ecobici import Ecobici\n\n# Initialize client\nclient = Ecobici(your_client_id, your_client_secret)\n\n# Get dictionary containing stations\nstations = client.get_stations()\n\n# Get dictionary containing the status of stations\nstations_status = client.get_stations_status()\n\n# (Optional) Force refresh token\nclient.refresh_token()\n\n```\n\n### Examples\n#### Get the name of the first station\n```python\nfrom ecobici import Ecobici\nclient = Ecobici(your_client_id, your_client_secret)\nlist_of_stations = client.get_stations()[\"stations\"]\n\nprint(\"The name of the first station is \", list_of_stations[0][\"name\"])\n```\n[Check the Data structure section for more information](#data-structure)\n\n#### Get the status of the third station\n```python\nfrom ecobici import Ecobici\nclient = Ecobici(your_client_id, your_client_secret)\nlist_of_stations = client.get_stations_status()[\"stationsStatus\"]\n\nprint(\"The status of the third station is \", list_of_stations[3][\"status\"])\n```\n[Check the Data structure section for more information](#data-structure)\n\n## Data structure\n### Stations structure\n\nThis module translate the json objects to python objects and returns it to the user,\nit doesn't unwraps it because I didn't want to modify the data.\n\nThe econduce's API returns data in the following json format,\nthat's why you have to manually unwrap it with `client.get_stations_status()[\"stations\"]`:\n\n```json5\n{\n \"stations\": [\n {\n \"id\": 448,\n \"name\": \"448 DR. ANDRADE - ARCOS DE BEL\u00c9N\",\n \"address\": \"DR. ANDRADE ARCOS DE BEL\u00c9N\",\n \"addressNumber\": \"S/N\",\n \"zipCode\": null,\n \"districtCode\": null,\n \"districtName\": null,\n \"altitude\": null,\n \"nearbyStations\": [\n 448\n ],\n \"location\": {\n \"lat\": 19.426611,\n \"lon\": -99.14447\n },\n \"stationType\": \"BIKE,TPV\"\n },\n ]\n}\n```\n\n#### Structure and types\n\n|Key|Type|\n|---|---|\n|id|int|\n|name|str|\n|address|str|\n|addressNumber|str|\n|zipCode|str|\n|districtCode|str|\n|districtName|str|\n|nearbyStations|list with id (int)|\n|location|list|\n|stationType|str|\n\nLocation list:\n\n|Key|Type|\n|---|---|\n|lat|float|\n|lon|float|\n\nLatitud and logitud are coordinates based on the [World Geodetic System (WGS84)](https://es.wikipedia.org/wiki/WGS84).\n\n### Status structure\n\nThis module translate the json objects to python objects and returns it to the user,\nit doesn't unwraps it because I didn't want to modify the data.\n\nThe econduce's API returns data in the following json format,\nthat's why you have to manually unwrap it with `client.get_stations_status()[\"stationsStatus\"]`:\n\n```json5\n{\n \"stationsStatus\": [\n {\n \"id\": 1,\n \"status\": \"OPN\",\n \"availability\": {\n \"bikes\": 4,\n \"slots\": 23\n }\n },\n ]\n} \n```\n\n#### Structure and types\n\n|Key|Type|\n|---|---|\n|id|int|\n|status|str (OPN means open, CLS means closed)|\n|availability|list|\n\nAvailability list:\n\n|Key|Type|\n|---|---|\n|bikes|int|\n|slots|int|\n\n## Test \n`python3 -m pytest ecobici/test.py`\n\n## Notes\n- There's no need to refresh the token when it expires. The client does it automatically.\n- Ecobici's API can return _null_ values. It's up to you to verify that the value you want to access if defined.\n- You can find more information about the API structure here: [Spanish documentation](https://www.ecobici.cdmx.gob.mx/sites/default/files/pdf/manual_api_opendata_esp_final.pdf).\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/sainoba/ecobici_py", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "ecobici", "package_url": "https://pypi.org/project/ecobici/", "platform": "", "project_url": "https://pypi.org/project/ecobici/", "project_urls": { "Homepage": "https://github.com/sainoba/ecobici_py" }, "release_url": "https://pypi.org/project/ecobici/0.0.3/", "requires_dist": null, "requires_python": "", "summary": "This is a python wrapper for the ecobici api", "version": "0.0.3" }, "last_serial": 4249874, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "50e9dbba807f5d8cc96de3e5f03011f1", "sha256": "12525afeb197fdd575c9a3bcf280bf73f82c4bd4a46ea7d7d36c3610bd8bba46" }, "downloads": -1, "filename": "ecobici-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "50e9dbba807f5d8cc96de3e5f03011f1", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3004, "upload_time": "2018-09-07T17:47:33", "url": "https://files.pythonhosted.org/packages/b2/b2/4178a5e66fd9b379ad9d210e2b5a66b45bfe45a59ccb87d775910c7ff79d/ecobici-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4843e0bfefc404dc3fe7958ea15eda53", "sha256": "6ec4fbfb99740aebb24237141cd0d0f90a5185327a31057326404b34673bfbd4" }, "downloads": -1, "filename": "ecobici-0.0.1.tar.gz", "has_sig": false, "md5_digest": "4843e0bfefc404dc3fe7958ea15eda53", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2303, "upload_time": "2018-09-07T17:47:34", "url": "https://files.pythonhosted.org/packages/10/3b/b5a84e9df4062e1d3d83374a95b3d11feada472d94d67494297488e407a0/ecobici-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "5aa89904b7e41ee39f363a1a1e0b2e3f", "sha256": "dda8cef6b368d8e53351c4f89d750d161438feb580174299e239df7e28509612" }, "downloads": -1, "filename": "ecobici-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "5aa89904b7e41ee39f363a1a1e0b2e3f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3230, "upload_time": "2018-09-07T18:16:57", "url": "https://files.pythonhosted.org/packages/d0/76/bc576f0418fd4b8eb16ba032e422faed1a3184309603d108e6e13cdacd66/ecobici-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "339f80012918fb4e6e11b5922efa1f77", "sha256": "6a9bf45dbfa41d24440de7736f3d011d967629d253a8daa709a2a0aa59a9bbab" }, "downloads": -1, "filename": "ecobici-0.0.2.tar.gz", "has_sig": false, "md5_digest": "339f80012918fb4e6e11b5922efa1f77", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2648, "upload_time": "2018-09-07T18:16:59", "url": "https://files.pythonhosted.org/packages/d1/e4/8ce34730a0eb6475d8939f9d3e84b3b6cf660adc5d9b0ba202fe7a32c698/ecobici-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "dff601a183232c4fe433d59013f1478c", "sha256": "5ef86a9b96a782990f67b655bfba4e25c609b80c808808ea5ab81cc7a4e421dc" }, "downloads": -1, "filename": "ecobici-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "dff601a183232c4fe433d59013f1478c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4201, "upload_time": "2018-09-07T20:03:26", "url": "https://files.pythonhosted.org/packages/59/67/32467c0b6ee67fb0dc1c95643e31cbfc751c482cf76abd3129f15ce23418/ecobici-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "46a089e1b34cc29130a77c2501de2f2a", "sha256": "ad9642e6ab1e436558fbd661da237c0f6549568e1d3519d2cacf3096757b1db4" }, "downloads": -1, "filename": "ecobici-0.0.3.tar.gz", "has_sig": false, "md5_digest": "46a089e1b34cc29130a77c2501de2f2a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4054, "upload_time": "2018-09-07T20:03:27", "url": "https://files.pythonhosted.org/packages/22/6c/1a0743eb3e4d3603d565d41b9711c46aeb47ffa25574ddafab73d76b0818/ecobici-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dff601a183232c4fe433d59013f1478c", "sha256": "5ef86a9b96a782990f67b655bfba4e25c609b80c808808ea5ab81cc7a4e421dc" }, "downloads": -1, "filename": "ecobici-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "dff601a183232c4fe433d59013f1478c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4201, "upload_time": "2018-09-07T20:03:26", "url": "https://files.pythonhosted.org/packages/59/67/32467c0b6ee67fb0dc1c95643e31cbfc751c482cf76abd3129f15ce23418/ecobici-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "46a089e1b34cc29130a77c2501de2f2a", "sha256": "ad9642e6ab1e436558fbd661da237c0f6549568e1d3519d2cacf3096757b1db4" }, "downloads": -1, "filename": "ecobici-0.0.3.tar.gz", "has_sig": false, "md5_digest": "46a089e1b34cc29130a77c2501de2f2a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4054, "upload_time": "2018-09-07T20:03:27", "url": "https://files.pythonhosted.org/packages/22/6c/1a0743eb3e4d3603d565d41b9711c46aeb47ffa25574ddafab73d76b0818/ecobici-0.0.3.tar.gz" } ] }