{ "info": { "author": "Jo\u00e3o Paulo de Melo", "author_email": "jpmdik@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# MercadoLibre's Python SDK\n\nThis is the official Python SDK for MercadoLibre's Platform.\n\n## How do I install it?\n\n clone repository\n https://github.com/mercadolibre/python-sdk.git\n\n## How do I use it?\n\nThe first thing to do is to instance a ```Meli``` class. You'll need to give a ```clientId``` and a ```clientSecret```. You can obtain both after creating your own application. For more information on this please read: [creating an application](http://developers.mercadolibre.com/application-manager/)\n\n### Including the Lib\nInclude the lib meli in your project\n\n### Attention\nDon't forget to set the authentication URL of your country in file lib/config.ini\n\n```python\nimport sys\nsys.path.append('../lib')\nfrom meli import Meli\n```\nStart the development!\n\n### Create an instance of Meli class\nSimple like this\n```python\nmeli = Meli(client_id=1234, client_secret=\"a secret\")\n```\nWith this instance you can start working on MercadoLibre's APIs.\n\nThere are some design considerations worth to mention.\n\n1. This SDK is just a thin layer on top of an http client to handle all the OAuth WebServer flow for you.\n\n2. There is JSON parsing. this SDK will include [json](http://docs.python.org/2/library/json.html) for internal usage.\n\n3. If you already have the access_token and the refresh_token you can pass in the constructor\n\n```python\nmeli = Meli(client_id=1234, client_secret=\"a secret\", access_token=\"Access_Token\", refresh_token=\"Refresh_Token\")\n```\n\n## How do I redirect users to authorize my application?\n\nThis is a 2 step process.\n\nFirst get the link to redirect the user. This is very easy! Just:\n\n```python\nredirectUrl = meli.auth_url(redirect_URI=\"http://somecallbackurl\")\n```\n\nThis will give you the url to redirect the user. You need to specify a callback url which will be the one that the user will redirected after a successfull authrization process.\n\nOnce the user is redirected to your callback url, you'll receive in the query string, a parameter named ```code```. You'll need this for the second part of the process.\n\n```python\nmeli.authorize(code=\"the received code\", redirect_URI=\"http://somecallbackurl\")\n```\n\nThis will get an ```access_token``` and a ```refresh_token``` (is case your application has the ```offline_access```) for your application and your user.\n\nAt this stage your are ready to make call to the API on behalf of the user.\n\n#### Making GET calls\n\n```python\nparams = {'access_token' : meli.access_token}\nresponse = meli.get(path=\"/users/me\", params=params)\n```\n\n#### Making POST calls\n\n```python\nparams = {'access_token' : meli.access_token}\n\n #this body will be converted into json for you\nbody = {'foo' : 'bar', 'bar' : 'foo'}\n\nresponse = meli.post(path=\"/items\", body=body, params=params)\n```\n\n#### Making PUT calls\n\n```python\nparams = {'access_token' : meli.access_token}\n\n #this body will be converted into json for you\nbody = {'foo' : 'bar', 'bar' : 'foo'}\n\nresponse = meli.put(path=\"/items/123\", body=body, params=params)\n```\n\n#### Making DELETE calls\n```python\nparams = {'access_token' : meli.access_token}\nresponse = meli.delete(path=\"/questions/123\", params=params)\n```\n\n## Examples\n\nDon't forget to check out our examples codes in the folder [examples](https://github.com/mercadolibre/python-sdk/tree/master/examples)\n\n## Community\n\nYou can contact us if you have questions using the standard communication channels described in the [developer's site](http://developers.mercadolibre.com/community/)\n\n## I want to contribute!\n\nThat is great! Just fork the project in github. Create a topic branch, write some code, and add some tests for your new code.\n\nThanks for helping!\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/mercadolibre/python-sdk", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "mlapi", "package_url": "https://pypi.org/project/mlapi/", "platform": "", "project_url": "https://pypi.org/project/mlapi/", "project_urls": { "Homepage": "https://github.com/mercadolibre/python-sdk" }, "release_url": "https://pypi.org/project/mlapi/1.3.8/", "requires_dist": [ "configparser" ], "requires_python": "", "summary": "Mercado Livre API", "version": "1.3.8" }, "last_serial": 5003174, "releases": { "1.3.8": [ { "comment_text": "", "digests": { "md5": "bc8382019d872a0366f84c8d7e667bd0", "sha256": "44d4abfe919c9c8188a99bbc03cdc27a5d149b7fb30d97a21713d9a3ca6b14d4" }, "downloads": -1, "filename": "mlapi-1.3.8-py3-none-any.whl", "has_sig": false, "md5_digest": "bc8382019d872a0366f84c8d7e667bd0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7401, "upload_time": "2019-03-29T13:03:32", "url": "https://files.pythonhosted.org/packages/f8/03/139bca46523e3290a5b4488a5883c99946f04fba05816af70ebb9945bc35/mlapi-1.3.8-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bc8382019d872a0366f84c8d7e667bd0", "sha256": "44d4abfe919c9c8188a99bbc03cdc27a5d149b7fb30d97a21713d9a3ca6b14d4" }, "downloads": -1, "filename": "mlapi-1.3.8-py3-none-any.whl", "has_sig": false, "md5_digest": "bc8382019d872a0366f84c8d7e667bd0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7401, "upload_time": "2019-03-29T13:03:32", "url": "https://files.pythonhosted.org/packages/f8/03/139bca46523e3290a5b4488a5883c99946f04fba05816af70ebb9945bc35/mlapi-1.3.8-py3-none-any.whl" } ] }