crypticorn 2.11.0__py3-none-any.whl → 2.11.5__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.
Files changed (36) hide show
  1. crypticorn/auth/client/configuration.py +2 -2
  2. crypticorn/auth/client/models/create_api_key_request.py +2 -1
  3. crypticorn/auth/client/models/get_api_keys200_response_inner.py +2 -1
  4. crypticorn/cli/templates/merge-env.sh +3 -5
  5. crypticorn/client.py +2 -2
  6. crypticorn/common/ansi_colors.py +1 -0
  7. crypticorn/common/auth.py +2 -3
  8. crypticorn/common/errors.py +1 -0
  9. crypticorn/common/exceptions.py +1 -0
  10. crypticorn/common/scopes.py +10 -0
  11. crypticorn/common/warnings.py +1 -0
  12. crypticorn/klines/client/api/admin_api.py +14 -14
  13. crypticorn/klines/client/api/status_api.py +6 -6
  14. crypticorn/klines/client/configuration.py +4 -2
  15. crypticorn/klines/client/models/api_error_identifier.py +1 -1
  16. crypticorn/klines/client/models/api_error_level.py +1 -1
  17. crypticorn/klines/client/models/api_error_type.py +1 -1
  18. crypticorn/klines/client/models/exception_detail.py +1 -1
  19. crypticorn/klines/client/models/ohlcv.py +31 -6
  20. crypticorn/klines/main.py +13 -1
  21. crypticorn/metrics/client/__init__.py +4 -0
  22. crypticorn/metrics/client/api/exchanges_api.py +7 -6
  23. crypticorn/metrics/client/api/indicators_api.py +12 -6
  24. crypticorn/metrics/client/api/marketcap_api.py +49 -31
  25. crypticorn/metrics/client/configuration.py +2 -2
  26. crypticorn/metrics/client/models/__init__.py +4 -0
  27. crypticorn/metrics/client/models/exchange_availability.py +88 -0
  28. crypticorn/metrics/client/models/marketcap_ranking.py +9 -6
  29. crypticorn/metrics/client/models/marketcap_symbol_ranking.py +86 -0
  30. crypticorn/metrics/main.py +12 -19
  31. {crypticorn-2.11.0.dist-info → crypticorn-2.11.5.dist-info}/METADATA +9 -19
  32. {crypticorn-2.11.0.dist-info → crypticorn-2.11.5.dist-info}/RECORD +36 -34
  33. {crypticorn-2.11.0.dist-info → crypticorn-2.11.5.dist-info}/WHEEL +1 -1
  34. {crypticorn-2.11.0.dist-info → crypticorn-2.11.5.dist-info}/entry_points.txt +0 -0
  35. {crypticorn-2.11.0.dist-info → crypticorn-2.11.5.dist-info}/licenses/LICENSE +0 -0
  36. {crypticorn-2.11.0.dist-info → crypticorn-2.11.5.dist-info}/top_level.txt +0 -0
@@ -195,7 +195,7 @@ class Configuration:
195
195
  debug: Optional[bool] = None,
196
196
  ) -> None:
197
197
  """Constructor"""
198
- self._base_path = "http://localhost/v1/auth" if host is None else host
198
+ self._base_path = "https://api.crypticorn.dev/v1/auth" if host is None else host
199
199
  """Default Base url
200
200
  """
201
201
  self.server_index = 0 if server_index is None and host is None else server_index
