{ "info": { "author": "Federico Bond", "author_email": "federicobond@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP" ], "description": "PyMercadoPago\n=============\n\n.. image:: https://img.shields.io/pypi/v/pymercadopago.svg\n :target: https://pypi.python.org/pypi/pymercadopago\n :alt: Latest Version\n\n.. image:: https://travis-ci.org/federicobond/pymercadopago.svg?branch=master\n :target: https://travis-ci.org/federicobond/pymercadopago\n\n\nPyMercadoPago is user-friendly library to interact with the MercadoPago API.\n\nIt's compatible with both Python 2 and 3.\n\nTo install it from PyPI, simply run::\n\n pip install pymercadopago\n\nIf you haven't done so already, obtain your ``CLIENT_ID`` and ``CLIENT_SECRET`` `here\n`_.\n\nQuickstart\n----------\n\nCreate a new ``mercadopago.Client`` instance and pass it your credentials:\n\n.. code-block:: python\n\n import mercadopago\n\n CLIENT_ID = 'XXX'\n CLIENT_SECRET = 'XXX'\n\n mp = mercadopago.Client(CLIENT_ID, CLIENT_SECRET)\n\n\nYou can navigate the full API from the client methods. Try running the above\ncode in a Python shell and explore them.\n\n.. code-block:: python\n\n # Get the invoice with ID 1234\n mp.invoices.get('1234')\n\n\n.. code-block:: python\n\n # Get the current user account balance\n mp.users.account_balance()\n\n\n.. code-block:: python\n\n # Create a new customer instance\n mp.customers.create(\n first_name='Federico'\n last_name='Bond',\n # ...\n )\n\n\nIn general, assuming ``mp`` is a ``mercadopago.Client`` instance and there is\nan endpoint documented at (for example) ``/customers`` or ``/v1/customers``,\nyou can do:\n\n``mp.customers.list()``\n List all customers. Pass pagination parameters via keyword arguments.\n\n``mp.customers.create(**data)``\n Create a new Customer.\n\n``mp.customers.delete(id)``\n Delete a Customer.\n\n``mp.customers.update(**data)``\n Update a Customer, include ``\u00ecd`` in your keyword arguments.\n\n``mp.customers.search(**params)``\n Search for customers matching params.\n\nNot all methods are available for all resources, and some additional\nconvenience methods have been added to some. To learn more, check out the\nofficial docs and/or the code from the ``mercadopago.api`` module.\n\nNested resources like are usually accessed by following the corresponding\nresource paths. For example:\n\n.. code-block:: python\n\n # GET /v1/customers/:id/cards\n # ----\n mp.customers.cards(id).list()\n\n\nAll methods return a ``Response`` object if successful (HTTP status code in the\n2XX range) or raise an instance of ``mercadopago.Error`` otherwise.\n\nResponse\n--------\n\nEvery API call you make will return a ``Response`` instance with the following\nattributes:\n\n=============== ==============================================\nAttribute Description\n=============== ==============================================\n``status_code`` The HTTP status_code returned by the API.\n``data`` The decoded JSON response returned by the API.\n``url`` The requested URL.\n=============== ==============================================\n\nIf MercadoPago returns a response with pagination information, a\n``PaginatedResponse`` will be returned instead. Paginated responses have the\nfollowing additional methods:\n\n``response.total``\n Total amount of records in this collection.\n\n``response.limit``\n Maximum number of records for this page.\n\n``response.offset``\n Number of records skipped to reach this page.\n\n``response.results``\n List of records in this request. This is different from ``.data`` which\n contains the full body of the response, with the pagination info.\n\n``response.has_prev()``\n Whether there are any preceding pages.\n\n``response.has_next()``\n Whether there are any following pages.\n\n``response.prev()``\n Requests the previous page and returns a ``PaginatedResponse``.\n\n``response.next()``\n Requests the next page and returns a ``PaginatedResponse``.\n\n``response.auto_paging_iter()``\n Returns a generator of records that will automatically request new pages\n when necessary.\n\n\nError\n-----\n\nIf there is a connection error or the HTTP response contains a non-2XX status\ncode, the method will raise an instance of ``mercadopago.Error``.\n\n=============== ==========================================================\nAttribute Description\n=============== ==========================================================\n``http_status`` The HTTP status_code returned by the API, if applicable.\n``code`` The error code returned by the API, if applicable.\n``json_data`` The full JSON response returned by the API, if applicable.\n=============== ==========================================================\n\nThe specific subclass raised depends on the HTTP status code.\n\n====== ==================================\nStatus Class\n====== ==================================\n400 ``mercadopago.BadRequestError``\n401 ``mercadopago.AuthorizationError``\n404 ``mercadopago.NotFoundError``\n\\* ``mercadopago.Error``\n====== ==================================\n\n\nRunning the tests\n-----------------\n\nMake sure tests pass before contributing a bugfix or a new feature.\nTo run the test suite, execute this in your terminal::\n\n python setup.py test\n\n\nThis will execute the tests with your default Python interpreter.\nUse ``tox`` to run the tests in all supported Python versions.\n\n\nTo Do\n-----\n\n* Implement idempotency headers in POST/PUT requests.\n* Implement retry request from error.\n\n\n----------\n\nFor more information about the API, refer to the `official docs \n`_.\n\n\nAuthor\n------\n\nFederico Bond\n\nLicense\n-------\n\nApache-2.0\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/federicobond/pymercadopago", "keywords": "mercadopago api", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "pymercadopago", "package_url": "https://pypi.org/project/pymercadopago/", "platform": "", "project_url": "https://pypi.org/project/pymercadopago/", "project_urls": { "Homepage": "https://github.com/federicobond/pymercadopago" }, "release_url": "https://pypi.org/project/pymercadopago/0.1.4/", "requires_dist": null, "requires_python": "", "summary": "An API wrapper for MercadoPago", "version": "0.1.4" }, "last_serial": 4024453, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "381a6fa835aa38ef484f548196e4c645", "sha256": "9123022d2f6b918590fbbc890ac1a636e6020998f8bb1cfeb63e66b000adc926" }, "downloads": -1, "filename": "pymercadopago-0.1.0.tar.gz", "has_sig": false, "md5_digest": "381a6fa835aa38ef484f548196e4c645", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9594, "upload_time": "2018-06-30T10:19:25", "url": "https://files.pythonhosted.org/packages/ba/a5/9ae33aaac968abb67ecc40d7ff83e56be31ead61fbddc0dde8d8cebd9894/pymercadopago-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "9fe673d68cbbe6b321c1e14592e419a8", "sha256": "72d6ecd4c5271e389ceb4bc41962d25b6649001e36c89b8fa02d69c279129f38" }, "downloads": -1, "filename": "pymercadopago-0.1.1.tar.gz", "has_sig": false, "md5_digest": "9fe673d68cbbe6b321c1e14592e419a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9739, "upload_time": "2018-06-30T10:44:29", "url": "https://files.pythonhosted.org/packages/35/0e/f555e39e75b2e65e6a22cd674c31e769f3217474be80db7b5cffc3537661/pymercadopago-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "88f93c1176352ec36d3ac0d53954479e", "sha256": "f220c5d72d1a0ccd2c243ab614b40c7343eec9b0b3b56adcef5a06cabb9fb058" }, "downloads": -1, "filename": "pymercadopago-0.1.2.tar.gz", "has_sig": false, "md5_digest": "88f93c1176352ec36d3ac0d53954479e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9790, "upload_time": "2018-06-30T10:50:57", "url": "https://files.pythonhosted.org/packages/b5/e1/bf908d83656bbbaf0169ab52cd4b2572fb3c3ef8b5c54b7e5955f1bced41/pymercadopago-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "49d198fe307031c5404ef538ba668015", "sha256": "a790ddd6387bbb1336a9005f2231c904275c303078206231d76e9a2de5a1e515" }, "downloads": -1, "filename": "pymercadopago-0.1.3.tar.gz", "has_sig": false, "md5_digest": "49d198fe307031c5404ef538ba668015", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10189, "upload_time": "2018-06-30T11:50:01", "url": "https://files.pythonhosted.org/packages/32/e7/596a716ab7a403830cf0cbb9f194a07799314c57a28b9a2d7c47f7de1e95/pymercadopago-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "0502b695abeb1b8f973c7c5281ecdb59", "sha256": "db3db537013e127baad830da677700da1644e1ed181a8a3e4676e1a050495d24" }, "downloads": -1, "filename": "pymercadopago-0.1.4.tar.gz", "has_sig": false, "md5_digest": "0502b695abeb1b8f973c7c5281ecdb59", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11702, "upload_time": "2018-07-02T23:27:05", "url": "https://files.pythonhosted.org/packages/6f/62/50de6c6ca2526d4ce09a88a638b6d7e2ae40c8e5b4a5e032b9c516bc177e/pymercadopago-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0502b695abeb1b8f973c7c5281ecdb59", "sha256": "db3db537013e127baad830da677700da1644e1ed181a8a3e4676e1a050495d24" }, "downloads": -1, "filename": "pymercadopago-0.1.4.tar.gz", "has_sig": false, "md5_digest": "0502b695abeb1b8f973c7c5281ecdb59", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11702, "upload_time": "2018-07-02T23:27:05", "url": "https://files.pythonhosted.org/packages/6f/62/50de6c6ca2526d4ce09a88a638b6d7e2ae40c8e5b4a5e032b9c516bc177e/pymercadopago-0.1.4.tar.gz" } ] }