APIRetrys


NameAPIRetrys JSON
Version 0.0.3 PyPI version JSON
download
home_page
SummaryTo handle API request retries due to timeouts
upload_time2023-12-27 07:02:00
maintainer
docs_urlNone
authorRyosoraa (Rio Dwi Saputra)
requires_python
license
keywords python request retry api timeout auto
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
<h1 align="center" >Hello, I'm Ryo 👋</h1>



<h1 align="center" >Welcome To APIRetrys 🔥</h1>



> I created this library to make it easier for developers to handle time out requests that may be caused by network difficulties



## Feature



- automatically repeats if the request times out

- The number of repetitions and waiting time can be adjusted and default values ​​are provided

- maintain flexibility by returning all responses received

- provides logs to make monitoring easier, which can be turned on or not

- provides all the methods in the request



## Tech



- [requests](https://docs.python-requests.org/) is an easy-to-use Python library for interacting with APIs and making HTTP requests



## Requirement



- [Python](https://www.python.org/) v3.11.6+

- [requests](https://docs.python-requests.org/) 2.31.0+



## Installation



```sh

pip install APIRetrys

```



## Example Usage



Basic use



```python

from APIRetrys import ApiRetry



api = ApiRetry(show_logs=False)

response = api.get(url='https://github.com/')



# or you can define data types



from APIRetrys import ApiRetry

from requests import Response



api = ApiRetry(show_logs=False)

response: Response = api.get(url='https://github.com/')



```



With other parameters



```python

from APIRetrys import ApiRetry

from requests import Response



headers = {

   "PUBLIC-CSRF-TOKEN": '7giS6UPv3Rf2l9fclp2wFzCEI',

   "User-Agent": user_agent.random

}



payload = {

    "query":"anime",

    "page":1,

    "per_page":50,

    "sorting":"likes",

    "pro_first":"1",

    "filters":[],

    "additional_fields":[]

    }



cookies = {

    'PRIVATE-CSRF-TOKEN': '8Mc45%2BAa3Vd',

    'cf_clearance': 'rpQn91kojLw_ZCzrgjP',

    '__stripe_mid': '0adecf01-7471-434e-aa12-6c2d33cbb216fd19aa',

    'g_state': '{"i_p":1702902016560,"i_l":1}',

    'visitor-uuid': 'fbf18513-e803-',

    '__cf_bm': '_ukyfnf1.He..wDhIxF',

    '__stripe_sid': 'c7956d65-b70f-4e',

    'referrer-host': 'www.google.com'

}



api = ApiRetry(show_logs=False)

response: Response = api.post(url='https://github.com/', data=payload, cookies=cookies)

```



## 🚀Structure



```

│   LICENSE

│   README.md

│   setup.py

│

└───APIRetrys

        ApiRetrys.py

        Logs.py

        MaxRetryExceptions.py

        __init__.py

```



## Author



👤 **Rio Dwi Saputra**



- Twitter: [@ryosora12](https://twitter.com/ryosora12)

- Github: [@ryosoraa](https://github.com/ryosoraa)

- LinkedIn: [@rio-dwi-saputra-23560b287](https://www.linkedin.com/in/rio-dwi-saputra-23560b287/)



<a href="https://www.linkedin.com/in/ryosora/">

  <img align="left" alt="Ryo's LinkedIn" width="24px" src="https://cdn.jsdelivr.net/npm/simple-icons@v3/icons/linkedin.svg" />

</a>

<a href="https://www.instagram.com/ryosoraaa/">

  <img align="left" alt="Ryo's Instagram" width="24px" src="https://cdn.jsdelivr.net/npm/simple-icons@v3/icons/instagram.svg" />

</a>


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "APIRetrys",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "python,request,retry,api,timeout,auto",
    "author": "Ryosoraa (Rio Dwi Saputra)",
    "author_email": "<riodwi12174@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/13/68/e0e5d64d0302ae0a53b3411461fade9b49c7c49814672ecc72b0538e4298/APIRetrys-0.0.3.tar.gz",
    "platform": null,
    "description": "\r\n<h1 align=\"center\" >Hello, I'm Ryo \ud83d\udc4b</h1>\r\n\r\n\r\n\r\n<h1 align=\"center\" >Welcome To APIRetrys \ud83d\udd25</h1>\r\n\r\n\r\n\r\n> I created this library to make it easier for developers to handle time out requests that may be caused by network difficulties\r\n\r\n\r\n\r\n## Feature\r\n\r\n\r\n\r\n- automatically repeats if the request times out\r\n\r\n- The number of repetitions and waiting time can be adjusted and default values \u200b\u200bare provided\r\n\r\n- maintain flexibility by returning all responses received\r\n\r\n- provides logs to make monitoring easier, which can be turned on or not\r\n\r\n- provides all the methods in the request\r\n\r\n\r\n\r\n## Tech\r\n\r\n\r\n\r\n- [requests](https://docs.python-requests.org/) is an easy-to-use Python library for interacting with APIs and making HTTP requests\r\n\r\n\r\n\r\n## Requirement\r\n\r\n\r\n\r\n- [Python](https://www.python.org/) v3.11.6+\r\n\r\n- [requests](https://docs.python-requests.org/) 2.31.0+\r\n\r\n\r\n\r\n## Installation\r\n\r\n\r\n\r\n```sh\r\n\r\npip install APIRetrys\r\n\r\n```\r\n\r\n\r\n\r\n## Example Usage\r\n\r\n\r\n\r\nBasic use\r\n\r\n\r\n\r\n```python\r\n\r\nfrom APIRetrys import ApiRetry\r\n\r\n\r\n\r\napi = ApiRetry(show_logs=False)\r\n\r\nresponse = api.get(url='https://github.com/')\r\n\r\n\r\n\r\n# or you can define data types\r\n\r\n\r\n\r\nfrom APIRetrys import ApiRetry\r\n\r\nfrom requests import Response\r\n\r\n\r\n\r\napi = ApiRetry(show_logs=False)\r\n\r\nresponse: Response = api.get(url='https://github.com/')\r\n\r\n\r\n\r\n```\r\n\r\n\r\n\r\nWith other parameters\r\n\r\n\r\n\r\n```python\r\n\r\nfrom APIRetrys import ApiRetry\r\n\r\nfrom requests import Response\r\n\r\n\r\n\r\nheaders = {\r\n\r\n   \"PUBLIC-CSRF-TOKEN\": '7giS6UPv3Rf2l9fclp2wFzCEI',\r\n\r\n   \"User-Agent\": user_agent.random\r\n\r\n}\r\n\r\n\r\n\r\npayload = {\r\n\r\n    \"query\":\"anime\",\r\n\r\n    \"page\":1,\r\n\r\n    \"per_page\":50,\r\n\r\n    \"sorting\":\"likes\",\r\n\r\n    \"pro_first\":\"1\",\r\n\r\n    \"filters\":[],\r\n\r\n    \"additional_fields\":[]\r\n\r\n    }\r\n\r\n\r\n\r\ncookies = {\r\n\r\n    'PRIVATE-CSRF-TOKEN': '8Mc45%2BAa3Vd',\r\n\r\n    'cf_clearance': 'rpQn91kojLw_ZCzrgjP',\r\n\r\n    '__stripe_mid': '0adecf01-7471-434e-aa12-6c2d33cbb216fd19aa',\r\n\r\n    'g_state': '{\"i_p\":1702902016560,\"i_l\":1}',\r\n\r\n    'visitor-uuid': 'fbf18513-e803-',\r\n\r\n    '__cf_bm': '_ukyfnf1.He..wDhIxF',\r\n\r\n    '__stripe_sid': 'c7956d65-b70f-4e',\r\n\r\n    'referrer-host': 'www.google.com'\r\n\r\n}\r\n\r\n\r\n\r\napi = ApiRetry(show_logs=False)\r\n\r\nresponse: Response = api.post(url='https://github.com/', data=payload, cookies=cookies)\r\n\r\n```\r\n\r\n\r\n\r\n## \ud83d\ude80Structure\r\n\r\n\r\n\r\n```\r\n\r\n\u2502   LICENSE\r\n\r\n\u2502   README.md\r\n\r\n\u2502   setup.py\r\n\r\n\u2502\r\n\r\n\u2514\u2500\u2500\u2500APIRetrys\r\n\r\n        ApiRetrys.py\r\n\r\n        Logs.py\r\n\r\n        MaxRetryExceptions.py\r\n\r\n        __init__.py\r\n\r\n```\r\n\r\n\r\n\r\n## Author\r\n\r\n\r\n\r\n\ud83d\udc64 **Rio Dwi Saputra**\r\n\r\n\r\n\r\n- Twitter: [@ryosora12](https://twitter.com/ryosora12)\r\n\r\n- Github: [@ryosoraa](https://github.com/ryosoraa)\r\n\r\n- LinkedIn: [@rio-dwi-saputra-23560b287](https://www.linkedin.com/in/rio-dwi-saputra-23560b287/)\r\n\r\n\r\n\r\n<a href=\"https://www.linkedin.com/in/ryosora/\">\r\n\r\n  <img align=\"left\" alt=\"Ryo's LinkedIn\" width=\"24px\" src=\"https://cdn.jsdelivr.net/npm/simple-icons@v3/icons/linkedin.svg\" />\r\n\r\n</a>\r\n\r\n<a href=\"https://www.instagram.com/ryosoraaa/\">\r\n\r\n  <img align=\"left\" alt=\"Ryo's Instagram\" width=\"24px\" src=\"https://cdn.jsdelivr.net/npm/simple-icons@v3/icons/instagram.svg\" />\r\n\r\n</a>\r\n\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "To handle API request retries due to timeouts",
    "version": "0.0.3",
    "project_urls": null,
    "split_keywords": [
        "python",
        "request",
        "retry",
        "api",
        "timeout",
        "auto"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6c8957386beb8558d1c4fad1a312203d2f81b7f02cb30abe309b77e6fdb6cf73",
                "md5": "efd874b3c143383d0c699fea18896eda",
                "sha256": "cf9e34aad1865a051e35c6bfb71044401074781f8fc68de2adf6c75d05c83b9d"
            },
            "downloads": -1,
            "filename": "APIRetrys-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "efd874b3c143383d0c699fea18896eda",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5580,
            "upload_time": "2023-12-27T07:01:59",
            "upload_time_iso_8601": "2023-12-27T07:01:59.375606Z",
            "url": "https://files.pythonhosted.org/packages/6c/89/57386beb8558d1c4fad1a312203d2f81b7f02cb30abe309b77e6fdb6cf73/APIRetrys-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1368e0e5d64d0302ae0a53b3411461fade9b49c7c49814672ecc72b0538e4298",
                "md5": "69a391187470bfcba494f34ee961add8",
                "sha256": "97158ef96c30fe729abd7ba9fc85e5f7ae4ad0703a066162fa2431cca7d52e33"
            },
            "downloads": -1,
            "filename": "APIRetrys-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "69a391187470bfcba494f34ee961add8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5392,
            "upload_time": "2023-12-27T07:02:00",
            "upload_time_iso_8601": "2023-12-27T07:02:00.859759Z",
            "url": "https://files.pythonhosted.org/packages/13/68/e0e5d64d0302ae0a53b3411461fade9b49c7c49814672ecc72b0538e4298/APIRetrys-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-27 07:02:00",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "apiretrys"
}
        
Elapsed time: 0.38446s