@@ -528,7 +528,7 @@ class Configuration:
528
528
  """
529
529
  return [
530
530
  {
531
- "url": "http://localhost/v1/auth",
531
+ "url": "https://api.crypticorn.dev/v1/auth",
532
532
  "description": "No description provided",
533
533
  }
534
534
  ]
@@ -78,12 +78,13 @@ class CreateApiKeyRequest(BaseModel):
78
78
  "read:metrics:tokens",
79
79
  "read:metrics:markets",
80
80
  "read:sentiment",
81
+ "read:klines",
81
82
  "read:admin",
82
83
  "write:admin",
83
84
  ]
84
85
  ):
85
86
  raise ValueError(
86
- "each list item must be one of ('read:predictions', 'read:hive:model', 'read:hive:data', 'write:hive:model', 'read:trade:bots', 'write:trade:bots', 'read:trade:exchangekeys', 'write:trade:exchangekeys', 'read:trade:orders', 'read:trade:actions', 'write:trade:actions', 'read:trade:exchanges', 'read:trade:futures', 'write:trade:futures', 'read:trade:notifications', 'write:trade:notifications', 'read:trade:strategies', 'write:trade:strategies', 'read:pay:payments', 'read:pay:products', 'write:pay:products', 'read:pay:now', 'write:pay:now', 'read:metrics:marketcap', 'read:metrics:indicators', 'read:metrics:exchanges', 'read:metrics:tokens', 'read:metrics:markets', 'read:sentiment', 'read:admin', 'write:admin')"
87
+ "each list item must be one of ('read:predictions', 'read:hive:model', 'read:hive:data', 'write:hive:model', 'read:trade:bots', 'write:trade:bots', 'read:trade:exchangekeys', 'write:trade:exchangekeys', 'read:trade:orders', 'read:trade:actions', 'write:trade:actions', 'read:trade:exchanges', 'read:trade:futures', 'write:trade:futures', 'read:trade:notifications', 'write:trade:notifications', 'read:trade:strategies', 'write:trade:strategies', 'read:pay:payments', 'read:pay:products', 'write:pay:products', 'read:pay:now', 'write:pay:now', 'read:metrics:marketcap', 'read:metrics:indicators', 'read:metrics:exchanges', 'read:metrics:tokens', 'read:metrics:markets', 'read:sentiment', 'read:klines', 'read:admin', 'write:admin')"
87
88
  )
88
89
  return value
89
90
 
@@ -86,12 +86,13 @@ class GetApiKeys200ResponseInner(BaseModel):
86
86
  "read:metrics:tokens",
87
87
  "read:metrics:markets",
88
88
  "read:sentiment",
89
+ "read:klines",
89
90
  "read:admin",
90
91
  "write:admin",
91
92
  ]
92
93
  ):
93
94
  raise ValueError(
94
- "each list item must be one of ('read:predictions', 'read:hive:model', 'read:hive:data', 'write:hive:model', 'read:trade:bots', 'write:trade:bots', 'read:trade:exchangekeys', 'write:trade:exchangekeys', 'read:trade:orders', 'read:trade:actions', 'write:trade:actions', 'read:trade:exchanges', 'read:trade:futures', 'write:trade:futures', 'read:trade:notifications', 'write:trade:notifications', 'read:trade:strategies', 'write:trade:strategies', 'read:pay:payments', 'read:pay:products', 'write:pay:products', 'read:pay:now', 'write:pay:now', 'read:metrics:marketcap', 'read:metrics:indicators', 'read:metrics:exchanges', 'read:metrics:tokens', 'read:metrics:markets', 'read:sentiment', 'read:admin', 'write:admin')"
95
+ "each list item must be one of ('read:predictions', 'read:hive:model', 'read:hive:data', 'write:hive:model', 'read:trade:bots', 'write:trade:bots', 'read:trade:exchangekeys', 'write:trade:exchangekeys', 'read:trade:orders', 'read:trade:actions', 'write:trade:actions', 'read:trade:exchanges', 'read:trade:futures', 'write:trade:futures', 'read:trade:notifications', 'write:trade:notifications', 'read:trade:strategies', 'write:trade:strategies', 'read:pay:payments', 'read:pay:products', 'write:pay:products', 'read:pay:now', 'write:pay:now', 'read:metrics:marketcap', 'read:metrics:indicators', 'read:metrics:exchanges', 'read:metrics:tokens', 'read:metrics:markets', 'read:sentiment', 'read:klines', 'read:admin', 'write:admin')"
95
96
  )
96
97
  return value
97
98
 
@@ -1,17 +1,15 @@
1
1
  #!/usr/bin/env bash
2
-
3
2
  # this script merges the env variables from the environment and the .env.example file into the .env file
4
3
  # the appended variables take precedence over the .env.example variables (if both are set)
5
4
 
6
- # Make executable before running in github actions
7
- # chmod +x scripts/merge-env.sh
8
-
9
5
  # Usage in a github action:
10
6
  # - name: Generate .env
11
7
  # run: ./scripts/merge-env.sh
8
+ # add this after checkout before copying files to the host
12
9
 
13
10
  set -e
14
11
 
15
12
  cp .env.example .env
16
13
  echo >> .env
17
- printenv | awk -F= '{print $1"=\""substr($0, index($0,$2))"\""}' >> .env
14
+ echo "# Environment variables" >> .env
15
+ printenv | awk -F= '/^[a-zA-Z_][a-zA-Z0-9_]*=/{print $1"=\""substr($0, index($0,$2))"\""}' | sort | uniq >> .env
crypticorn/client.py CHANGED
@@ -119,8 +119,8 @@ class ApiClient:
119
119
  :param service: The service to configure.
120
120
 
121
121
  Example:
122
- >>> async with ApiClient(base_url=BaseUrl.DEV, jwt=jwt) as client:
123
- >>> client.configure(config=HiveConfig(host="http://localhost:8000"), client=client.hive)
122
+ >>> async with ApiClient() as client:
123
+ ... client.configure(config=HiveConfig(host="http://localhost:8000"), service=Service.HIVE)
124
124
  """
