{ "info": { "author": "SoftButterfly Development Team", "author_email": "SoftButterfly Development Team ", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# Glovo Python Business API\n\nCreate, retrieve and track your Glovo orders trough their Business API.\n\n## Requirements\n\nThis package requires at least\n\n* requests 2.21.0\n* python 3.7\n\nThis package was not tested with prior versions of these packages but it can works as well.\n\n## Install\n\nYou can install via pip. Run the following command:\n\n```\n$ pip install glovo-api-python\n```\n\n## Credentials\n\nCreate an account in Glovo (it can be created from the App). This api **needs a credit card associated to your account**. You can add one from your app and it will be used automatically for any order. In order to get your API credentials you should login in the desired environment and go to *Credentials* section on your profile.\n\n* [B2B Production](https://business.glovoapp.com/dashboard/profile)\n* [B2B Sandbox/Test](https://business.testglovo.com/dashboard/profile)\n\nExample `ApiKey` & `ApiSecret`:\n\n```python\napi_key = '155761234946286'\napi_secret = '767b4e2f48e4412d95a6eb1234bdc78b'\n```\n\n## Usage\n\nSimple usage looks like:\n\n### Initialize client\n\n```python\nfrom glovo_api_python.client import Client\n\napi_key = 'sample_api_key'\napi_secret = 'sample_api_secret'\n\nclient = Client(api_key, api_secret)\n```\n\n### Get working areas\n\nFrom [glovo docs](https://api-docs.glovoapp.com/b2b/index.html#getworkingareas)\n\n```python\nwoking_areas = client.working_area.list()\nprint(working_areas)\n# Will show this\n# {\n# 'status': 200,\n# 'data': {\n# 'workingAreas': [\n# {\n# 'code': 'ABJ',\n# 'polygons': [\n# '',\n# ''\n# ],\n# 'workingTime': {\n# 'from': '09:00',\n# 'duration': 120\n# }\n# }\n# \n# ]\n# }\n# }\n```\n\n\n### Estimate order price\n\nFrom [glovo docs](https://api-docs.glovoapp.com/b2b/index.html#estimateorderprice)\n\n```python\npickup_address = {\n \"lat\": -12.0563673,\n \"lon\": -76.9733736,\n \"type\": \"PICKUP\",\n \"label\": \"Avenida los Cipreses, 140\",\n \"details\": \"Edificio Orbes, Piso 3, Oficina de Productos Angel Bre\u00f1a\",\n \"contactPhone\": None,\n \"contactPerson\": None\n}\n\ndelivery_address = {\n \"lat\": -12.055013,\n \"lon\": -77.03845849999999,\n \"type\": \"DELIVERY\",\n \"label\": \"Avenida Inca Garcilaso de la Vega, 1250\",\n \"details\": \"Oficina 511\",\n \"contactPhone\": None,\n \"contactPerson\": None\n}\n\nestimates_order_price = client.order.estimate({\n \"scheduleTime\": None,\n \"description\": \"Some useful description\",\n \"addresses\": [\n pickup_address,\n delivery_address\n ]\n})\nprint(estimates_order_price)\n# Will show this\n# {\n# 'status': 200,\n# 'data': {\n# 'total': {\n# 'amount': 1260,\n# 'currency': 'PEN'\n# }\n# }\n# }\n```\n\n### Create order\nFrom [glovo docs](https://api-docs.glovoapp.com/b2b/index.html#createorder)\n\n```python\npickup_address = {\n \"lat\": -12.0563673,\n \"lon\": -76.9733736,\n \"type\": \"PICKUP\",\n \"label\": \"Avenida los Cipreses, 140\",\n \"details\": \"Edificio Orbes, Piso 3, Oficina de Productos Angel Bre\u00f1a\",\n \"contactPhone\": None,\n \"contactPerson\": None\n}\n\ndelivery_address = {\n \"lat\": -12.055013,\n \"lon\": -77.03845849999999,\n \"type\": \"DELIVERY\",\n \"label\": \"Avenida Inca Garcilaso de la Vega, 1250\",\n \"details\": \"Oficina 511\",\n \"contactPhone\": None,\n \"contactPerson\": None\n}\n\nplaced_order = client.order.create({\n \"scheduleTime\": 12344566, # Set to None for immediate order\n \"description\": \"Some useful description\",\n \"addresses\": [\n pickup_address,\n delivery_address\n ]\n})\n\nprint(placed_order)\n# Will show this\n# {\n# 'status': 200,\n# 'data': {\n# \"id\": 123456789,\n# \"state\": \"SCHEDULED\",\n# \"scheduleTime\": 12344566,\n# \"description\": \"A 30cm by 30cm box\",\n# \"addresses\": [\n# ,\n# ,\n# ]\n# }\n# }\n```\n\n### Retrieve order\nFrom [glovo docs](https://api-docs.glovoapp.com/b2b/index.html#retrieveorder)\n\n```python\norder_id = 32678866\nplaced_order = client.order.read(order_id)\n\nprint(placed_order)\n# Will show this\n# {\n# 'status': 200,\n# 'data': {\n# 'scheduleTime': None,\n# 'description': 'Necesito enviar una llave',\n# 'addresses': [\n# ,\n# ,\n# ],\n# 'id': '32678866',\n# 'state': 'DELIVERED',\n# 'reference': None\n# }\n# }\n```\n\n### Get order tracking\nFrom [glovo docs](https://api-docs.glovoapp.com/b2b/index.html#getordertracking)\n\n```python\norder_id = 32678866\ntracking = client.order.tracking(order_id)\nprint(tracking)\n# Will show this\n# {\n# \"status\": 200,\n# \"data\": {\n# \"lat\": -12.0704984,\n# \"lon\": -76.9816546\n# }\n# }\n```\n\n### Get courier contact\nFrom [glovo docs](https://api-docs.glovoapp.com/b2b/index.html#getcouriercontact)\n\n```python\norder_id = 32678866\ncourier_contact = client.order.courier_contact(order_id)\nprint(courier_contact)\n# Will show this\n# {\n# \"status\": 200,\n# \"data\": {\n# \"courierName\": \"Courier names\",\n# \"phone\": \"+99999999999\"\n# }\n# }\n```\n\n### Get orders\nFrom [glovo docs](https://api-docs.glovoapp.com/b2b/index.html#getorders)\n\n```python\nstart=12344566\nend=12544566\norder_list = client.order.list(data={'from': start, 'to': end})\nprint(order_list)\n# Will show this\n# {\n# \"status\": 200,\n# \"data\": [\n# {\n# \"scheduleTime\": null,\n# \"description\": \"Useful description!\",\n# \"addresses\": [\n# ,\n# ,\n# ],\n# \"id\": \"40304538\",\n# \"state\": \"DELIVERED\",\n# \"reference\": null\n# },\n# \n# ]\n# }\n```\n\n### Cancel order\nFrom [glovo docs](https://api-docs.glovoapp.com/b2b/index.html#cancelorder)\n\n```python\norder_id = 32678866\ncanceled_order = client.order.cancel(order_id)\nprint(courier_contact)\n# Will show this\n# {\n# status: 200,\n# data: {\n# \"id\": 32678866,\n# \"state\": \"CANCELED\",\n# \"scheduleTime\": 12344566,\n# \"description\": \"A 30cm by 30cm box\",\n# \"addresses\": [\n# ,\n# ,\n# ]\n# }\n# }\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://gitlab.com/softbutterfly/glovo-api-python/-/archive/0.1.1/glovo-api-python-0.1.1.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.com/softbutterfly/glovo-api-python", "keywords": "Softbutterfly,Glovo,Glovo API", "license": "", "maintainer": "", "maintainer_email": "", "name": "glovo-api-python", "package_url": "https://pypi.org/project/glovo-api-python/", "platform": "", "project_url": "https://pypi.org/project/glovo-api-python/", "project_urls": { "Download": "https://gitlab.com/softbutterfly/glovo-api-python/-/archive/0.1.1/glovo-api-python-0.1.1.tar.gz", "Homepage": "https://gitlab.com/softbutterfly/glovo-api-python" }, "release_url": "https://pypi.org/project/glovo-api-python/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "Glovo API Python SDK", "version": "0.1.1" }, "last_serial": 5465856, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "9c33bceb938476c1a0f9167df9d7f4fe", "sha256": "f95e5baa582a6464319cdb851f8d930755c0f88985eaf2d55c329e461e2f34c4" }, "downloads": -1, "filename": "glovo_api_python-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "9c33bceb938476c1a0f9167df9d7f4fe", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10961, "upload_time": "2019-06-04T23:22:53", "url": "https://files.pythonhosted.org/packages/39/ae/3a9c52a57d5e603eefe89b0cbb78d08ce6cbabc2d1c500e44a4cf750dda5/glovo_api_python-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "08703165624f2b31c5658285cf918061", "sha256": "e7a42da8cf111d5de3beba126e96369ac7ff2d22d4943455ab43a3b8692f1ac4" }, "downloads": -1, "filename": "glovo-api-python-0.1.0.tar.gz", "has_sig": false, "md5_digest": "08703165624f2b31c5658285cf918061", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9650, "upload_time": "2019-06-04T23:22:56", "url": "https://files.pythonhosted.org/packages/5b/32/b652878b5678cb790969be2656a5530e4a2382fc7c3df1b6a4d6af8807e2/glovo-api-python-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "25456fceab03e3d2e9cd092055ed74cf", "sha256": "0f05b0fe3127e81582abbe6c0413528738fb1873a37e138bd24af550a0f75df7" }, "downloads": -1, "filename": "glovo-api-python-0.1.1.tar.gz", "has_sig": false, "md5_digest": "25456fceab03e3d2e9cd092055ed74cf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9660, "upload_time": "2019-06-29T16:51:59", "url": "https://files.pythonhosted.org/packages/4e/17/de0f173ea9dc20cf9ef5faede9af2361409086c50b4a13511c39c01b1153/glovo-api-python-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "25456fceab03e3d2e9cd092055ed74cf", "sha256": "0f05b0fe3127e81582abbe6c0413528738fb1873a37e138bd24af550a0f75df7" }, "downloads": -1, "filename": "glovo-api-python-0.1.1.tar.gz", "has_sig": false, "md5_digest": "25456fceab03e3d2e9cd092055ed74cf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9660, "upload_time": "2019-06-29T16:51:59", "url": "https://files.pythonhosted.org/packages/4e/17/de0f173ea9dc20cf9ef5faede9af2361409086c50b4a13511c39c01b1153/glovo-api-python-0.1.1.tar.gz" } ] }