{ "info": { "author": "Aaron Madison", "author_email": "aaron.l.madison@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.5", "Topic :: Software Development", "Topic :: Software Development :: Libraries :: Application Frameworks", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "apyclient\n=========\n\nA Python API Client\n\n.. image:: https://travis-ci.org/madisona/apyclient.svg?branch=py3_json_fix\n :target: https://travis-ci.org/madisona/apyclient\n\nOverview\n--------\n\nAllows you to easily create client APIs in a highly customizable way.\n\n\nInstallation\n------------\nRequires python >= 2.6 and apysigner. Tests require 'mock' package.\n\n::\n\n pip install apyclient\n\n\nUsage\n-----\n\nYou are able to easily create a client Api class. The only requirement of\nthe API class is that it must have a \"HOST_NAME\" attribute declared. The API\nuses this host name to prepend to the endpoint when building the request.\n\n::\n\n class MyAPIClient(object):\n HOST_NAME = \"http://www.example.com\"\n\n @api_request(\"/api-endpoint/\")\n def fetch_some_stuff(some_var):\n return {\"the_variable\": some_var}\n\n my_client = MyApiClient()\n my_client.fetch_some_stuff(3)\n\nAnd that's it. The client will make an HTTP GET request by default with the\ndata provided by the decorated method.\n\nYou can also do a POST request by declaring ``method=\"POST\"`` in the api_request.\n\n::\n\n @api_request(\"/api-endpoint/\", method=\"POST\")\n def fetch_some_stuff(some_var):\n return {\"the_variable\": some_var}\n\n\nAnd finally, you are able to return a custom response class if you so desire.\nJust either provide a ``RESPONSE_CLASS`` on the api client class, or a\n``response_class`` on the api_request decorator. If you have a custom response\nclass declared both on the API client and on the api_request decorator, the\ndecorator will win because it is more specific. The response class must take\none argument on initialization, the original response.\n\n::\n\n class MyApiClient(object):\n HOST_NAME = \"http://www.example.com/api\n RESPONSE_CLASS = MyDefaultResponseClass\n\n @api_request(\"/api-endpoint/\")\n def fetch_some_stuff(some_var):\n return {\"the_variable\": some_var}\n\n @api_request(\"/api-endpoint/\", response_class=SpecializedResponseClass)\n def fetch_some_stuff(some_var):\n return {\"the_variable\": some_var}\n\n\nNew addition: Signed Requests\nThis was modeled after Google Maps signed request.\nWhen you have a situation where you want to secure an endpoint without login\nyou can use the signed request.\n\nThe concept is the API provider shares a client id and private key with the\nclient applications. The client applications then \"sign\" their requests\nto the provider using the client id and private key. When the provider\nreceives the request, it verifies that it can create the same signature\nusing the given client id.\n\nTake a look at the django-request-signer python package for some more information.", "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/madisona/apyclient", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "apyclient", "package_url": "https://pypi.org/project/apyclient/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/apyclient/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/madisona/apyclient" }, "release_url": "https://pypi.org/project/apyclient/0.3.1/", "requires_dist": null, "requires_python": null, "summary": "A Python Api Client", "version": "0.3.1" }, "last_serial": 2440145, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "d4a895e5c4022b9e82a223f72effa60c", "sha256": "79cefa2ef6a3536a22e320ea63ef0870fd79d388e1e509d06d24eedab15602c4" }, "downloads": -1, "filename": "apyclient-0.0.1.tar.gz", "has_sig": false, "md5_digest": "d4a895e5c4022b9e82a223f72effa60c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5309, "upload_time": "2012-04-20T03:02:03", "url": "https://files.pythonhosted.org/packages/e8/25/9ae63b41c1c4dba595b457b510e214cc83ac4dd96bc5747c96e32cc82344/apyclient-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "3dc0ae77fd346f600b3db148d8a7283b", "sha256": "8bf3a776de182450ab8062079a15daaacd0973990b9d45410c17d2ed3423716b" }, "downloads": -1, "filename": "apyclient-0.0.2.tar.gz", "has_sig": false, "md5_digest": "3dc0ae77fd346f600b3db148d8a7283b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6565, "upload_time": "2012-05-07T15:18:44", "url": "https://files.pythonhosted.org/packages/a6/e5/b2879483aa5fdac71a7f70a3a8ad2fae668a0655143e22e124387d3a06b6/apyclient-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "7c03dd64378580f54188cc4e4dd8110e", "sha256": "b23cc23c5b2b9f0fe75bab3074db56b5ea421f6225318778ccc2b6fb03b8cc25" }, "downloads": -1, "filename": "apyclient-0.0.3.tar.gz", "has_sig": false, "md5_digest": "7c03dd64378580f54188cc4e4dd8110e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7609, "upload_time": "2013-06-07T15:26:33", "url": "https://files.pythonhosted.org/packages/70/59/f0f768425e1c9636df54c97be36d8d65ae0fb19eec25bb012a5f75f8017a/apyclient-0.0.3.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "4ec90b7fa8f8d63a89a0599a9f4000e6", "sha256": "645c65fa12757f621951c472ca342dd31c1b7e693bba164437348960ec9e0a67" }, "downloads": -1, "filename": "apyclient-0.1.0.tar.gz", "has_sig": false, "md5_digest": "4ec90b7fa8f8d63a89a0599a9f4000e6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7805, "upload_time": "2015-09-09T14:05:10", "url": "https://files.pythonhosted.org/packages/e1/a3/0045f659136573c0b30c4c3139876cb6d3480fae8811b87a1198c127b154/apyclient-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "74e519a42d05b58941ffd8ef77c5c636", "sha256": "3144569614a2b2bc44f5ed7e95dfc882667fa5996bf5b9946e8def6806add634" }, "downloads": -1, "filename": "apyclient-0.2.0.tar.gz", "has_sig": false, "md5_digest": "74e519a42d05b58941ffd8ef77c5c636", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7907, "upload_time": "2015-11-05T15:13:14", "url": "https://files.pythonhosted.org/packages/9e/90/9ef111a9c9d70fd8fa3a340945e3dc6c2c420fdcf7265c3cb76fc70170b5/apyclient-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "5de6c9af3cc5c183c2c8cf0cbce271a6", "sha256": "170c03e862c922a44530d2638c406fbaab955a18e5d3965b8ca6e148ba4ebb4c" }, "downloads": -1, "filename": "apyclient-0.3.0.tar.gz", "has_sig": false, "md5_digest": "5de6c9af3cc5c183c2c8cf0cbce271a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7994, "upload_time": "2016-11-01T21:26:15", "url": "https://files.pythonhosted.org/packages/f8/3a/5a05453c9f44e95d6c816129d318511ceccc896acddd4db67c5eec0669e6/apyclient-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "f17ade6c17b8ee34f9669fb28e25dfba", "sha256": "174e0ac65a9d4dd126266669a0eb586149908981bb6f620501e3de93000fbcbd" }, "downloads": -1, "filename": "apyclient-0.3.1.tar.gz", "has_sig": false, "md5_digest": "f17ade6c17b8ee34f9669fb28e25dfba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8098, "upload_time": "2016-11-03T14:18:10", "url": "https://files.pythonhosted.org/packages/8b/cf/3eb033c6662a350aa313def5786b2da2025a20c8ebeda332b73a74ec23dc/apyclient-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f17ade6c17b8ee34f9669fb28e25dfba", "sha256": "174e0ac65a9d4dd126266669a0eb586149908981bb6f620501e3de93000fbcbd" }, "downloads": -1, "filename": "apyclient-0.3.1.tar.gz", "has_sig": false, "md5_digest": "f17ade6c17b8ee34f9669fb28e25dfba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8098, "upload_time": "2016-11-03T14:18:10", "url": "https://files.pythonhosted.org/packages/8b/cf/3eb033c6662a350aa313def5786b2da2025a20c8ebeda332b73a74ec23dc/apyclient-0.3.1.tar.gz" } ] }