125
125
  assert Service.validate(service), f"Invalid service: {service}"
126
126
  client = self._services[service]
@@ -3,6 +3,7 @@ try:
3
3
  except ImportError:
4
4
  from strenum import StrEnum
5
5
 
6
+
6
7
  class AnsiColors(StrEnum):
7
8
  """Provides a collection of ANSI color codes for terminal text formatting, including regular, bright, and bold text colors. Useful for creating colorful and readable console output."""
8
9
 
crypticorn/common/auth.py CHANGED
@@ -19,6 +19,7 @@ from fastapi.security import (
19
19
  )
20
20
  from typing_extensions import Annotated
21
21
  from typing import Union
22
+
22
23
  # Auth Schemes
23
24
  http_bearer = HTTPBearer(
24
25
  bearerFormat="JWT",
@@ -160,9 +161,7 @@ class AuthHandler:
160
161
  bearer: Annotated[
161
162
  Union[HTTPAuthorizationCredentials, None], Depends(http_bearer)
162
163
  ] = None,
163
- api_key: Annotated[
164
- Union[str, None], Depends(apikey_header)
165
- ] = None,
164
+ api_key: Annotated[Union[str, None], Depends(apikey_header)] = None,
166
165
  sec: SecurityScopes = SecurityScopes(),
167
166
  ) -> Verify200Response:
168
167
  """
@@ -3,6 +3,7 @@
3
3
  from enum import Enum
4
4
  from fastapi import status
5
5
  from crypticorn.common.mixins import ApiErrorFallback
6
+
6
7
  try:
7
8
  from enum import StrEnum
8
9
  except ImportError:
@@ -6,6 +6,7 @@ from fastapi.responses import JSONResponse
6
6
  from crypticorn.common import ApiError, ApiErrorIdentifier, ApiErrorType, ApiErrorLevel
7
7
  import logging
8
8
  import json
9
+
9
10
  try:
10
11
  from enum import StrEnum
11
12
  except ImportError:
@@ -55,6 +55,9 @@ class Scope(StrEnum):
55
55
  # Sentiment scopes
56
56
  READ_SENTIMENT = "read:sentiment"
57
57
 
58
+ # Klines scopes
59
+ READ_KLINES = "read:klines"
60
+
58
61
  @classmethod
59
62
  def admin_scopes(cls) -> list["Scope"]:
60
63
  """Scopes that are only available to admins."""
@@ -77,4 +80,11 @@ class Scope(StrEnum):
77
80
  """Scopes that can be purchased."""
78
81
  return [
79
82
  cls.READ_PREDICTIONS,
83
+ cls.READ_METRICS_MARKETCAP,
84
+ cls.READ_METRICS_INDICATORS,
85
+ cls.READ_METRICS_EXCHANGES,
86
+ cls.READ_METRICS_TOKENS,
87
+ cls.READ_METRICS_MARKETS,
88
+ cls.READ_KLINES,
89
+ cls.READ_SENTIMENT,
80
90
  ]
@@ -3,6 +3,7 @@
3
3
  from __future__ import annotations
4
4
  from typing import Union
5
5
 
6
+
6
7
  class CrypticornDeprecationWarning(DeprecationWarning):
7
8
  """A Crypticorn specific deprecation warning.
