{ "info": { "author": "Ilja Everil\u00e4", "author_email": "saarni@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3" ], "description": "furnish\n=======\n\nCreate HTTP API clients from Python. Inspired by Retrofit_.\n\n.. code:: python\n\n >>> import furnish\n\n >>> class FakeService:\n ...\n ... @furnish.get(\"/posts\")\n ... def all_posts(user_id: furnish.Query(Optional[int], \"userId\")=None): pass\n ...\n ... @furnish.post(\"/posts\")\n ... def create_post(post: furnish.Body(dict)): pass\n ...\n ... @furnish.post(\"/posts\")\n ... def create_post_json(post: furnish.Json()):\n ... \"\"\"\n ... Create a new post. Encode request data as JSON.\n ... \"\"\"\n ...\n ... @furnish.get(\"/posts/{id}\")\n ... def get_post(id: furnish.Path(int)): pass\n ...\n ... @furnish.put(\"/posts/{id}\")\n ... def replace_post(id: furnish.Path(int),\n ... post: furnish.Body(dict)): pass\n ...\n ... @furnish.patch(\"/posts/{id}\")\n ... def update_post(id: furnish.Path(int),\n ... post: furnish.Body(dict)): pass\n ...\n ... @furnish.delete(\"/posts/{id}\")\n ... def remove_post(id: furnish.Path(int)): pass\n ...\n ... @furnish.get(\"/comments\")\n ... def comments(post_id: furnish.Query(int, \"postId\")): pass\n ...\n\n >>> service = furnish.create(FakeService, \"https://jsonplaceholder.typicode.com\")\n\n >>> service.all_posts(user_id=2).json()\n [{'userId': 2,\n 'body': 'delectus reiciendis molestiae occaecati non minima eveniet qui voluptatibus\\naccusamus in eum beatae sit\\nvel qui neque voluptates ut commodi qui incidunt\\nut animi commodi',\n 'title': 'et ea vero quia laudantium autem',\n 'id': 11},\n ...\n\n >>> service.update_post(1, { 'title': 'New title' }).json()\n {'title': 'New title',\n 'id': 1,\n 'userId': 1,\n 'body': 'quia et suscipit\\nsuscipit recusandae consequuntur expedita et cum\\nreprehenderit molestiae ut ut quas totam\\nnostrum rerum est autem sunt rem eveniet architecto'}\n\nSupports simple deserialization of response bodies to Python objects:\n\n.. code:: python\n\n >>> import furnish\n\n >>> class Post:\n ... def __item__(self, *, id, title, body, userId):\n ... self.id = id\n ... self.title = title\n ... self.body = body\n ... self.userId = userId\n ...\n\n >>> class FakeService:\n ... @furnish.get(\"/posts/{id}\")\n ... def get_post(id: furnish.Path(int)) -> furnish.Response[Post]: pass\n ...\n\n >>> service = furnish.create(FakeService, \"https://jsonplaceholder.typicode.com\")\n\n >>> service.get_post(1).body()\n <__main__.Post object at 0x7f01ef00b208>\n\n >>> _.title\n 'sunt aut facere repellat provident occaecati excepturi optio reprehenderit'\n\nTODO\n----\n\n- Serialize according to annotations\n\nLicense\n-------\n\nThis package is licensed under the OSI MIT License.\n\n.. _Retrofit: http://square.github.io/retrofit/", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/everilae/furnish/archive/v0.2.1.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/everilae/furnish", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "furnish", "package_url": "https://pypi.org/project/furnish/", "platform": "", "project_url": "https://pypi.org/project/furnish/", "project_urls": { "Download": "https://github.com/everilae/furnish/archive/v0.2.1.tar.gz", "Homepage": "https://github.com/everilae/furnish" }, "release_url": "https://pypi.org/project/furnish/0.2.1/", "requires_dist": null, "requires_python": "", "summary": "Create HTTP API clients from Python.", "version": "0.2.1" }, "last_serial": 4208756, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "5395702895a5a06c8c0b16f977b2c5f5", "sha256": "30529fd204e20c5e9fdce2463aa5dc86af6ea0aac596c8db5a245571177cd266" }, "downloads": -1, "filename": "furnish-0.1.0.tar.gz", "has_sig": false, "md5_digest": "5395702895a5a06c8c0b16f977b2c5f5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3271, "upload_time": "2017-05-23T09:41:28", "url": "https://files.pythonhosted.org/packages/3b/22/f631c2d8ca468af930f48dc24cbd393715dc7c9c3361f3f70ef85b47bc9f/furnish-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "4113f49d69fcd1abc6393f0e4f67716c", "sha256": "9b23f67c25ae68c5174d1f07782d5ca1a5621909d3b6d055f131d5bb6a16192f" }, "downloads": -1, "filename": "furnish-0.1.1.tar.gz", "has_sig": false, "md5_digest": "4113f49d69fcd1abc6393f0e4f67716c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3284, "upload_time": "2017-05-23T09:51:56", "url": "https://files.pythonhosted.org/packages/de/3d/2e90e000811157bb0d417d25152b61d432481cb7337491d2f5ab896d3da8/furnish-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "c36321b9900e3095086cd5193d59012a", "sha256": "adb0f12b5687c61c08caa7e240439b952ca5481919ef8b6ae66991561f2a1705" }, "downloads": -1, "filename": "furnish-0.1.2.tar.gz", "has_sig": false, "md5_digest": "c36321b9900e3095086cd5193d59012a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4296, "upload_time": "2017-05-23T13:30:35", "url": "https://files.pythonhosted.org/packages/37/13/060ff4371c8e201b777fe4f908d764359222badbd270d73be0b31f0c62a1/furnish-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "be12a36237350c3886c31cfeddd90c55", "sha256": "5775b320430990b0732b68ca7f7d280ef61a51c7dcbc1fdb58bfba0c4e6866e7" }, "downloads": -1, "filename": "furnish-0.2.0.tar.gz", "has_sig": false, "md5_digest": "be12a36237350c3886c31cfeddd90c55", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4492, "upload_time": "2017-05-24T20:59:42", "url": "https://files.pythonhosted.org/packages/33/8a/a0eaa7de273ba370a3a5ed879c498161306df0dbce52777f99ae6db9b810/furnish-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "ef87fbb8dce8344a56b3397fc5857d1e", "sha256": "518e6963882fe83792d182899e1aa67549cf92dec4ba5136be27639e3233c041" }, "downloads": -1, "filename": "furnish-0.2.1.tar.gz", "has_sig": false, "md5_digest": "ef87fbb8dce8344a56b3397fc5857d1e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7837, "upload_time": "2018-08-26T17:27:47", "url": "https://files.pythonhosted.org/packages/f4/09/03acb671b41c5cf023bc1cb60500fb08a3f68ad1b148ff417b88fcc3c5d5/furnish-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ef87fbb8dce8344a56b3397fc5857d1e", "sha256": "518e6963882fe83792d182899e1aa67549cf92dec4ba5136be27639e3233c041" }, "downloads": -1, "filename": "furnish-0.2.1.tar.gz", "has_sig": false, "md5_digest": "ef87fbb8dce8344a56b3397fc5857d1e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7837, "upload_time": "2018-08-26T17:27:47", "url": "https://files.pythonhosted.org/packages/f4/09/03acb671b41c5cf023bc1cb60500fb08a3f68ad1b148ff417b88fcc3c5d5/furnish-0.2.1.tar.gz" } ] }