{ "info": { "author": "Anfernee Jervis", "author_email": "anferneejervis@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5" ], "description": "chain\n=====\n\n.. image:: https://img.shields.io/pypi/v/chain-py.svg\n :target: https://pypi.python.org/pypi/chain-py/\n :alt: Latest PyPI version\n\n.. image:: https://travis-ci.org/ajpen/chain.svg?branch=master\n :target: https://travis-ci.org/ajpen/chain\n :alt: Latest Travis CI build status\n\nAn expressive clean way to interact with REsTful APIs. It was inspired by `zmallen's pygraylog`_.\n\nChain is a small enhancement to the popular `requests`_ package. By referencing the endpoints as\nattributes to the client, it effectively \"chains\" the endpoints together, building the target url.\n\nChain is an attempt to make REsTful API clients look more like python objects, by removing the\nhardcoded URL strings in the code.\n\nChain uses the `requests`_ package as its http client, keeping its parameters and response objects.\nIf you already use `requests`_ as your http client, then adopting chain would be easy.\n\nUsage\n-----\n\nLets take for example `this API`_:\n\n.. code-block:: pycon\n\n # create a new client for the API\n >>> import chain\n >>> blogs = chain.Client('http://jsonplaceholder.typicode.com')\n\n # if you want the posts:\n >>> response = blogs.get.posts()\n\n # the response is the response object from the requests package\n >>> print response.json()\n\n\nNumbers and special characters are also supported using dictionary notation\n\n.. code-block:: pycon\n\n # Get the first post\n >>> response = blogs.get.posts[1]()\n >>> print response.json()\n\n\nchain parameters are requests.requests parameters:\n\n.. code-block:: pycon\n\n # parameters are the same as requests.requests parameters\n >>> response = blogs.get.comments(params={'postId': '1'})\n >>> print response.json()\n\n >>> comment = {'postId': 1, 'id':501, 'name':'chain', 'email':'chain@code.com', 'body':'meh.'}\n >>> response = blogs.post.comments(json=comment)\n\n\nInstallation\n------------\n::\n\n pip install chain_py\n\n\nTesting\n-------\n::\n\n python setup.py test\n\nOr:\n::\n\n tox\n\n\nCompatibility\n-------------\n\nWorks with Python version 2.7, 3.3, 3.4, 3.5 and 3.6\n\n\nLicence\n-------\nMIT licensed. Requests is licensed by the Apache License. See full `LICENSE`_\n\nAuthors\n-------\n\n`chain` was written by `Anfernee Jervis `_.\n\n\n.. _this API: https://jsonplaceholder.typicode.com/\n.. _LICENSE: https://github.com/ajpen/chain/blob/master/LICENSE.md\n.. _`zmallen's pygraylog`: https://github.com/zmallen/pygraylog\n.. _requests: https://pypi.python.org/pypi/requests", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ajpen/chain", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "chain-py", "package_url": "https://pypi.org/project/chain-py/", "platform": "", "project_url": "https://pypi.org/project/chain-py/", "project_urls": { "Homepage": "https://github.com/ajpen/chain" }, "release_url": "https://pypi.org/project/chain-py/0.1.7/", "requires_dist": null, "requires_python": "", "summary": "An expressive clean way to interact with RESTful APIs.", "version": "0.1.7" }, "last_serial": 5557526, "releases": { "0.1.6": [ { "comment_text": "", "digests": { "md5": "9b70174083baacb2cfeb62287b40c254", "sha256": "deb1c53c05dd65193d603f53d3839cc6b352b54abc6924e5a07abe0988269567" }, "downloads": -1, "filename": "chain-py-0.1.6.tar.gz", "has_sig": false, "md5_digest": "9b70174083baacb2cfeb62287b40c254", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3651, "upload_time": "2019-07-19T16:37:05", "url": "https://files.pythonhosted.org/packages/d6/9a/2e968a2a2ff0e730a92d960bde5c183a6543a6ac3a07e01247d799a836b4/chain-py-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "73d9635734aa1914b66379437a7388a5", "sha256": "bbb6570a898947b973e2277e18991d248218c96b9a212e1829c5d8661a9d673d" }, "downloads": -1, "filename": "chain-py-0.1.7.tar.gz", "has_sig": false, "md5_digest": "73d9635734aa1914b66379437a7388a5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3618, "upload_time": "2019-07-19T16:46:32", "url": "https://files.pythonhosted.org/packages/bd/47/5a434f0f0eeb3b7e48547d1ef8c632caff108f365d7c1631c18f78a17d32/chain-py-0.1.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "73d9635734aa1914b66379437a7388a5", "sha256": "bbb6570a898947b973e2277e18991d248218c96b9a212e1829c5d8661a9d673d" }, "downloads": -1, "filename": "chain-py-0.1.7.tar.gz", "has_sig": false, "md5_digest": "73d9635734aa1914b66379437a7388a5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3618, "upload_time": "2019-07-19T16:46:32", "url": "https://files.pythonhosted.org/packages/bd/47/5a434f0f0eeb3b7e48547d1ef8c632caff108f365d7c1631c18f78a17d32/chain-py-0.1.7.tar.gz" } ] }