8
9
 
@@ -271,7 +271,7 @@ class AdminApi:
271
271
  include: Annotated[
272
272
  Optional[List[StrictStr]],
273
273
  Field(
274
- description="List of dependencies to include in the response. If not provided, all installed packages will be returned."
274
+ description="List of regex patterns to match against package names. If not provided, all installed packages will be returned."
275
275
  ),
276
276
  ] = None,
277
277
  _request_timeout: Union[
@@ -285,12 +285,12 @@ class AdminApi:
285
285
  _content_type: Optional[StrictStr] = None,
286
286
  _headers: Optional[Dict[StrictStr, Any]] = None,
287
287
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
288
- ) -> List[object]:
288
+ ) -> Dict[str, str]:
289
289
  """List Installed Packages
290
290
 
291
- Return a list of installed packages and versions.
291
+ Return a list of installed packages and versions. The include parameter accepts regex patterns to match against package names. For example: - crypticorn.* will match all packages starting with 'crypticorn' - .*tic.* will match all packages containing 'tic' in their name
292
292
 
293
- :param include: List of dependencies to include in the response. If not provided, all installed packages will be returned.
293
+ :param include: List of regex patterns to match against package names. If not provided, all installed packages will be returned.
294
294
  :type include: List[str]
295
295
  :param _request_timeout: timeout setting for this request. If one
296
296
  number provided, it will be total request
@@ -323,7 +323,7 @@ class AdminApi:
323
323
  )
324
324
 
325
325
  _response_types_map: Dict[str, Optional[str]] = {
326
- "200": "List[object]",
326
+ "200": "Dict[str, str]",
327
327
  }
328
328
  response_data = await self.api_client.call_api(
329
329
  *_param, _request_timeout=_request_timeout
@@ -340,7 +340,7 @@ class AdminApi:
340
340
  include: Annotated[
341
341
  Optional[List[StrictStr]],
342
342
  Field(
343
- description="List of dependencies to include in the response. If not provided, all installed packages will be returned."
343
+ description="List of regex patterns to match against package names. If not provided, all installed packages will be returned."
344
344
  ),
345
345
  ] = None,
346
346
  _request_timeout: Union[
@@ -354,12 +354,12 @@ class AdminApi:
354
354
  _content_type: Optional[StrictStr] = None,
355
355
  _headers: Optional[Dict[StrictStr, Any]] = None,
356
356
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
357
- ) -> ApiResponse[List[object]]:
357
+ ) -> ApiResponse[Dict[str, str]]:
358
358
  """List Installed Packages
359
359
 
360
- Return a list of installed packages and versions.
360
+ Return a list of installed packages and versions. The include parameter accepts regex patterns to match against package names. For example: - crypticorn.* will match all packages starting with 'crypticorn' - .*tic.* will match all packages containing 'tic' in their name
361
361
 
362
- :param include: List of dependencies to include in the response. If not provided, all installed packages will be returned.
362
+ :param include: List of regex patterns to match against package names. If not provided, all installed packages will be returned.
363
363
  :type include: List[str]
364
364
  :param _request_timeout: timeout setting for this request. If one
365
365
  number provided, it will be total request
@@ -392,7 +392,7 @@ class AdminApi:
392
392
  )
393
393
 
394
394
  _response_types_map: Dict[str, Optional[str]] = {
395
- "200": "List[object]",
395
+ "200": "Dict[str, str]",
396
396
  }
