APIRetry


NameAPIRetry JSON
Version 0.0.6 PyPI version JSON
download
home_page
SummaryTo handle API request retries due to timeouts
upload_time2023-12-27 06:08:06
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 APIRetry 🔥</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 APIRetry

```



## 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

│

└───APIRetry

    │   ApiRetrys.py

    │   __init__.py

    │

    ├───Exceptions

    │       MaxRetryExceptions.py

    │

    └───utils

            Logs.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": "APIRetry",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "python,request,retry,api,timeout,auto",
    "author": "Ryosoraa (Rio Dwi Saputra)",
    "author_email": "<mail@riodwi12174.com>",
    "download_url": "https://files.pythonhosted.org/packages/9e/dc/ee826bd2283a21eb7ab58e340499579fcff20c05c9624b965d75914ae904/APIRetry-0.0.6.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 APIRetry \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 APIRetry\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\u2500APIRetry\r\n\r\n    \u2502   ApiRetrys.py\r\n\r\n    \u2502   __init__.py\r\n\r\n    \u2502\r\n\r\n    \u251c\u2500\u2500\u2500Exceptions\r\n\r\n    \u2502       MaxRetryExceptions.py\r\n\r\n    \u2502\r\n\r\n    \u2514\u2500\u2500\u2500utils\r\n\r\n            Logs.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.6",
    "project_urls": null,
    "split_keywords": [
        "python",
        "request",
        "retry",
        "api",
        "timeout",
        "auto"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e59651eb40d5e31ef63e9773cf1c2c960280404a06d12ce47fe04fba83c3441a",
                "md5": "a6141d70846ff02f6e6832a685329376",
                "sha256": "29c77b185f4050fef320ec7533b5b5276896cac644328a5a06da4e865c18cd14"
            },
            "downloads": -1,
            "filename": "APIRetry-0.0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a6141d70846ff02f6e6832a685329376",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5586,
            "upload_time": "2023-12-27T06:08:03",
            "upload_time_iso_8601": "2023-12-27T06:08:03.406358Z",
            "url": "https://files.pythonhosted.org/packages/e5/96/51eb40d5e31ef63e9773cf1c2c960280404a06d12ce47fe04fba83c3441a/APIRetry-0.0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9edcee826bd2283a21eb7ab58e340499579fcff20c05c9624b965d75914ae904",
                "md5": "bd3923a1b8229956d8d7e72d7a4f3e57",
                "sha256": "075c5ee6090c77c785e9236fadade24b09fb25f0b63b79f8ed90706f453a92f5"
            },
            "downloads": -1,
            "filename": "APIRetry-0.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "bd3923a1b8229956d8d7e72d7a4f3e57",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5422,
            "upload_time": "2023-12-27T06:08:06",
            "upload_time_iso_8601": "2023-12-27T06:08:06.557142Z",
            "url": "https://files.pythonhosted.org/packages/9e/dc/ee826bd2283a21eb7ab58e340499579fcff20c05c9624b965d75914ae904/APIRetry-0.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-27 06:08:06",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "apiretry"
}
        
Elapsed time: 0.16175s