{ "info": { "author": "Technerium", "author_email": "technerium@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# Fork of AnyAPI for our needs\n\n# AnyAPI\nAnyAPI is a library that I developed for myself to have better looking code instead putting URLs to everywhere I used dynamic method calls to access a endpoint.\n\n### Features\n* Have better looking code using dynamic method calls\n* Filters to help you to modify request, raise errors or log requests instead of writing functions everywhere.\n* Automatically changing proxy according to rate limits specified by you for every path\n\n\n***\n\n### Examples\nMaking GET request to https://httpbin.org/anything/endpoint\n```python\nfrom anyapi import AnyAPI\n\n\nbase_url = 'https://httpbin.org'\napi = AnyAPI(base_url)\n\napi.anything.endpoint.GET()\n```\nAs you can see dots are pretended as slash and at the end you should put dot and HTTP method you want to use in capital letters.\n\n***\n\nSetting header before every request\n```python\nimport datetime\nfrom anyapi import AnyAPI\n\n\ndef set_date_as_header(kwargs):\n now = datetime.datetime.now()\n kwargs['headers'].update({'date': now.strftime('%B %d %Y')})\n\n return kwargs\n\napi = AnyAPI('https://httpbin.org')\napi._filter_request.append(set_date_as_header)\n\nprint(api.anything.endpoint.GET().json())\n# output\n{\n 'args': {},\n 'data': '',\n 'files': {},\n 'form': {},\n 'headers': {\n 'Accept-Encoding': 'identity',\n 'Connection': 'close',\n 'Date': 'January 16 2019',\n 'Host': 'httpbin.org'\n },\n 'json': None,\n 'method': 'GET',\n 'origin': 'XX.XX.XX.XX',\n 'url': 'https://httpbin.org/anything/endpoint'\n}\n```\nAs you can see filter worked as expected and set `Date` header.\n\n***\n\nChanging proxy automatically after they reach their rate limit\n```python\nfrom anyapi import AnyAPI\n\nproxy_configuration = {\n 'default': proxy0,\n 'proxies': [proxy0, proxy1, proxy2,....], # don't forget to add default proxy!\n 'paths': {\n '/anything': rate_limit0,\n '/anything/endpoint': rate_limit1\n }\n}\n\napi = AnyAPI('https://httpbin.org', proxy_configuration=proxy_configuration)\n\nfor i in range(10):\n print(api.anything.endpoint.GET().json())\n```\nIf you check output of the all them you can see proxy changes when it reaches limit.\n\n### This library is not a new thing\nThere is a lot of libraries you can find out there for example [Uplink](https://github.com/prkumar/uplink/), [Hammock](https://github.com/kadirpekel/hammock) and many more\n\n***\n\n## Installation\nLibrary is avaible on PyPi so just run\n\n```\npip install anyapi\n```\n\n\n# To learn more about AnyAPI check [wiki page](https://github.com/FKLC/AnyAPI/wiki/)\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/technerium/SmoothAPI", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "SmoothAPI", "package_url": "https://pypi.org/project/SmoothAPI/", "platform": "", "project_url": "https://pypi.org/project/SmoothAPI/", "project_urls": { "Homepage": "https://github.com/technerium/SmoothAPI" }, "release_url": "https://pypi.org/project/SmoothAPI/1.0.3/", "requires_dist": [ "requests" ], "requires_python": "", "summary": "An API Wrapper For Every API", "version": "1.0.3" }, "last_serial": 4998716, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "6f152ffc18cba904c5af9ec3435918a1", "sha256": "c19a8a6f852fdc1b9ac1ea20a209882181495382e099af7c2cc33a78ad6637f5" }, "downloads": -1, "filename": "SmoothAPI-1.0.0.tar.gz", "has_sig": false, "md5_digest": "6f152ffc18cba904c5af9ec3435918a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3869, "upload_time": "2019-03-14T23:25:34", "url": "https://files.pythonhosted.org/packages/03/c6/408455fb4efa2894e8f37b526c7176d029ff99d175cb168065831182d149/SmoothAPI-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "66e20683e6e0369ba79e94ddc508943a", "sha256": "aa9b1c44a277f88b9ffced6e39660778b785e991e242ad090380760ffc059328" }, "downloads": -1, "filename": "SmoothAPI-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "66e20683e6e0369ba79e94ddc508943a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4710, "upload_time": "2019-03-27T11:09:42", "url": "https://files.pythonhosted.org/packages/4d/e4/39b0b7cfa67c468ba4b859187431f3458c10ef283eab05d28377b6f3309c/SmoothAPI-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ae5eabc318411422880b31d592c5a039", "sha256": "cbc607493dfa4a8dd7fc73a5e8390c03c6662b92fee0253f37340e6d481e4977" }, "downloads": -1, "filename": "SmoothAPI-1.0.1.tar.gz", "has_sig": false, "md5_digest": "ae5eabc318411422880b31d592c5a039", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3883, "upload_time": "2019-03-27T11:09:44", "url": "https://files.pythonhosted.org/packages/7e/b1/bbd2c11f83d7ac86a8f0fae3266841b29f33e280c2d00f3c0edcfa7faf5f/SmoothAPI-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "fe070042ffcb0eeea244c720af81946f", "sha256": "b3d07380ffe52ec6670d37174c1c50ebad4a80d03de0f0476a6628783594fcb8" }, "downloads": -1, "filename": "SmoothAPI-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "fe070042ffcb0eeea244c720af81946f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5117, "upload_time": "2019-03-28T13:52:38", "url": "https://files.pythonhosted.org/packages/78/d6/0b2d6443b86d28a2ead50f443364ab773fd58a32962ebe72cd0bd95e0414/SmoothAPI-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0c9f2a529587a6ee4dc06a067d098b83", "sha256": "fb038f95936f44bf465afcbf083fcd178a5045f8ccabb93a72f0487d6a8dc53c" }, "downloads": -1, "filename": "SmoothAPI-1.0.2.tar.gz", "has_sig": false, "md5_digest": "0c9f2a529587a6ee4dc06a067d098b83", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3702, "upload_time": "2019-03-28T13:52:39", "url": "https://files.pythonhosted.org/packages/2b/0e/cd6e2146dd4b8c20c956b310075aaa8c4675da4917df0a937a8ce4cf26d3/SmoothAPI-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "80abdd6d66f3f4fe7f52618ba8a70044", "sha256": "a6d72acf98994e2daf461f93ed5f4856a7fb95681cf526eb10fc556b340031cf" }, "downloads": -1, "filename": "SmoothAPI-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "80abdd6d66f3f4fe7f52618ba8a70044", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5267, "upload_time": "2019-03-28T16:52:08", "url": "https://files.pythonhosted.org/packages/a5/3b/d060ad16dcb4415d2c819e0261b726d46ff18a86597e3ac580d6e586dfa6/SmoothAPI-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8c0fb5101ea0c42c3d6de89baa535cba", "sha256": "1361659cb76ad09cefee13854c46c3987cc8107cb7090448c3fc8448791320d7" }, "downloads": -1, "filename": "SmoothAPI-1.0.3.tar.gz", "has_sig": false, "md5_digest": "8c0fb5101ea0c42c3d6de89baa535cba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3853, "upload_time": "2019-03-28T16:52:11", "url": "https://files.pythonhosted.org/packages/0e/00/30b862adca4a4514f0310a4fe79181f6cfc9cf68e588d63cef025467d94d/SmoothAPI-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "80abdd6d66f3f4fe7f52618ba8a70044", "sha256": "a6d72acf98994e2daf461f93ed5f4856a7fb95681cf526eb10fc556b340031cf" }, "downloads": -1, "filename": "SmoothAPI-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "80abdd6d66f3f4fe7f52618ba8a70044", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5267, "upload_time": "2019-03-28T16:52:08", "url": "https://files.pythonhosted.org/packages/a5/3b/d060ad16dcb4415d2c819e0261b726d46ff18a86597e3ac580d6e586dfa6/SmoothAPI-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8c0fb5101ea0c42c3d6de89baa535cba", "sha256": "1361659cb76ad09cefee13854c46c3987cc8107cb7090448c3fc8448791320d7" }, "downloads": -1, "filename": "SmoothAPI-1.0.3.tar.gz", "has_sig": false, "md5_digest": "8c0fb5101ea0c42c3d6de89baa535cba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3853, "upload_time": "2019-03-28T16:52:11", "url": "https://files.pythonhosted.org/packages/0e/00/30b862adca4a4514f0310a4fe79181f6cfc9cf68e588d63cef025467d94d/SmoothAPI-1.0.3.tar.gz" } ] }