397
397
  response_data = await self.api_client.call_api(
398
398
  *_param, _request_timeout=_request_timeout
@@ -409,7 +409,7 @@ class AdminApi:
409
409
  include: Annotated[
410
410
  Optional[List[StrictStr]],
411
411
  Field(
412
- description="List of dependencies to include in the response. If not provided, all installed packages will be returned."
412
+ description="List of regex patterns to match against package names. If not provided, all installed packages will be returned."
413
413
  ),
414
414
  ] = None,
415
415
  _request_timeout: Union[
@@ -426,9 +426,9 @@ class AdminApi:
426
426
  ) -> RESTResponseType:
427
427
  """List Installed Packages
428
428
 
429
- Return a list of installed packages and versions.
429
+ Return a list of installed packages and versions. The include parameter accepts regex patterns to match against package names. For example: - crypticorn.* will match all packages starting with 'crypticorn' - .*tic.* will match all packages containing 'tic' in their name
430
430
 
431
- :param include: List of dependencies to include in the response. If not provided, all installed packages will be returned.
431
+ :param include: List of regex patterns to match against package names. If not provided, all installed packages will be returned.
432
432
  :type include: List[str]
433
433
  :param _request_timeout: timeout setting for this request. If one
434
434
  number provided, it will be total request
@@ -461,7 +461,7 @@ class AdminApi:
461
461
  )
462
462
 
463
463
  _response_types_map: Dict[str, Optional[str]] = {
464
- "200": "List[object]",
464
+ "200": "Dict[str, str]",
465
465
  }
466
466
  response_data = await self.api_client.call_api(
467
467
  *_param, _request_timeout=_request_timeout
@@ -17,7 +17,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union
17
17
  from typing_extensions import Annotated
18
18
 
19
19
  from pydantic import StrictStr, field_validator
20
- from typing import Any, Dict, Optional
20
+ from typing import Optional
21
21
 
22
22
  from crypticorn.klines.client.api_client import ApiClient, RequestSerialized
23
23
  from crypticorn.klines.client.api_response import ApiResponse
@@ -294,7 +294,7 @@ class StatusApi:
294
294
  _content_type: Optional[StrictStr] = None,
295
295
  _headers: Optional[Dict[StrictStr, Any]] = None,
296
296
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
297
- ) -> Dict[str, object]:
297
+ ) -> str:
298
298
  """Ping
299
299
 
300
300
  Returns 'OK' if the API is running.
@@ -329,7 +329,7 @@ class StatusApi:
329
329
  )
330
330
 
331
331
  _response_types_map: Dict[str, Optional[str]] = {
332
- "200": "Dict[str, object]",
332
+ "200": "str",
333
333
  }
334
334
  response_data = await self.api_client.call_api(
335
335
  *_param, _request_timeout=_request_timeout
@@ -354,7 +354,7 @@ class StatusApi:
354
354
  _content_type: Optional[StrictStr] = None,
355
355
  _headers: Optional[Dict[StrictStr, Any]] = None,
356
356
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
357
- ) -> ApiResponse[Dict[str, object]]:
357
+ ) -> ApiResponse[str]:
358
358
  """Ping
359
359
 
360
360
  Returns 'OK' if the API is running.
@@ -389,7 +389,7 @@ class StatusApi:
389
389
  )
390
390
 
391
391
  _response_types_map: Dict[str, Optional[str]] = {
392
- "200": "Dict[str, object]",
392
+ "200": "str",
393
393
  }
394
394
  response_data = await self.api_client.call_api(
395
395
  *_param, _request_timeout=_request_timeout
@@ -449,7 +449,7 @@ class StatusApi:
449
449
  )
450
450
 
451
451
  _response_types_map: Dict[str, Optional[str]] = {
452
- "200": "Dict[str, object]",
452
+ "200": "str",
453
453
  }
454
454
  response_data = await self.api_client.call_api(
455
455
  *_param, _request_timeout=_request_timeout
@@ -215,7 +215,9 @@ class Configuration:
215
215
  debug: Optional[bool] = None,
216
216
  ) -> None:
217
217
  """Constructor"""
218
- self._base_path = "http://localhost/v1/klines" if host is None else host
218
+ self._base_path = (
219
+ "https://api.crypticorn.dev/v1/klines" if host is None else host
220
+ )
219
221
  """Default Base url
