Skip to content

Commit 291b47a

Browse files
chore: Update Documentation + set quantity of retry to 3
1 parent 0be8cb4 commit 291b47a

File tree

4 files changed

+131
-31
lines changed

4 files changed

+131
-31
lines changed

README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,37 @@ To install the package using poetry, use the following command:
4545
poetry add api-to-dataframe
4646
```
4747

48-
## How to use it
48+
## User Guide
4949

5050
``` python
5151
## Importing library
5252
from api_to_dataframe import ClientBuilder, RetryStrategies
5353

54-
# Create a client for simple ingest data from API (timeout 5 seconds)
54+
# Create a client for simple ingest data from API (timeout 1 second)
5555
client = ClientBuilder(endpoint="https://api.example.com")
5656

57-
# if you can define timeout, use: (default is 5 seconds), with LinearStrategy (In development, actually don't nothing) and set headers:
57+
# if you can define timeout with LinearStrategy and set headers:
5858
headers = {
5959
"application_name": "api_to_dataframe"
6060
}
6161
client = ClientBuilder(endpoint="https://api.example.com"
6262
,retry_strategy=RetryStrategies.LinearStrategy
63-
,timeout=10
63+
,connection_timeout=2
6464
,headers=headers)
6565

66+
"""
67+
NOTE: by default the quantity of retries is 3 and the time between retries is 1 second, but you can define manually, like this:
68+
69+
"""
70+
71+
client = ClientBuilder(endpoint="https://api.example.com"
72+
,retry_strategy=RetryStrategies.LinearStrategy
73+
,connection_timeout=10
74+
,headers=headers
75+
,retries=5
76+
,delay=10)
77+
78+
6679
### timeout, retry_strategy and headers are opcionals parameters
6780

6881
# Get data from the API

0 commit comments

Comments
 (0)