crypticorn 2.1.5__py3-none-any.whl → 2.1.6__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.
- crypticorn/client.py +4 -0
- crypticorn/common/urls.py +1 -0
- crypticorn/klines/client/configuration.py +2 -2
- crypticorn/metrics/__init__.py +4 -0
- crypticorn/metrics/client/__init__.py +60 -0
- crypticorn/metrics/client/api/__init__.py +10 -0
- crypticorn/metrics/client/api/exchanges_api.py +1003 -0
- crypticorn/metrics/client/api/health_check_api.py +265 -0
- crypticorn/metrics/client/api/indicators_api.py +680 -0
- crypticorn/metrics/client/api/logs_api.py +356 -0
- crypticorn/metrics/client/api/marketcap_api.py +1315 -0
- crypticorn/metrics/client/api/markets_api.py +618 -0
- crypticorn/metrics/client/api/tokens_api.py +300 -0
- crypticorn/metrics/client/api_client.py +758 -0
- crypticorn/metrics/client/api_response.py +20 -0
- crypticorn/metrics/client/configuration.py +575 -0
- crypticorn/metrics/client/exceptions.py +220 -0
- crypticorn/metrics/client/models/__init__.py +37 -0
- crypticorn/metrics/client/models/base_response_dict.py +106 -0
- crypticorn/metrics/client/models/base_response_health_check_response.py +114 -0
- crypticorn/metrics/client/models/base_response_list_dict.py +106 -0
- crypticorn/metrics/client/models/base_response_list_exchange_mapping.py +118 -0
- crypticorn/metrics/client/models/base_response_list_str.py +106 -0
- crypticorn/metrics/client/models/error_response.py +109 -0
- crypticorn/metrics/client/models/exchange_mapping.py +132 -0
- crypticorn/metrics/client/models/health_check_response.py +91 -0
- crypticorn/metrics/client/models/http_validation_error.py +99 -0
- crypticorn/metrics/client/models/market.py +35 -0
- crypticorn/metrics/client/models/severity.py +36 -0
- crypticorn/metrics/client/models/validation_error.py +105 -0
- crypticorn/metrics/client/models/validation_error_loc_inner.py +159 -0
- crypticorn/metrics/client/py.typed +0 -0
- crypticorn/metrics/client/rest.py +195 -0
- crypticorn/metrics/main.py +112 -0
- {crypticorn-2.1.5.dist-info → crypticorn-2.1.6.dist-info}/METADATA +1 -1
- {crypticorn-2.1.5.dist-info → crypticorn-2.1.6.dist-info}/RECORD +38 -7
- {crypticorn-2.1.5.dist-info → crypticorn-2.1.6.dist-info}/WHEEL +0 -0
- {crypticorn-2.1.5.dist-info → crypticorn-2.1.6.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,680 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Marketcap Service API
|
5
|
+
|
6
|
+
API for retrieving historical marketcap data, available exchanges, and indicators. ## Features - Historical marketcap data - OHLCV data with marketcap - Technical indicators (KER, SMA) - Exchange and symbol mappings - Error logs
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
import warnings
|
15
|
+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
16
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
17
|
+
from typing_extensions import Annotated
|
18
|
+
|
19
|
+
from pydantic import Field, StrictInt, StrictStr
|
20
|
+
from typing import Optional
|
21
|
+
from typing_extensions import Annotated
|
22
|
+
from crypticorn.metrics.client.models.base_response_dict import BaseResponseDict
|
23
|
+
from crypticorn.metrics.client.models.market import Market
|
24
|
+
|
25
|
+
from crypticorn.metrics.client.api_client import ApiClient, RequestSerialized
|
26
|
+
from crypticorn.metrics.client.api_response import ApiResponse
|
27
|
+
from crypticorn.metrics.client.rest import RESTResponseType
|
28
|
+
|
29
|
+
|
30
|
+
class IndicatorsApi:
|
31
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
32
|
+
Ref: https://openapi-generator.tech
|
33
|
+
|
34
|
+
Do not edit the class manually.
|
35
|
+
"""
|
36
|
+
|
37
|
+
def __init__(self, api_client=None) -> None:
|
38
|
+
if api_client is None:
|
39
|
+
api_client = ApiClient.get_default()
|
40
|
+
self.api_client = api_client
|
41
|
+
|
42
|
+
@validate_call
|
43
|
+
async def get_ker_indicator(
|
44
|
+
self,
|
45
|
+
symbol: StrictStr,
|
46
|
+
market: Annotated[Optional[Market], Field(description="Market")] = None,
|
47
|
+
period: Annotated[
|
48
|
+
Optional[StrictInt], Field(description="KER indicator period")
|
49
|
+
] = None,
|
50
|
+
timestamp: Annotated[
|
51
|
+
Optional[StrictInt],
|
52
|
+
Field(description="Timestamp for which to fetch KER indicator"),
|
53
|
+
] = None,
|
54
|
+
_request_timeout: Union[
|
55
|
+
None,
|
56
|
+
Annotated[StrictFloat, Field(gt=0)],
|
57
|
+
Tuple[
|
58
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
59
|
+
],
|
60
|
+
] = None,
|
61
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
62
|
+
_content_type: Optional[StrictStr] = None,
|
63
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
64
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
65
|
+
) -> BaseResponseDict:
|
66
|
+
"""Get Ker Indicator
|
67
|
+
|
68
|
+
Calculate and retrieve the KER indicator for a symbol.
|
69
|
+
|
70
|
+
:param symbol: (required)
|
71
|
+
:type symbol: str
|
72
|
+
:param market: Market
|
73
|
+
:type market: Market
|
74
|
+
:param period: KER indicator period
|
75
|
+
:type period: int
|
76
|
+
:param timestamp: Timestamp for which to fetch KER indicator
|
77
|
+
:type timestamp: int
|
78
|
+
:param _request_timeout: timeout setting for this request. If one
|
79
|
+
number provided, it will be total request
|
80
|
+
timeout. It can also be a pair (tuple) of
|
81
|
+
(connection, read) timeouts.
|
82
|
+
:type _request_timeout: int, tuple(int, int), optional
|
83
|
+
:param _request_auth: set to override the auth_settings for an a single
|
84
|
+
request; this effectively ignores the
|
85
|
+
authentication in the spec for a single request.
|
86
|
+
:type _request_auth: dict, optional
|
87
|
+
:param _content_type: force content-type for the request.
|
88
|
+
:type _content_type: str, Optional
|
89
|
+
:param _headers: set to override the headers for a single
|
90
|
+
request; this effectively ignores the headers
|
91
|
+
in the spec for a single request.
|
92
|
+
:type _headers: dict, optional
|
93
|
+
:param _host_index: set to override the host_index for a single
|
94
|
+
request; this effectively ignores the host_index
|
95
|
+
in the spec for a single request.
|
96
|
+
:type _host_index: int, optional
|
97
|
+
:return: Returns the result object.
|
98
|
+
""" # noqa: E501
|
99
|
+
|
100
|
+
_param = self._get_ker_indicator_serialize(
|
101
|
+
symbol=symbol,
|
102
|
+
market=market,
|
103
|
+
period=period,
|
104
|
+
timestamp=timestamp,
|
105
|
+
_request_auth=_request_auth,
|
106
|
+
_content_type=_content_type,
|
107
|
+
_headers=_headers,
|
108
|
+
_host_index=_host_index,
|
109
|
+
)
|
110
|
+
|
111
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
112
|
+
"200": "BaseResponseDict",
|
113
|
+
"400": "ErrorResponse",
|
114
|
+
"404": "ErrorResponse",
|
115
|
+
"500": "ErrorResponse",
|
116
|
+
"422": "HTTPValidationError",
|
117
|
+
}
|
118
|
+
response_data = await self.api_client.call_api(
|
119
|
+
*_param, _request_timeout=_request_timeout
|
120
|
+
)
|
121
|
+
await response_data.read()
|
122
|
+
return self.api_client.response_deserialize(
|
123
|
+
response_data=response_data,
|
124
|
+
response_types_map=_response_types_map,
|
125
|
+
).data
|
126
|
+
|
127
|
+
@validate_call
|
128
|
+
async def get_ker_indicator_with_http_info(
|
129
|
+
self,
|
130
|
+
symbol: StrictStr,
|
131
|
+
market: Annotated[Optional[Market], Field(description="Market")] = None,
|
132
|
+
period: Annotated[
|
133
|
+
Optional[StrictInt], Field(description="KER indicator period")
|
134
|
+
] = None,
|
135
|
+
timestamp: Annotated[
|
136
|
+
Optional[StrictInt],
|
137
|
+
Field(description="Timestamp for which to fetch KER indicator"),
|
138
|
+
] = None,
|
139
|
+
_request_timeout: Union[
|
140
|
+
None,
|
141
|
+
Annotated[StrictFloat, Field(gt=0)],
|
142
|
+
Tuple[
|
143
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
144
|
+
],
|
145
|
+
] = None,
|
146
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
147
|
+
_content_type: Optional[StrictStr] = None,
|
148
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
149
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
150
|
+
) -> ApiResponse[BaseResponseDict]:
|
151
|
+
"""Get Ker Indicator
|
152
|
+
|
153
|
+
Calculate and retrieve the KER indicator for a symbol.
|
154
|
+
|
155
|
+
:param symbol: (required)
|
156
|
+
:type symbol: str
|
157
|
+
:param market: Market
|
158
|
+
:type market: Market
|
159
|
+
:param period: KER indicator period
|
160
|
+
:type period: int
|
161
|
+
:param timestamp: Timestamp for which to fetch KER indicator
|
162
|
+
:type timestamp: int
|
163
|
+
:param _request_timeout: timeout setting for this request. If one
|
164
|
+
number provided, it will be total request
|
165
|
+
timeout. It can also be a pair (tuple) of
|
166
|
+
(connection, read) timeouts.
|
167
|
+
:type _request_timeout: int, tuple(int, int), optional
|
168
|
+
:param _request_auth: set to override the auth_settings for an a single
|
169
|
+
request; this effectively ignores the
|
170
|
+
authentication in the spec for a single request.
|
171
|
+
:type _request_auth: dict, optional
|
172
|
+
:param _content_type: force content-type for the request.
|
173
|
+
:type _content_type: str, Optional
|
174
|
+
:param _headers: set to override the headers for a single
|
175
|
+
request; this effectively ignores the headers
|
176
|
+
in the spec for a single request.
|
177
|
+
:type _headers: dict, optional
|
178
|
+
:param _host_index: set to override the host_index for a single
|
179
|
+
request; this effectively ignores the host_index
|
180
|
+
in the spec for a single request.
|
181
|
+
:type _host_index: int, optional
|
182
|
+
:return: Returns the result object.
|
183
|
+
""" # noqa: E501
|
184
|
+
|
185
|
+
_param = self._get_ker_indicator_serialize(
|
186
|
+
symbol=symbol,
|
187
|
+
market=market,
|
188
|
+
period=period,
|
189
|
+
timestamp=timestamp,
|
190
|
+
_request_auth=_request_auth,
|
191
|
+
_content_type=_content_type,
|
192
|
+
_headers=_headers,
|
193
|
+
_host_index=_host_index,
|
194
|
+
)
|
195
|
+
|
196
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
197
|
+
"200": "BaseResponseDict",
|
198
|
+
"400": "ErrorResponse",
|
199
|
+
"404": "ErrorResponse",
|
200
|
+
"500": "ErrorResponse",
|
201
|
+
"422": "HTTPValidationError",
|
202
|
+
}
|
203
|
+
response_data = await self.api_client.call_api(
|
204
|
+
*_param, _request_timeout=_request_timeout
|
205
|
+
)
|
206
|
+
await response_data.read()
|
207
|
+
return self.api_client.response_deserialize(
|
208
|
+
response_data=response_data,
|
209
|
+
response_types_map=_response_types_map,
|
210
|
+
)
|
211
|
+
|
212
|
+
@validate_call
|
213
|
+
async def get_ker_indicator_without_preload_content(
|
214
|
+
self,
|
215
|
+
symbol: StrictStr,
|
216
|
+
market: Annotated[Optional[Market], Field(description="Market")] = None,
|
217
|
+
period: Annotated[
|
218
|
+
Optional[StrictInt], Field(description="KER indicator period")
|
219
|
+
] = None,
|
220
|
+
timestamp: Annotated[
|
221
|
+
Optional[StrictInt],
|
222
|
+
Field(description="Timestamp for which to fetch KER indicator"),
|
223
|
+
] = None,
|
224
|
+
_request_timeout: Union[
|
225
|
+
None,
|
226
|
+
Annotated[StrictFloat, Field(gt=0)],
|
227
|
+
Tuple[
|
228
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
229
|
+
],
|
230
|
+
] = None,
|
231
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
232
|
+
_content_type: Optional[StrictStr] = None,
|
233
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
234
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
235
|
+
) -> RESTResponseType:
|
236
|
+
"""Get Ker Indicator
|
237
|
+
|
238
|
+
Calculate and retrieve the KER indicator for a symbol.
|
239
|
+
|
240
|
+
:param symbol: (required)
|
241
|
+
:type symbol: str
|
242
|
+
:param market: Market
|
243
|
+
:type market: Market
|
244
|
+
:param period: KER indicator period
|
245
|
+
:type period: int
|
246
|
+
:param timestamp: Timestamp for which to fetch KER indicator
|
247
|
+
:type timestamp: int
|
248
|
+
:param _request_timeout: timeout setting for this request. If one
|
249
|
+
number provided, it will be total request
|
250
|
+
timeout. It can also be a pair (tuple) of
|
251
|
+
(connection, read) timeouts.
|
252
|
+
:type _request_timeout: int, tuple(int, int), optional
|
253
|
+
:param _request_auth: set to override the auth_settings for an a single
|
254
|
+
request; this effectively ignores the
|
255
|
+
authentication in the spec for a single request.
|
256
|
+
:type _request_auth: dict, optional
|
257
|
+
:param _content_type: force content-type for the request.
|
258
|
+
:type _content_type: str, Optional
|
259
|
+
:param _headers: set to override the headers for a single
|
260
|
+
request; this effectively ignores the headers
|
261
|
+
in the spec for a single request.
|
262
|
+
:type _headers: dict, optional
|
263
|
+
:param _host_index: set to override the host_index for a single
|
264
|
+
request; this effectively ignores the host_index
|
265
|
+
in the spec for a single request.
|
266
|
+
:type _host_index: int, optional
|
267
|
+
:return: Returns the result object.
|
268
|
+
""" # noqa: E501
|
269
|
+
|
270
|
+
_param = self._get_ker_indicator_serialize(
|
271
|
+
symbol=symbol,
|
272
|
+
market=market,
|
273
|
+
period=period,
|
274
|
+
timestamp=timestamp,
|
275
|
+
_request_auth=_request_auth,
|
276
|
+
_content_type=_content_type,
|
277
|
+
_headers=_headers,
|
278
|
+
_host_index=_host_index,
|
279
|
+
)
|
280
|
+
|
281
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
282
|
+
"200": "BaseResponseDict",
|
283
|
+
"400": "ErrorResponse",
|
284
|
+
"404": "ErrorResponse",
|
285
|
+
"500": "ErrorResponse",
|
286
|
+
"422": "HTTPValidationError",
|
287
|
+
}
|
288
|
+
response_data = await self.api_client.call_api(
|
289
|
+
*_param, _request_timeout=_request_timeout
|
290
|
+
)
|
291
|
+
return response_data.response
|
292
|
+
|
293
|
+
def _get_ker_indicator_serialize(
|
294
|
+
self,
|
295
|
+
symbol,
|
296
|
+
market,
|
297
|
+
period,
|
298
|
+
timestamp,
|
299
|
+
_request_auth,
|
300
|
+
_content_type,
|
301
|
+
_headers,
|
302
|
+
_host_index,
|
303
|
+
) -> RequestSerialized:
|
304
|
+
|
305
|
+
_host = None
|
306
|
+
|
307
|
+
_collection_formats: Dict[str, str] = {}
|
308
|
+
|
309
|
+
_path_params: Dict[str, str] = {}
|
310
|
+
_query_params: List[Tuple[str, str]] = []
|
311
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
312
|
+
_form_params: List[Tuple[str, str]] = []
|
313
|
+
_files: Dict[
|
314
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
315
|
+
] = {}
|
316
|
+
_body_params: Optional[bytes] = None
|
317
|
+
|
318
|
+
# process the path parameters
|
319
|
+
if symbol is not None:
|
320
|
+
_path_params["symbol"] = symbol
|
321
|
+
# process the query parameters
|
322
|
+
if market is not None:
|
323
|
+
|
324
|
+
_query_params.append(("market", market.value))
|
325
|
+
|
326
|
+
if period is not None:
|
327
|
+
|
328
|
+
_query_params.append(("period", period))
|
329
|
+
|
330
|
+
if timestamp is not None:
|
331
|
+
|
332
|
+
_query_params.append(("timestamp", timestamp))
|
333
|
+
|
334
|
+
# process the header parameters
|
335
|
+
# process the form parameters
|
336
|
+
# process the body parameter
|
337
|
+
|
338
|
+
# set the HTTP header `Accept`
|
339
|
+
if "Accept" not in _header_params:
|
340
|
+
_header_params["Accept"] = self.api_client.select_header_accept(
|
341
|
+
["application/json"]
|
342
|
+
)
|
343
|
+
|
344
|
+
# authentication setting
|
345
|
+
_auth_settings: List[str] = []
|
346
|
+
|
347
|
+
return self.api_client.param_serialize(
|
348
|
+
method="GET",
|
349
|
+
resource_path="/ker/{symbol}",
|
350
|
+
path_params=_path_params,
|
351
|
+
query_params=_query_params,
|
352
|
+
header_params=_header_params,
|
353
|
+
body=_body_params,
|
354
|
+
post_params=_form_params,
|
355
|
+
files=_files,
|
356
|
+
auth_settings=_auth_settings,
|
357
|
+
collection_formats=_collection_formats,
|
358
|
+
_host=_host,
|
359
|
+
_request_auth=_request_auth,
|
360
|
+
)
|
361
|
+
|
362
|
+
@validate_call
|
363
|
+
async def get_sma_indicator(
|
364
|
+
self,
|
365
|
+
symbol: StrictStr,
|
366
|
+
market: Annotated[Optional[Market], Field(description="Market")] = None,
|
367
|
+
period: Annotated[
|
368
|
+
Optional[StrictInt], Field(description="SMA indicator period")
|
369
|
+
] = None,
|
370
|
+
timestamp: Annotated[
|
371
|
+
Optional[StrictInt],
|
372
|
+
Field(description="Timestamp for which to fetch SMA indicator"),
|
373
|
+
] = None,
|
374
|
+
_request_timeout: Union[
|
375
|
+
None,
|
376
|
+
Annotated[StrictFloat, Field(gt=0)],
|
377
|
+
Tuple[
|
378
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
379
|
+
],
|
380
|
+
] = None,
|
381
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
382
|
+
_content_type: Optional[StrictStr] = None,
|
383
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
384
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
385
|
+
) -> BaseResponseDict:
|
386
|
+
"""Get Sma Indicator
|
387
|
+
|
388
|
+
Calculate and retrieve the Simple Moving Average (SMA) indicator for a symbol.
|
389
|
+
|
390
|
+
:param symbol: (required)
|
391
|
+
:type symbol: str
|
392
|
+
:param market: Market
|
393
|
+
:type market: Market
|
394
|
+
:param period: SMA indicator period
|
395
|
+
:type period: int
|
396
|
+
:param timestamp: Timestamp for which to fetch SMA indicator
|
397
|
+
:type timestamp: int
|
398
|
+
:param _request_timeout: timeout setting for this request. If one
|
399
|
+
number provided, it will be total request
|
400
|
+
timeout. It can also be a pair (tuple) of
|
401
|
+
(connection, read) timeouts.
|
402
|
+
:type _request_timeout: int, tuple(int, int), optional
|
403
|
+
:param _request_auth: set to override the auth_settings for an a single
|
404
|
+
request; this effectively ignores the
|
405
|
+
authentication in the spec for a single request.
|
406
|
+
:type _request_auth: dict, optional
|
407
|
+
:param _content_type: force content-type for the request.
|
408
|
+
:type _content_type: str, Optional
|
409
|
+
:param _headers: set to override the headers for a single
|
410
|
+
request; this effectively ignores the headers
|
411
|
+
in the spec for a single request.
|
412
|
+
:type _headers: dict, optional
|
413
|
+
:param _host_index: set to override the host_index for a single
|
414
|
+
request; this effectively ignores the host_index
|
415
|
+
in the spec for a single request.
|
416
|
+
:type _host_index: int, optional
|
417
|
+
:return: Returns the result object.
|
418
|
+
""" # noqa: E501
|
419
|
+
|
420
|
+
_param = self._get_sma_indicator_serialize(
|
421
|
+
symbol=symbol,
|
422
|
+
market=market,
|
423
|
+
period=period,
|
424
|
+
timestamp=timestamp,
|
425
|
+
_request_auth=_request_auth,
|
426
|
+
_content_type=_content_type,
|
427
|
+
_headers=_headers,
|
428
|
+
_host_index=_host_index,
|
429
|
+
)
|
430
|
+
|
431
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
432
|
+
"200": "BaseResponseDict",
|
433
|
+
"400": "ErrorResponse",
|
434
|
+
"404": "ErrorResponse",
|
435
|
+
"500": "ErrorResponse",
|
436
|
+
"422": "HTTPValidationError",
|
437
|
+
}
|
438
|
+
response_data = await self.api_client.call_api(
|
439
|
+
*_param, _request_timeout=_request_timeout
|
440
|
+
)
|
441
|
+
await response_data.read()
|
442
|
+
return self.api_client.response_deserialize(
|
443
|
+
response_data=response_data,
|
444
|
+
response_types_map=_response_types_map,
|
445
|
+
).data
|
446
|
+
|
447
|
+
@validate_call
|
448
|
+
async def get_sma_indicator_with_http_info(
|
449
|
+
self,
|
450
|
+
symbol: StrictStr,
|
451
|
+
market: Annotated[Optional[Market], Field(description="Market")] = None,
|
452
|
+
period: Annotated[
|
453
|
+
Optional[StrictInt], Field(description="SMA indicator period")
|
454
|
+
] = None,
|
455
|
+
timestamp: Annotated[
|
456
|
+
Optional[StrictInt],
|
457
|
+
Field(description="Timestamp for which to fetch SMA indicator"),
|
458
|
+
] = None,
|
459
|
+
_request_timeout: Union[
|
460
|
+
None,
|
461
|
+
Annotated[StrictFloat, Field(gt=0)],
|
462
|
+
Tuple[
|
463
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
464
|
+
],
|
465
|
+
] = None,
|
466
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
467
|
+
_content_type: Optional[StrictStr] = None,
|
468
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
469
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
470
|
+
) -> ApiResponse[BaseResponseDict]:
|
471
|
+
"""Get Sma Indicator
|
472
|
+
|
473
|
+
Calculate and retrieve the Simple Moving Average (SMA) indicator for a symbol.
|
474
|
+
|
475
|
+
:param symbol: (required)
|
476
|
+
:type symbol: str
|
477
|
+
:param market: Market
|
478
|
+
:type market: Market
|
479
|
+
:param period: SMA indicator period
|
480
|
+
:type period: int
|
481
|
+
:param timestamp: Timestamp for which to fetch SMA indicator
|
482
|
+
:type timestamp: int
|
483
|
+
:param _request_timeout: timeout setting for this request. If one
|
484
|
+
number provided, it will be total request
|
485
|
+
timeout. It can also be a pair (tuple) of
|
486
|
+
(connection, read) timeouts.
|
487
|
+
:type _request_timeout: int, tuple(int, int), optional
|
488
|
+
:param _request_auth: set to override the auth_settings for an a single
|
489
|
+
request; this effectively ignores the
|
490
|
+
authentication in the spec for a single request.
|
491
|
+
:type _request_auth: dict, optional
|
492
|
+
:param _content_type: force content-type for the request.
|
493
|
+
:type _content_type: str, Optional
|
494
|
+
:param _headers: set to override the headers for a single
|
495
|
+
request; this effectively ignores the headers
|
496
|
+
in the spec for a single request.
|
497
|
+
:type _headers: dict, optional
|
498
|
+
:param _host_index: set to override the host_index for a single
|
499
|
+
request; this effectively ignores the host_index
|
500
|
+
in the spec for a single request.
|
501
|
+
:type _host_index: int, optional
|
502
|
+
:return: Returns the result object.
|
503
|
+
""" # noqa: E501
|
504
|
+
|
505
|
+
_param = self._get_sma_indicator_serialize(
|
506
|
+
symbol=symbol,
|
507
|
+
market=market,
|
508
|
+
period=period,
|
509
|
+
timestamp=timestamp,
|
510
|
+
_request_auth=_request_auth,
|
511
|
+
_content_type=_content_type,
|
512
|
+
_headers=_headers,
|
513
|
+
_host_index=_host_index,
|
514
|
+
)
|
515
|
+
|
516
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
517
|
+
"200": "BaseResponseDict",
|
518
|
+
"400": "ErrorResponse",
|
519
|
+
"404": "ErrorResponse",
|
520
|
+
"500": "ErrorResponse",
|
521
|
+
"422": "HTTPValidationError",
|
522
|
+
}
|
523
|
+
response_data = await self.api_client.call_api(
|
524
|
+
*_param, _request_timeout=_request_timeout
|
525
|
+
)
|
526
|
+
await response_data.read()
|
527
|
+
return self.api_client.response_deserialize(
|
528
|
+
response_data=response_data,
|
529
|
+
response_types_map=_response_types_map,
|
530
|
+
)
|
531
|
+
|
532
|
+
@validate_call
|
533
|
+
async def get_sma_indicator_without_preload_content(
|
534
|
+
self,
|
535
|
+
symbol: StrictStr,
|
536
|
+
market: Annotated[Optional[Market], Field(description="Market")] = None,
|
537
|
+
period: Annotated[
|
538
|
+
Optional[StrictInt], Field(description="SMA indicator period")
|
539
|
+
] = None,
|
540
|
+
timestamp: Annotated[
|
541
|
+
Optional[StrictInt],
|
542
|
+
Field(description="Timestamp for which to fetch SMA indicator"),
|
543
|
+
] = None,
|
544
|
+
_request_timeout: Union[
|
545
|
+
None,
|
546
|
+
Annotated[StrictFloat, Field(gt=0)],
|
547
|
+
Tuple[
|
548
|
+
Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
|
549
|
+
],
|
550
|
+
] = None,
|
551
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
552
|
+
_content_type: Optional[StrictStr] = None,
|
553
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
554
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
555
|
+
) -> RESTResponseType:
|
556
|
+
"""Get Sma Indicator
|
557
|
+
|
558
|
+
Calculate and retrieve the Simple Moving Average (SMA) indicator for a symbol.
|
559
|
+
|
560
|
+
:param symbol: (required)
|
561
|
+
:type symbol: str
|
562
|
+
:param market: Market
|
563
|
+
:type market: Market
|
564
|
+
:param period: SMA indicator period
|
565
|
+
:type period: int
|
566
|
+
:param timestamp: Timestamp for which to fetch SMA indicator
|
567
|
+
:type timestamp: int
|
568
|
+
:param _request_timeout: timeout setting for this request. If one
|
569
|
+
number provided, it will be total request
|
570
|
+
timeout. It can also be a pair (tuple) of
|
571
|
+
(connection, read) timeouts.
|
572
|
+
:type _request_timeout: int, tuple(int, int), optional
|
573
|
+
:param _request_auth: set to override the auth_settings for an a single
|
574
|
+
request; this effectively ignores the
|
575
|
+
authentication in the spec for a single request.
|
576
|
+
:type _request_auth: dict, optional
|
577
|
+
:param _content_type: force content-type for the request.
|
578
|
+
:type _content_type: str, Optional
|
579
|
+
:param _headers: set to override the headers for a single
|
580
|
+
request; this effectively ignores the headers
|
581
|
+
in the spec for a single request.
|
582
|
+
:type _headers: dict, optional
|
583
|
+
:param _host_index: set to override the host_index for a single
|
584
|
+
request; this effectively ignores the host_index
|
585
|
+
in the spec for a single request.
|
586
|
+
:type _host_index: int, optional
|
587
|
+
:return: Returns the result object.
|
588
|
+
""" # noqa: E501
|
589
|
+
|
590
|
+
_param = self._get_sma_indicator_serialize(
|
591
|
+
symbol=symbol,
|
592
|
+
market=market,
|
593
|
+
period=period,
|
594
|
+
timestamp=timestamp,
|
595
|
+
_request_auth=_request_auth,
|
596
|
+
_content_type=_content_type,
|
597
|
+
_headers=_headers,
|
598
|
+
_host_index=_host_index,
|
599
|
+
)
|
600
|
+
|
601
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
602
|
+
"200": "BaseResponseDict",
|
603
|
+
"400": "ErrorResponse",
|
604
|
+
"404": "ErrorResponse",
|
605
|
+
"500": "ErrorResponse",
|
606
|
+
"422": "HTTPValidationError",
|
607
|
+
}
|
608
|
+
response_data = await self.api_client.call_api(
|
609
|
+
*_param, _request_timeout=_request_timeout
|
610
|
+
)
|
611
|
+
return response_data.response
|
612
|
+
|
613
|
+
def _get_sma_indicator_serialize(
|
614
|
+
self,
|
615
|
+
symbol,
|
616
|
+
market,
|
617
|
+
period,
|
618
|
+
timestamp,
|
619
|
+
_request_auth,
|
620
|
+
_content_type,
|
621
|
+
_headers,
|
622
|
+
_host_index,
|
623
|
+
) -> RequestSerialized:
|
624
|
+
|
625
|
+
_host = None
|
626
|
+
|
627
|
+
_collection_formats: Dict[str, str] = {}
|
628
|
+
|
629
|
+
_path_params: Dict[str, str] = {}
|
630
|
+
_query_params: List[Tuple[str, str]] = []
|
631
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
632
|
+
_form_params: List[Tuple[str, str]] = []
|
633
|
+
_files: Dict[
|
634
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
635
|
+
] = {}
|
636
|
+
_body_params: Optional[bytes] = None
|
637
|
+
|
638
|
+
# process the path parameters
|
639
|
+
if symbol is not None:
|
640
|
+
_path_params["symbol"] = symbol
|
641
|
+
# process the query parameters
|
642
|
+
if market is not None:
|
643
|
+
|
644
|
+
_query_params.append(("market", market.value))
|
645
|
+
|
646
|
+
if period is not None:
|
647
|
+
|
648
|
+
_query_params.append(("period", period))
|
649
|
+
|
650
|
+
if timestamp is not None:
|
651
|
+
|
652
|
+
_query_params.append(("timestamp", timestamp))
|
653
|
+
|
654
|
+
# process the header parameters
|
655
|
+
# process the form parameters
|
656
|
+
# process the body parameter
|
657
|
+
|
658
|
+
# set the HTTP header `Accept`
|
659
|
+
if "Accept" not in _header_params:
|
660
|
+
_header_params["Accept"] = self.api_client.select_header_accept(
|
661
|
+
["application/json"]
|
662
|
+
)
|
663
|
+
|
664
|
+
# authentication setting
|
665
|
+
_auth_settings: List[str] = []
|
666
|
+
|
667
|
+
return self.api_client.param_serialize(
|
668
|
+
method="GET",
|
669
|
+
resource_path="/sma/{symbol}",
|
670
|
+
path_params=_path_params,
|
671
|
+
query_params=_query_params,
|
672
|
+
header_params=_header_params,
|
673
|
+
body=_body_params,
|
674
|
+
post_params=_form_params,
|
675
|
+
files=_files,
|
676
|
+
auth_settings=_auth_settings,
|
677
|
+
collection_formats=_collection_formats,
|
678
|
+
_host=_host,
|
679
|
+
_request_auth=_request_auth,
|
680
|
+
)
|