220
222
  """
221
223
  self.server_index = 0 if server_index is None and host is None else server_index
@@ -557,7 +559,7 @@ class Configuration:
557
559
  """
558
560
  return [
559
561
  {
560
- "url": "http://localhost/v1/klines",
562
+ "url": "https://api.crypticorn.dev/v1/klines",
561
563
  "description": "No description provided",
562
564
  }
563
565
  ]
@@ -20,7 +20,7 @@ from typing_extensions import Self
20
20
 
21
21
  class ApiErrorIdentifier(str, Enum):
22
22
  """
23
- API error identifiers
23
+ Unique identifier of the API error.
24
24
  """
25
25
 
26
26
  """
@@ -20,7 +20,7 @@ from typing_extensions import Self
20
20
 
21
21
  class ApiErrorLevel(str, Enum):
22
22
  """
23
- API error levels
23
+ Level of the API error.
24
24
  """
25
25
 
26
26
  """
@@ -20,7 +20,7 @@ from typing_extensions import Self
20
20
 
21
21
  class ApiErrorType(str, Enum):
22
22
  """
23
- Type of API error
23
+ Type of the API error.
24
24
  """
25
25
 
26
26
  """
@@ -28,7 +28,7 @@ from typing_extensions import Self
28
28
 
29
29
  class ExceptionDetail(BaseModel):
30
30
  """
31
- This is the detail of the exception. It is used to enrich the exception with additional information by unwrapping the ApiError into its components.
31
+ Exception details returned to the client.
32
32
  """ # noqa: E501
33
33
 
34
34
  message: Optional[StrictStr] = None
@@ -18,7 +18,7 @@ import re # noqa: F401
18
18
  import json
19
19
 
20
20
  from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt
21
- from typing import Any, ClassVar, Dict, List, Union
21
+ from typing import Any, ClassVar, Dict, List, Optional, Union
22
22
  from typing import Optional, Set
23
23
  from typing_extensions import Self
24
24
 
@@ -29,11 +29,11 @@ class OHLCV(BaseModel):
29
29
  """ # noqa: E501
30
30
 
31
31
  timestamp: StrictInt = Field(description="Timestamp in seconds")
32
- open: Union[StrictFloat, StrictInt] = Field(description="Open prices")
33
- high: Union[StrictFloat, StrictInt] = Field(description="High prices")
34
- low: Union[StrictFloat, StrictInt] = Field(description="Low prices")
35
- close: Union[StrictFloat, StrictInt] = Field(description="Close prices")
36
- volume: Union[StrictFloat, StrictInt] = Field(description="Volume")
32
+ open: Optional[Union[StrictFloat, StrictInt]]
33
+ high: Optional[Union[StrictFloat, StrictInt]]
34
+ low: Optional[Union[StrictFloat, StrictInt]]
35
+ close: Optional[Union[StrictFloat, StrictInt]]
36
+ volume: Optional[Union[StrictFloat, StrictInt]]
37
37
  __properties: ClassVar[List[str]] = [
38
38
  "timestamp",
39
39
  "open",
@@ -80,6 +80,31 @@ class OHLCV(BaseModel):
80
80
  exclude=excluded_fields,
81
81
  exclude_none=True,
82
82
  )
83
+ # set to None if open (nullable) is None
84
+ # and model_fields_set contains the field
85
+ if self.open is None and "open" in self.model_fields_set:
86
+ _dict["open"] = None
87
+
88
+ # set to None if high (nullable) is None
89
+ # and model_fields_set contains the field
90
+ if self.high is None and "high" in self.model_fields_set:
91
+ _dict["high"] = None
92
+
93
+ # set to None if low (nullable) is None
94
+ # and model_fields_set contains the field
95
+ if self.low is None and "low" in self.model_fields_set:
96
+ _dict["low"] = None
97
+
98
+ # set to None if close (nullable) is None
99
+ # and model_fields_set contains the field
100
+ if self.close is None and "close" in self.model_fields_set:
101
+ _dict["close"] = None
102
+
103
+ # set to None if volume (nullable) is None
104
+ # and model_fields_set contains the field
105
+ if self.volume is None and "volume" in self.model_fields_set:
106
+ _dict["volume"] = None
107
+
83
108
  return _dict
