Skip to content

Commit 4089df5

Browse files
Added custom timeout option for Shrimpy Api Client
1 parent c9bff1f commit 4089df5

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
setuptools.setup(
1515
name="shrimpy_python",
16-
version="0.0.9",
16+
version="0.0.10",
1717
author="ShrimpyOfficial",
1818
author_email="support@shrimpy.io",
1919
description="The Official Shrimpy API Python Client",

shrimpy/shrimpy_api_client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
class ShrimpyApiClient():
88
"""Authenticated access to the Shrimpy Developer API"""
99

10-
def __init__(self, key, secret):
10+
def __init__(self, key, secret, timeout=300):
1111
self.url = 'https://dev-api.shrimpy.io/v1/'
1212
self.auth_provider = None
13+
self.timeout = timeout
1314
if (key and secret):
1415
self.auth_provider = AuthProvider(key, secret)
1516
self.session = requests.Session()
@@ -473,7 +474,7 @@ def _call_endpoint(self, method, endpoint, params=None, data=None):
473474
params=params,
474475
data=data,
475476
auth=self.auth_provider,
476-
timeout=300
477+
timeout=self.timeout
477478
)
478479

479480
return api_request.json()

0 commit comments

Comments
 (0)