{"id":23265478,"url":"https://github.com/ivanildobarauna-dev/api-to-dataframe","last_synced_at":"2025-03-06T10:24:41.637Z","repository":{"id":243723189,"uuid":"811626938","full_name":"ivanildobarauna-dev/api-to-dataframe","owner":"ivanildobarauna-dev","description":"Python library that simplifies obtaining data from API endpoints by converting them directly into Pandas DataFrames. This library offers robust features, including retry strategies for failed requests.","archived":false,"fork":false,"pushed_at":"2025-02-17T11:54:29.000Z","size":550,"stargazers_count":1,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T00:32:20.970Z","etag":null,"topics":["data-analysis","data-analytics","data-engineering","library","pypi-packages","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/api-to-dataframe/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ivanildobarauna-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/funding.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["IvanildoBarauna"]}},"created_at":"2024-06-07T01:24:21.000Z","updated_at":"2025-01-18T14:49:52.000Z","dependencies_parsed_at":"2024-06-10T22:04:07.034Z","dependency_job_id":"9a712d29-c291-4c42-85cb-c12357e4157b","html_url":"https://github.com/ivanildobarauna-dev/api-to-dataframe","commit_stats":null,"previous_names":["ivanildobarauna/api-to-dataframe","ivanildobarauna-dev/api-to-dataframe"],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanildobarauna-dev%2Fapi-to-dataframe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanildobarauna-dev%2Fapi-to-dataframe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanildobarauna-dev%2Fapi-to-dataframe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivanildobarauna-dev%2Fapi-to-dataframe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ivanildobarauna-dev","download_url":"https://codeload.github.com/ivanildobarauna-dev/api-to-dataframe/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242189329,"owners_count":20086555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-analysis","data-analytics","data-engineering","library","pypi-packages","python"],"created_at":"2024-12-19T15:29:58.084Z","updated_at":"2025-03-06T10:24:41.614Z","avatar_url":"https://github.com/ivanildobarauna-dev.png","language":"Python","funding_links":["https://github.com/sponsors/IvanildoBarauna"],"categories":[],"sub_categories":[],"readme":"# API to DataFrame\nPython library that simplifies obtaining data from API endpoints by converting them directly into Pandas DataFrames. This library offers robust features, including retry strategies for failed requests.\n\n[![Github](https://img.shields.io/badge/-Go_to_Github_repository-05122A?style=flat\u0026logo=github)](https://github.com/ivdatahub/api-to-dataframe)\n\n[![PyPI - Status](https://img.shields.io/pypi/status/api-to-dataframe?style=for-the-badge\u0026logo=pypi)](https://pypi.org/project/api-to-dataframe/)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/api-to-dataframe?style=for-the-badge\u0026logo=pypi)](https://pypi.org/project/api-to-dataframe/)\n[![PyPI - Version](https://img.shields.io/pypi/v/api-to-dataframe?style=for-the-badge\u0026logo=pypi)](https://pypi.org/project/api-to-dataframe/#history)\n\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/api-to-dataframe?style=for-the-badge\u0026logo=python)\n\n[![CI](https://img.shields.io/github/actions/workflow/status/ivdatahub/api-to-dataframe/CI.yaml?\u0026style=for-the-badge\u0026logo=githubactions\u0026cacheSeconds=60\u0026label=Tests+and+pre+build)](https://github.com/ivdatahub/api-to-dataframe/actions/workflows/CI.yaml)\n[![CD](https://img.shields.io/github/actions/workflow/status/ivdatahub/api-to-dataframe/CD.yaml?\u0026style=for-the-badge\u0026logo=githubactions\u0026cacheSeconds=60\u0026event=release\u0026label=Package_publication)](https://github.com/ivdatahub/api-to-dataframe/actions/workflows/CD.yaml)\n\n[![Codecov](https://img.shields.io/codecov/c/github/ivdatahub/api-to-dataframe?style=for-the-badge\u0026logo=codecov)](https://app.codecov.io/gh/ivdatahub/api-to-dataframe)\n\n## Project Stack\n\n![Python](https://img.shields.io/badge/-Python-05122A?style=flat\u0026logo=python)\u0026nbsp;\n![Docker](https://img.shields.io/badge/-Docker-05122A?style=flat\u0026logo=docker)\u0026nbsp;\n![Poetry](https://img.shields.io/badge/-Poetry-05122A?style=flat\u0026logo=poetry)\u0026nbsp;\n![GitHub Actions](https://img.shields.io/badge/-GitHub_Actions-05122A?style=flat\u0026logo=githubactions)\u0026nbsp;\n![CodeCov](https://img.shields.io/badge/-CodeCov-05122A?style=flat\u0026logo=codecov)\u0026nbsp;\n![pypi](https://img.shields.io/badge/-pypi-05122A?style=flat\u0026logo=pypi)\u0026nbsp;\n![pandas](https://img.shields.io/badge/-pandas-05122A?style=flat\u0026logo=pandas)\u0026nbsp;\n![pytest](https://img.shields.io/badge/-pytest-05122A?style=flat\u0026logo=pytest)\u0026nbsp;\n\n\n## Installation\n\nTo install the package using pip, use the following command:\n\n```sh\npip install api-to-dataframe\n```\n\nTo install the package using poetry, use the following command:\n\n```sh\npoetry add api-to-dataframe\n```\n\n## User Guide\n\n``` python\n## Importing library\nfrom api_to_dataframe import ClientBuilder, RetryStrategies\n\n# Create a client for simple ingest data from API (timeout 1 second)\nclient = ClientBuilder(endpoint=\"https://api.example.com\")\n\n# if you can define timeout with LINEAR_RETRY_STRATEGY and set headers:\nheaders = {\n    \"application_name\": \"api_to_dataframe\"\n}\nclient = ClientBuilder(endpoint=\"https://api.example.com\"\n                        ,retry_strategy=RetryStrategies.LINEAR_RETRY_STRATEGY\n                        ,connection_timeout=2\n                        ,headers=headers)\n\n# if you can define timeout with EXPONENTIAL_RETRY_STRATEGY and set headers:\nclient = ClientBuilder(endpoint=\"https://api.example.com\"\n                        ,retry_strategy=RetryStrategies.EXPONENTIAL_RETRY_STRATEGY\n                        ,connection_timeout=10\n                        ,headers=headers\n                        ,retries=5\n                        ,initial_delay=10)\n\n\n# Get data from the API\ndata = client.get_api_data()\n\n# Convert the data to a DataFrame\ndf = client.api_to_dataframe(data)\n\n# Display the DataFrame\nprint(df)\n```\n\n## Important notes:\n* **Opcionals Parameters:** The params timeout, retry_strategy and headers are opcionals.\n* **Default Params Value:** By default the quantity of retries is 3 and the time between retries is 1 second, but you can define manually.\n* **Max Of Retries:** For security of API Server there is a limit for quantity of retries, actually this value is 5, this value is defined in lib constant. You can inform any value in RETRIES param, but the lib only will try 5x.\n* **Exponential Retry Strategy:** The increment of time between retries is time passed in **initial_delay** param * 2 * the retry_number, e.g with initial_delay=2\n\n    RetryNumber  | WaitingTime\n    ------------ | -----------\n    2            |  2s\n    2            |  4s\n    3            |  6s\n    4            |  8s\n    5            |  10s\n* **Linear Retry Strategy:** The increment of time between retries is time passed in **initial_delay**\ne.g with initial_delay=2\n\n    RetryNumber  | WaitingTime\n    ------------ | -----------\n    1            |  2s\n    2            |  2s\n    3            |  2s\n    4            |  2s\n    5            |  2s\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanildobarauna-dev%2Fapi-to-dataframe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivanildobarauna-dev%2Fapi-to-dataframe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivanildobarauna-dev%2Fapi-to-dataframe/lists"}