84
109
 
85
110
  @classmethod
crypticorn/klines/main.py CHANGED
@@ -65,7 +65,19 @@ class OHLCVDataApiWrapper(OHLCVDataApi):
65
65
  """
66
66
  pd = optional_import("pandas", "extra")
67
67
  response = await self.get_ohlcv(*args, **kwargs)
68
- return pd.DataFrame(response)
68
+ rows = []
69
+ for item in response:
70
+ row = {
71
+ "timestamp": item.timestamp,
72
+ "open": item.open,
73
+ "high": item.high,
74
+ "low": item.low,
75
+ "close": item.close,
76
+ "volume": item.volume,
77
+ }
78
+ rows.append(row)
79
+ df = pd.DataFrame(rows)
80
+ return df
69
81
 
70
82
 
71
83
  class SymbolsApiWrapper(SymbolsApi):
@@ -43,11 +43,15 @@ from crypticorn.metrics.client.models.api_error_identifier import ApiErrorIdenti
43
43
  from crypticorn.metrics.client.models.api_error_level import ApiErrorLevel
44
44
  from crypticorn.metrics.client.models.api_error_type import ApiErrorType
45
45
  from crypticorn.metrics.client.models.exception_detail import ExceptionDetail
46
+ from crypticorn.metrics.client.models.exchange_availability import ExchangeAvailability
46
47
  from crypticorn.metrics.client.models.exchange_mapping import ExchangeMapping
47
48
  from crypticorn.metrics.client.models.internal_exchange import InternalExchange
48
49
  from crypticorn.metrics.client.models.log_level import LogLevel
49
50
  from crypticorn.metrics.client.models.market_type import MarketType
50
51
  from crypticorn.metrics.client.models.marketcap_ranking import MarketcapRanking
52
+ from crypticorn.metrics.client.models.marketcap_symbol_ranking import (
53
+ MarketcapSymbolRanking,
54
+ )
51
55
  from crypticorn.metrics.client.models.ohlcv import OHLCV
52
56
  from crypticorn.metrics.client.models.severity import Severity
53
57
  from crypticorn.metrics.client.models.time_interval import TimeInterval
@@ -17,8 +17,9 @@ from typing import Any, Dict, List, Optional, Tuple, Union
17
17
  from typing_extensions import Annotated
18
18
 
19
19
  from pydantic import Field, StrictInt, StrictStr
20
- from typing import Any, Dict, List, Optional
20
+ from typing import List, Optional
21
21
  from typing_extensions import Annotated
22
+ from crypticorn.metrics.client.models.exchange_availability import ExchangeAvailability
22
23
  from crypticorn.metrics.client.models.exchange_mapping import ExchangeMapping
23
24
  from crypticorn.metrics.client.models.internal_exchange import InternalExchange
24
25
  from crypticorn.metrics.client.models.market_type import MarketType
@@ -88,7 +89,7 @@ class ExchangesApi:
88
89
  _content_type: Optional[StrictStr] = None,
89
90
  _headers: Optional[Dict[StrictStr, Any]] = None,
90
91
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
91
- ) -> List[Dict[str, object]]:
92
+ ) -> List[ExchangeAvailability]:
92
93
  """Get Available Exchanges
93
94
 
94
95
  Get available exchanges for a symbol with various filtering options.
@@ -144,7 +145,7 @@ class ExchangesApi:
144
145
  )
145
146
 
146
147
  _response_types_map: Dict[str, Optional[str]] = {
147
- "200": "List[Dict[str, object]]",
148
+ "200": "List[ExchangeAvailability]",
148
149
  }
