cryptodatapy 0.2.14__py3-none-any.whl → 0.2.16__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.
@@ -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:
@@ -123,6 +123,8 @@ class GetData:
123
123
  "get_assets_info",
124
124
  "get_markets_info",
125
125
  "get_fields_info",
126
+ "get_onchain_tickers_info",
127
+ "get_onchain_info",
126
128
  "get_frequencies_info",
127
129
  "get_rate_limit_info",
128
130
  "get_news_sources",