{ "info": { "author": "Yola", "author_email": "engineers@yola.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries" ], "description": "Demands\n=======\n\n|Build Status| |Coverage Status| |Latest Version| |Downloads|\n\nA base HTTP service client.\n\nBy default it \"demands\" successful responses from API endpoints,\notherwise it raises an exception.\n\nDemands accepts all the same parameters as ``requests.request`` and\nextends the ``requests.Session`` class, documentation for both:\n`Requests Developer\nInterface `__.\n\nWritten and used by the folks at Yola to support our `free website\nbuilder `__.\n\nHTTPServiceClient Overview\n--------------------------\n\n- base class for creating service clients\n- provides flexible way of http error handling for descendants\n- ``HTTPServiceError`` raised on unexpected service response\n\n- Supports pre-send and post-send hooks\n\nUsage\n-----\n\n.. code:: python\n\n from demands import HTTPServiceClient\n\n class MyService(HTTPServiceClient):\n def get_user(self, user_id):\n return self.get('/users/%s/' % user_id).json()\n\n def safe_get_user(self, user_id, default_user):\n response = self.get(\n '/users/%s/' % user_id, \n expected_response_codes=[404])\n return response.json() if response.is_ok else default_user\n\n\n service = MyService(url='http://localhost/')\n user = service.get_user(1234)\n\nAny parameters passed to the constructor will also be used for each and\nevery request:\n\n.. code:: python\n\n service = MyService(\n url='http://localhost/',\n headers={'h1':'value'},\n auth=('username','pass'),\n )\n\n # sent with auth and both headers\n user = service.get('/some-path', headers={'h2': 'kittens'})\n\nTesting\n-------\n\nInstall development requirements:\n\n::\n\n pip install -r requirements.txt\n\nRun the tests with:\n\n::\n\n nosetests\n\nAPI documentation\n-----------------\n\nTo generate the documentation:\n\n::\n\n cd docs && PYTHONPATH=.. make singlehtml\n\n.. |Build Status| image:: https://img.shields.io/travis/yola/demands.svg\n :target: https://travis-ci.org/yola/demands\n.. |Coverage Status| image:: https://img.shields.io/coveralls/yola/demands.svg\n :target: https://coveralls.io/r/yola/demands?branch=master\n.. |Latest Version| image:: https://img.shields.io/pypi/v/demands.svg\n :target: https://pypi.python.org/pypi/demands/\n.. |Downloads| image:: https://img.shields.io/pypi/dm/demands.svg\n :target: https://pypi.python.org/pypi/demands/", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/yola/demands", "keywords": null, "license": "MIT (Expat)", "maintainer": null, "maintainer_email": null, "name": "demands", "package_url": "https://pypi.org/project/demands/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/demands/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/yola/demands" }, "release_url": "https://pypi.org/project/demands/4.1.0/", "requires_dist": null, "requires_python": null, "summary": "Base HTTP service client", "version": "4.1.0" }, "last_serial": 2738943, "releases": { "1.0.5": [ { "comment_text": "", "digests": { "md5": "799c54a4f29f34138ce6ae7c02354de1", "sha256": "ba6abdcf56ddc7bf5400e8aad43930048f36775117e46d09fa0b1dc07a54a6bb" }, "downloads": -1, "filename": "demands-1.0.5.tar.gz", "has_sig": false, "md5_digest": "799c54a4f29f34138ce6ae7c02354de1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2695, "upload_time": "2014-02-24T15:38:31", "url": "https://files.pythonhosted.org/packages/ac/26/63f356bc6831d776a99e6cfbd98d52601a0d9d640d2be8e2c248d9b51abf/demands-1.0.5.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "24309bfb78ecf9074160dc317dd94d88", "sha256": "3055091015644a710e12f2161d6c8bc64cd90710fe2ac761bc888161031484eb" }, "downloads": -1, "filename": "demands-1.0.6.tar.gz", "has_sig": false, "md5_digest": "24309bfb78ecf9074160dc317dd94d88", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2780, "upload_time": "2015-04-01T07:43:40", "url": "https://files.pythonhosted.org/packages/90/63/f0793a204137d976563077029612fcc37e0e915be316038549c5f0f58c8d/demands-1.0.6.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "01c4b946e304ee5ea20d5234c8d74415", "sha256": "99140376039a86bbbfd167ec8495bee5d971cc51e3059c221ae7f27a7d683399" }, "downloads": -1, "filename": "demands-1.1.0.tar.gz", "has_sig": false, "md5_digest": "01c4b946e304ee5ea20d5234c8d74415", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4361, "upload_time": "2015-09-07T11:33:42", "url": "https://files.pythonhosted.org/packages/a6/83/8007e1c3d221161d3fc7ae363bab3fed7ba01aaa6e3117b2fa0ffca4c4e6/demands-1.1.0.tar.gz" } ], "1.1.3": [ { "comment_text": "", "digests": { "md5": "73242adf1a4ed94d5260c122e44edffb", "sha256": "4941bc3d4d0bdd81a9d9777b125e67208b06a94a4655d5d97c56cd99f77fc004" }, "downloads": -1, "filename": "demands-1.1.3.tar.gz", "has_sig": false, "md5_digest": "73242adf1a4ed94d5260c122e44edffb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4297, "upload_time": "2015-09-18T17:34:24", "url": "https://files.pythonhosted.org/packages/02/80/ea673e4e9a62e95c2613fc28d27010ab214d7069789749dc2cf06e454f70/demands-1.1.3.tar.gz" } ], "1.1.4": [], "1.1.5": [ { "comment_text": "", "digests": { "md5": "46a26c2cd689d2cb56cfb4e8430b2f09", "sha256": "cf4b68c0fb37b99129bacd762faeef33bbfdc5c48998d81ce66fa67f81008158" }, "downloads": -1, "filename": "demands-1.1.5.tar.gz", "has_sig": false, "md5_digest": "46a26c2cd689d2cb56cfb4e8430b2f09", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4361, "upload_time": "2015-11-23T18:33:43", "url": "https://files.pythonhosted.org/packages/ff/4c/76e5b69d62de35f950c526720bfcda647bd3573fab92471680c05f3aa6db/demands-1.1.5.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "943c02618ed3d39c1b3585a6936f4871", "sha256": "93c69c4a52219e4350f437de4cbfe916bc7640288387d91d927e5cfe3d6ba484" }, "downloads": -1, "filename": "demands-1.2.0.tar.gz", "has_sig": false, "md5_digest": "943c02618ed3d39c1b3585a6936f4871", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4598, "upload_time": "2015-11-25T18:54:58", "url": "https://files.pythonhosted.org/packages/21/22/9d950df3174bb00efa08d324b4c82ab79242034b7d51b8172069a937e182/demands-1.2.0.tar.gz" } ], "1.3.0": [ { "comment_text": "", "digests": { "md5": "8f04da79690a9670db843aee1fba5932", "sha256": "3375ae9301e6a2addc1e27d8e2fbefe9efd264544140ae41680e77c3e2bbad65" }, "downloads": -1, "filename": "demands-1.3.0.tar.gz", "has_sig": false, "md5_digest": "8f04da79690a9670db843aee1fba5932", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5180, "upload_time": "2016-03-29T21:38:48", "url": "https://files.pythonhosted.org/packages/f0/74/9e5428564adda04eb1b01db3b8489086bb7c182baf3b02bd740c06df51d8/demands-1.3.0.tar.gz" } ], "1.3.1": [ { "comment_text": "", "digests": { "md5": "97f8d52763fb8a240e704809633db5db", "sha256": "0980066d2dab77b5bbaa3d89a2319ecdd70cddcd9642e8a7f8c4c8e8633e16a8" }, "downloads": -1, "filename": "demands-1.3.1.tar.gz", "has_sig": false, "md5_digest": "97f8d52763fb8a240e704809633db5db", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11551, "upload_time": "2016-03-29T22:44:39", "url": "https://files.pythonhosted.org/packages/38/8a/3df58b015df2cfc85276db40d1c5e6f5fa3ad98f2fa366134dfc6826f77f/demands-1.3.1.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "d662536a4bda9694e75a52f2d40a12f2", "sha256": "59a12b1ffdeef8e7d09dff72bd8322a54e7ea5c4a9a3799f2c29217654d2b19e" }, "downloads": -1, "filename": "demands-2.0.0.tar.gz", "has_sig": false, "md5_digest": "d662536a4bda9694e75a52f2d40a12f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12031, "upload_time": "2016-04-19T19:27:44", "url": "https://files.pythonhosted.org/packages/67/3d/78dbd5c1a0678a62910f76e1e170229be771c7a5dc5148b1d776ddb20c20/demands-2.0.0.tar.gz" } ], "3.0.0": [ { "comment_text": "", "digests": { "md5": "e88e97164343d8abdd9e8cdaf6c692d9", "sha256": "796bad2385ce1f26b21abafa49c8e66738c37417d4229a5e89506a6f19355163" }, "downloads": -1, "filename": "demands-3.0.0.tar.gz", "has_sig": false, "md5_digest": "e88e97164343d8abdd9e8cdaf6c692d9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12071, "upload_time": "2016-04-20T18:55:57", "url": "https://files.pythonhosted.org/packages/27/c2/897a2c9d6ff860270fd360309d67253f34788f273df187c00c46f458597e/demands-3.0.0.tar.gz" } ], "4.0.0": [ { "comment_text": "", "digests": { "md5": "b5efcd72337e1460256f79693253deb6", "sha256": "b10f72be24d8dfa7bc021d4094150aba9f2f1768160ac307d10c2c6fc98d5d02" }, "downloads": -1, "filename": "demands-4.0.0.tar.gz", "has_sig": false, "md5_digest": "b5efcd72337e1460256f79693253deb6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11938, "upload_time": "2016-10-07T11:22:51", "url": "https://files.pythonhosted.org/packages/c0/67/cfb492d1c9caedcf97037faf865165d695c687a45afc79841786533b16ed/demands-4.0.0.tar.gz" } ], "4.1.0": [ { "comment_text": "", "digests": { "md5": "4e5c0856ec46393d76d8d41e09d882d1", "sha256": "80ced1f11f29bb37c13684d553fa27a754df83b33e3977f041595c5fc429120e" }, "downloads": -1, "filename": "demands-4.1.0.tar.gz", "has_sig": false, "md5_digest": "4e5c0856ec46393d76d8d41e09d882d1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12099, "upload_time": "2017-03-29T15:12:39", "url": "https://files.pythonhosted.org/packages/d5/81/5bb2b20f7ee385910ed3ba379c60243c4d2a6409b77f79f059e7ff6fc8f7/demands-4.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4e5c0856ec46393d76d8d41e09d882d1", "sha256": "80ced1f11f29bb37c13684d553fa27a754df83b33e3977f041595c5fc429120e" }, "downloads": -1, "filename": "demands-4.1.0.tar.gz", "has_sig": false, "md5_digest": "4e5c0856ec46393d76d8d41e09d882d1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12099, "upload_time": "2017-03-29T15:12:39", "url": "https://files.pythonhosted.org/packages/d5/81/5bb2b20f7ee385910ed3ba379c60243c4d2a6409b77f79f059e7ff6fc8f7/demands-4.1.0.tar.gz" } ] }