149
150
  response_data = await self.api_client.call_api(
150
151
  *_param, _request_timeout=_request_timeout
@@ -201,7 +202,7 @@ class ExchangesApi:
201
202
  _content_type: Optional[StrictStr] = None,
202
203
  _headers: Optional[Dict[StrictStr, Any]] = None,
203
204
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
204
- ) -> ApiResponse[List[Dict[str, object]]]:
205
+ ) -> ApiResponse[List[ExchangeAvailability]]:
205
206
  """Get Available Exchanges
206
207
 
207
208
  Get available exchanges for a symbol with various filtering options.
@@ -257,7 +258,7 @@ class ExchangesApi:
257
258
  )
258
259
 
259
260
  _response_types_map: Dict[str, Optional[str]] = {
260
- "200": "List[Dict[str, object]]",
261
+ "200": "List[ExchangeAvailability]",
261
262
  }
262
263
  response_data = await self.api_client.call_api(
263
264
  *_param, _request_timeout=_request_timeout
@@ -370,7 +371,7 @@ class ExchangesApi:
370
371
  )
371
372
 
372
373
  _response_types_map: Dict[str, Optional[str]] = {
373
- "200": "List[Dict[str, object]]",
374
+ "200": "List[ExchangeAvailability]",
374
375
  }
375
376
  response_data = await self.api_client.call_api(
376
377
  *_param, _request_timeout=_request_timeout
@@ -44,7 +44,9 @@ class IndicatorsApi:
44
44
  symbol: Annotated[
45
45
  StrictStr, Field(description="Symbol to fetch KER indicator for")
46
46
  ],
47
- market: Annotated[Optional[MarketType], Field(description="Market")] = None,
47
+ market: Annotated[
48
+ Optional[MarketType], Field(description="Market. Defaults to futures.")
49
+ ] = None,
48
50
  period: Annotated[
49
51
  Optional[StrictInt], Field(description="KER indicator period")
50
52
  ] = None,
@@ -70,7 +72,7 @@ class IndicatorsApi:
70
72
 
71
73
  :param symbol: Symbol to fetch KER indicator for (required)
72
74
  :type symbol: str
73
- :param market: Market
75
+ :param market: Market. Defaults to futures.
74
76
  :type market: MarketType
75
77
  :param period: KER indicator period
76
78
  :type period: int
@@ -127,7 +129,9 @@ class IndicatorsApi:
127
129
  symbol: Annotated[
128
130
  StrictStr, Field(description="Symbol to fetch KER indicator for")
129
131
  ],
130
- market: Annotated[Optional[MarketType], Field(description="Market")] = None,
132
+ market: Annotated[
133
+ Optional[MarketType], Field(description="Market. Defaults to futures.")
134
+ ] = None,
131
135
  period: Annotated[
132
136
  Optional[StrictInt], Field(description="KER indicator period")
133
137
  ] = None,
@@ -153,7 +157,7 @@ class IndicatorsApi:
153
157
 
154
158
  :param symbol: Symbol to fetch KER indicator for (required)
155
159
  :type symbol: str
156
- :param market: Market
160
+ :param market: Market. Defaults to futures.
157
161
  :type market: MarketType
158
162
  :param period: KER indicator period
159
163
  :type period: int
@@ -210,7 +214,9 @@ class IndicatorsApi:
210
214
  symbol: Annotated[
211
215
  StrictStr, Field(description="Symbol to fetch KER indicator for")
212
216
  ],
213
- market: Annotated[Optional[MarketType], Field(description="Market")] = None,
217
+ market: Annotated[
218
+ Optional[MarketType], Field(description="Market. Defaults to futures.")
219
+ ] = None,
214
220
  period: Annotated[
215
221
  Optional[StrictInt], Field(description="KER indicator period")
216
222
  ] = None,
@@ -236,7 +242,7 @@ class IndicatorsApi:
236
242
 
237
243
  :param symbol: Symbol to fetch KER indicator for (required)
238
244
  :type symbol: str
239
- :param market: Market
245
+ :param market: Market. Defaults to futures.
240
246
  :type market: MarketType
241
247
  :param period: KER indicator period
242
248
  :type period: int