cryptodatapy 0.2.15__py3-none-any.whl → 0.2.17__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cryptodatapy/conf/fields.csv +1 -1
- cryptodatapy/extract/data_vendors/coinmetrics_api.py +32 -32
- cryptodatapy/extract/data_vendors/cryptocompare_api.py +159 -204
- cryptodatapy/extract/data_vendors/datavendor.py +21 -0
- cryptodatapy/extract/data_vendors/tiingo_api.py +5 -1
- cryptodatapy/extract/libraries/ccxt_api.py +215 -209
- cryptodatapy/transform/convertparams.py +35 -57
- cryptodatapy/util/datacredentials.py +18 -3
- {cryptodatapy-0.2.15.dist-info → cryptodatapy-0.2.17.dist-info}/METADATA +1 -1
- {cryptodatapy-0.2.15.dist-info → cryptodatapy-0.2.17.dist-info}/RECORD +12 -12
- {cryptodatapy-0.2.15.dist-info → cryptodatapy-0.2.17.dist-info}/LICENSE +0 -0
- {cryptodatapy-0.2.15.dist-info → cryptodatapy-0.2.17.dist-info}/WHEEL +0 -0
@@ -23,6 +23,7 @@ class DataVendor(ABC):
|
|
23
23
|
fields,
|
24
24
|
frequencies,
|
25
25
|
base_url,
|
26
|
+
api_endpoints,
|
26
27
|
api_key,
|
27
28
|
max_obs_per_call,
|
28
29
|
rate_limit,
|
@@ -36,6 +37,7 @@ class DataVendor(ABC):
|
|
36
37
|
self.fields = fields
|
37
38
|
self.frequencies = frequencies
|
38
39
|
self.base_url = base_url
|
40
|
+
self.api_endpoints = api_endpoints
|
39
41
|
self.api_key = api_key
|
40
42
|
self.max_obs_per_call = max_obs_per_call
|
41
43
|
self.rate_limit = rate_limit
|
@@ -340,6 +342,25 @@ class DataVendor(ABC):
|
|
340
342
|
" are appended."
|
341
343
|
)
|
342
344
|
|
345
|
+
@property
|
346
|
+
def api_endpoints(self):
|
347
|
+
"""
|
348
|
+
Returns api endpoints for the data vendor.
|
349
|
+
"""
|
350
|
+
return self._api_endpoints
|
351
|
+
|
352
|
+
@api_endpoints.setter
|
353
|
+
def api_endpoints(self, endpoints: Optional[Dict[str, str]]):
|
354
|
+
"""
|
355
|
+
Sets api endpoints for the data vendor.
|
356
|
+
"""
|
357
|
+
if endpoints is None or isinstance(endpoints, dict):
|
358
|
+
self._api_endpoints = endpoints
|
359
|
+
else:
|
360
|
+
raise TypeError(
|
361
|
+
"API endpoints must be a dict with key-value pairs of {endpoint_name: endpoint_path}."
|
362
|
+
)
|
363
|
+
|
343
364
|
@property
|
344
365
|
def api_key(self):
|
345
366
|
"""
|
@@ -31,6 +31,7 @@ class Tiingo(DataVendor):
|
|
31
31
|
"2h", "4h", "8h", "d", "w", "m", "q", "y"],
|
32
32
|
base_url: str = data_cred.tiingo_base_url,
|
33
33
|
api_key: str = data_cred.tiingo_api_key,
|
34
|
+
api_endpoints: Optional[Dict[str, str]] = None,
|
34
35
|
max_obs_per_call: Optional[int] = None,
|
35
36
|
rate_limit: Optional[Any] = None,
|
36
37
|
):
|
@@ -63,6 +64,9 @@ class Tiingo(DataVendor):
|
|
63
64
|
'8h', 'd', 'w', 'm']
|
64
65
|
base_url: str
|
65
66
|
Base url used for GET requests. If not provided, default is set to base_url stored in DataCredentials.
|
67
|
+
api_endpoints: dict, optional, default None
|
68
|
+
Dictionary with available API endpoints. If not provided, default is set to api_endpoints stored in
|
69
|
+
DataCredentials.
|
66
70
|
api_key: str
|
67
71
|
Api key, e.g. 'dcf13983adf7dfa79a0dfa35adf'. If not provided, default is set to
|
68
72
|
api_key stored in DataCredentials.
|
@@ -74,7 +78,7 @@ class Tiingo(DataVendor):
|
|
74
78
|
"""
|
75
79
|
super().__init__(
|
76
80
|
categories, exchanges, indexes, assets, markets, market_types,
|
77
|
-
fields, frequencies, base_url, api_key, max_obs_per_call, rate_limit
|
81
|
+
fields, frequencies, base_url, api_endpoints, api_key, max_obs_per_call, rate_limit
|
78
82
|
)
|
79
83
|
|
80
84
|
if api_key is None:
|