crypticorn 2.8.0rc6__py3-none-any.whl → 2.8.0rc8__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/__init__.py +1 -1
- crypticorn/client.py +1 -1
- crypticorn/common/exceptions.py +4 -4
- crypticorn/common/logging.py +13 -4
- crypticorn/common/middleware.py +2 -3
- crypticorn/common/mixins.py +3 -2
- crypticorn/hive/client/__init__.py +4 -4
- crypticorn/hive/client/api/admin_api.py +5 -6
- crypticorn/hive/client/models/__init__.py +4 -4
- crypticorn/hive/client/models/api_error_identifier.py +115 -0
- crypticorn/hive/client/models/api_error_level.py +37 -0
- crypticorn/hive/client/models/api_error_type.py +37 -0
- crypticorn/hive/client/models/data_info.py +27 -5
- crypticorn/hive/client/models/data_options.py +92 -0
- crypticorn/hive/client/models/exception_detail.py +6 -3
- crypticorn/hive/client/models/model.py +3 -3
- crypticorn/hive/main.py +20 -2
- crypticorn/pay/main.py +1 -1
- {crypticorn-2.8.0rc6.dist-info → crypticorn-2.8.0rc8.dist-info}/METADATA +3 -3
- {crypticorn-2.8.0rc6.dist-info → crypticorn-2.8.0rc8.dist-info}/RECORD +23 -21
- crypticorn/hive/client/models/data_value_value_value_inner.py +0 -154
- crypticorn/hive/client/models/response_getuptime.py +0 -159
- {crypticorn-2.8.0rc6.dist-info → crypticorn-2.8.0rc8.dist-info}/WHEEL +0 -0
- {crypticorn-2.8.0rc6.dist-info → crypticorn-2.8.0rc8.dist-info}/entry_points.txt +0 -0
- {crypticorn-2.8.0rc6.dist-info → crypticorn-2.8.0rc8.dist-info}/top_level.txt +0 -0
crypticorn/__init__.py
CHANGED
crypticorn/client.py
CHANGED
crypticorn/common/exceptions.py
CHANGED
@@ -6,7 +6,7 @@ from fastapi.exceptions import RequestValidationError, ResponseValidationError
|
|
6
6
|
from fastapi.responses import JSONResponse
|
7
7
|
from crypticorn.common import ApiError, ApiErrorIdentifier, ApiErrorType, ApiErrorLevel
|
8
8
|
import logging
|
9
|
-
|
9
|
+
import json
|
10
10
|
logger = logging.getLogger(__name__)
|
11
11
|
|
12
12
|
|
@@ -99,7 +99,7 @@ async def general_handler(request: Request, exc: Exception) -> JSONResponse:
|
|
99
99
|
status_code=body.enrich().status_code,
|
100
100
|
content=HTTPException(content=body).detail,
|
101
101
|
)
|
102
|
-
logger.error(f"Response validation error: {res}")
|
102
|
+
logger.error(f"Response validation error: {json.loads(res.__dict__.get('body'))}")
|
103
103
|
return res
|
104
104
|
|
105
105
|
|
@@ -112,7 +112,7 @@ async def request_validation_handler(
|
|
112
112
|
status_code=body.enrich().status_code,
|
113
113
|
content=HTTPException(content=body).detail,
|
114
114
|
)
|
115
|
-
logger.error(f"Response validation error: {res}")
|
115
|
+
logger.error(f"Response validation error: {json.loads(res.__dict__.get('body'))}")
|
116
116
|
return res
|
117
117
|
|
118
118
|
|
@@ -125,7 +125,7 @@ async def response_validation_handler(
|
|
125
125
|
status_code=body.enrich().status_code,
|
126
126
|
content=HTTPException(content=body).detail,
|
127
127
|
)
|
128
|
-
logger.error(f"Response validation error: {res}")
|
128
|
+
logger.error(f"Response validation error: {json.loads(res.__dict__.get('body'))}")
|
129
129
|
return res
|
130
130
|
|
131
131
|
|
crypticorn/common/logging.py
CHANGED
@@ -12,8 +12,7 @@ from crypticorn.common.mixins import ValidateEnumMixin
|
|
12
12
|
from crypticorn.common.ansi_colors import AnsiColors as C
|
13
13
|
from datetime import datetime
|
14
14
|
import os
|
15
|
-
|
16
|
-
|
15
|
+
|
17
16
|
class LogLevel(ValidateEnumMixin, StrEnum):
|
18
17
|
DEBUG = "DEBUG"
|
19
18
|
INFO = "INFO"
|
@@ -71,7 +70,7 @@ class CustomFormatter(logging.Formatter):
|
|
71
70
|
|
72
71
|
|
73
72
|
def configure_logging(
|
74
|
-
name: str,
|
73
|
+
name: str = None,
|
75
74
|
fmt: str = _LOGFORMAT,
|
76
75
|
datefmt: str = _DATEFMT,
|
77
76
|
stdout_level: int = logging.INFO,
|
@@ -82,8 +81,15 @@ def configure_logging(
|
|
82
81
|
"""Configures the logging for the application.
|
83
82
|
Run this function as early as possible in the application (for example using the `lifespan` parameter in FastAPI).
|
84
83
|
Then use can use the default `logging.getLogger(__name__)` method to get the logger.
|
84
|
+
:param name: The name of the logger. If not provided, the root logger will be used. Use a name if use multiple loggers in the same application.
|
85
|
+
:param fmt: The format of the log message.
|
86
|
+
:param datefmt: The date format of the log message.
|
87
|
+
:param stdout_level: The level of the log message to be printed to the console.
|
88
|
+
:param file_level: The level of the log message to be written to the file. Only used if `log_file` is provided.
|
89
|
+
:param log_file: The file to write the log messages to.
|
90
|
+
:param filters: A list of filters to apply to the log handlers.
|
85
91
|
"""
|
86
|
-
logger = logging.getLogger(name)
|
92
|
+
logger = logging.getLogger(name) if name else logging.getLogger()
|
87
93
|
|
88
94
|
if logger.handlers: # clear existing handlers to avoid duplicates
|
89
95
|
logger.handlers.clear()
|
@@ -109,6 +115,9 @@ def configure_logging(
|
|
109
115
|
for filter in filters:
|
110
116
|
file_handler.addFilter(filter)
|
111
117
|
logger.addHandler(file_handler)
|
118
|
+
|
119
|
+
if name:
|
120
|
+
logger.propagate = False
|
112
121
|
|
113
122
|
|
114
123
|
def disable_logging():
|
crypticorn/common/middleware.py
CHANGED
@@ -11,7 +11,7 @@ def add_cors_middleware(app: "FastAPI"):
|
|
11
11
|
"http://localhost:5173", # vite dev server
|
12
12
|
"http://localhost:4173", # vite preview server
|
13
13
|
],
|
14
|
-
allow_origin_regex="^https
|
14
|
+
allow_origin_regex="^https://([a-zA-Z0-9-]+.)*crypticorn.(dev|com)/?$", # matches (multiple or no) subdomains of crypticorn.dev and crypticorn.com
|
15
15
|
allow_credentials=True,
|
16
16
|
allow_methods=["*"],
|
17
17
|
allow_headers=["*"],
|
@@ -23,6 +23,5 @@ async def default_lifespan(app: FastAPI):
|
|
23
23
|
This is used to configure the logging for the application.
|
24
24
|
To override this, pass a different lifespan to the FastAPI constructor or call this lifespan within a custom lifespan.
|
25
25
|
"""
|
26
|
-
configure_logging(
|
27
|
-
logger = logging.getLogger(__name__)
|
26
|
+
configure_logging()
|
28
27
|
yield
|
crypticorn/common/mixins.py
CHANGED
@@ -32,14 +32,15 @@ class ValidateEnumMixin:
|
|
32
32
|
except ValueError:
|
33
33
|
return False
|
34
34
|
|
35
|
-
|
35
|
+
|
36
|
+
# This Mixin will be removed in a future version. And has no effect from now on
|
36
37
|
class ExcludeEnumMixin:
|
37
38
|
"""Mixin to exclude enum from OpenAPI schema. We use this to avoid duplicating enums when generating client code from the openapi spec."""
|
38
39
|
|
39
40
|
@classmethod
|
40
41
|
def __get_pydantic_json_schema__(cls, core_schema, handler):
|
41
42
|
schema = handler(core_schema)
|
42
|
-
#schema.pop("enum", None)
|
43
|
+
# schema.pop("enum", None)
|
43
44
|
return schema
|
44
45
|
|
45
46
|
|
@@ -34,12 +34,13 @@ from crypticorn.hive.client.exceptions import ApiAttributeError
|
|
34
34
|
from crypticorn.hive.client.exceptions import ApiException
|
35
35
|
|
36
36
|
# import models into sdk package
|
37
|
+
from crypticorn.hive.client.models.api_error_identifier import ApiErrorIdentifier
|
38
|
+
from crypticorn.hive.client.models.api_error_level import ApiErrorLevel
|
39
|
+
from crypticorn.hive.client.models.api_error_type import ApiErrorType
|
37
40
|
from crypticorn.hive.client.models.coins import Coins
|
38
41
|
from crypticorn.hive.client.models.data_download_response import DataDownloadResponse
|
39
42
|
from crypticorn.hive.client.models.data_info import DataInfo
|
40
|
-
from crypticorn.hive.client.models.
|
41
|
-
DataValueValueValueInner,
|
42
|
-
)
|
43
|
+
from crypticorn.hive.client.models.data_options import DataOptions
|
43
44
|
from crypticorn.hive.client.models.data_version import DataVersion
|
44
45
|
from crypticorn.hive.client.models.data_version_info import DataVersionInfo
|
45
46
|
from crypticorn.hive.client.models.download_links import DownloadLinks
|
@@ -52,7 +53,6 @@ from crypticorn.hive.client.models.model import Model
|
|
52
53
|
from crypticorn.hive.client.models.model_create import ModelCreate
|
53
54
|
from crypticorn.hive.client.models.model_status import ModelStatus
|
54
55
|
from crypticorn.hive.client.models.model_update import ModelUpdate
|
55
|
-
from crypticorn.hive.client.models.response_getuptime import ResponseGetuptime
|
56
56
|
from crypticorn.hive.client.models.target import Target
|
57
57
|
from crypticorn.hive.client.models.target_info import TargetInfo
|
58
58
|
from crypticorn.hive.client.models.target_type import TargetType
|
@@ -20,7 +20,6 @@ from pydantic import Field, StrictInt, StrictStr, field_validator
|
|
20
20
|
from typing import Any, Dict, List, Optional
|
21
21
|
from typing_extensions import Annotated
|
22
22
|
from crypticorn.hive.client.models.log_level import LogLevel
|
23
|
-
from crypticorn.hive.client.models.response_getuptime import ResponseGetuptime
|
24
23
|
|
25
24
|
from crypticorn.hive.client.api_client import ApiClient, RequestSerialized
|
26
25
|
from crypticorn.hive.client.api_response import ApiResponse
|
@@ -1223,7 +1222,7 @@ class AdminApi:
|
|
1223
1222
|
_content_type: Optional[StrictStr] = None,
|
1224
1223
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1225
1224
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1226
|
-
) ->
|
1225
|
+
) -> str:
|
1227
1226
|
"""Get Uptime
|
1228
1227
|
|
1229
1228
|
Return the server uptime in seconds or human-readable form.
|
@@ -1261,7 +1260,7 @@ class AdminApi:
|
|
1261
1260
|
)
|
1262
1261
|
|
1263
1262
|
_response_types_map: Dict[str, Optional[str]] = {
|
1264
|
-
"200": "
|
1263
|
+
"200": "str",
|
1265
1264
|
}
|
1266
1265
|
response_data = await self.api_client.call_api(
|
1267
1266
|
*_param, _request_timeout=_request_timeout
|
@@ -1287,7 +1286,7 @@ class AdminApi:
|
|
1287
1286
|
_content_type: Optional[StrictStr] = None,
|
1288
1287
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
1289
1288
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
1290
|
-
) -> ApiResponse[
|
1289
|
+
) -> ApiResponse[str]:
|
1291
1290
|
"""Get Uptime
|
1292
1291
|
|
1293
1292
|
Return the server uptime in seconds or human-readable form.
|
@@ -1325,7 +1324,7 @@ class AdminApi:
|
|
1325
1324
|
)
|
1326
1325
|
|
1327
1326
|
_response_types_map: Dict[str, Optional[str]] = {
|
1328
|
-
"200": "
|
1327
|
+
"200": "str",
|
1329
1328
|
}
|
1330
1329
|
response_data = await self.api_client.call_api(
|
1331
1330
|
*_param, _request_timeout=_request_timeout
|
@@ -1389,7 +1388,7 @@ class AdminApi:
|
|
1389
1388
|
)
|
1390
1389
|
|
1391
1390
|
_response_types_map: Dict[str, Optional[str]] = {
|
1392
|
-
"200": "
|
1391
|
+
"200": "str",
|
1393
1392
|
}
|
1394
1393
|
response_data = await self.api_client.call_api(
|
1395
1394
|
*_param, _request_timeout=_request_timeout
|
@@ -14,12 +14,13 @@ Do not edit the class manually.
|
|
14
14
|
|
15
15
|
|
16
16
|
# import models into model package
|
17
|
+
from crypticorn.hive.client.models.api_error_identifier import ApiErrorIdentifier
|
18
|
+
from crypticorn.hive.client.models.api_error_level import ApiErrorLevel
|
19
|
+
from crypticorn.hive.client.models.api_error_type import ApiErrorType
|
17
20
|
from crypticorn.hive.client.models.coins import Coins
|
18
21
|
from crypticorn.hive.client.models.data_download_response import DataDownloadResponse
|
19
22
|
from crypticorn.hive.client.models.data_info import DataInfo
|
20
|
-
from crypticorn.hive.client.models.
|
21
|
-
DataValueValueValueInner,
|
22
|
-
)
|
23
|
+
from crypticorn.hive.client.models.data_options import DataOptions
|
23
24
|
from crypticorn.hive.client.models.data_version import DataVersion
|
24
25
|
from crypticorn.hive.client.models.data_version_info import DataVersionInfo
|
25
26
|
from crypticorn.hive.client.models.download_links import DownloadLinks
|
@@ -32,7 +33,6 @@ from crypticorn.hive.client.models.model import Model
|
|
32
33
|
from crypticorn.hive.client.models.model_create import ModelCreate
|
33
34
|
from crypticorn.hive.client.models.model_status import ModelStatus
|
34
35
|
from crypticorn.hive.client.models.model_update import ModelUpdate
|
35
|
-
from crypticorn.hive.client.models.response_getuptime import ResponseGetuptime
|
36
36
|
from crypticorn.hive.client.models.target import Target
|
37
37
|
from crypticorn.hive.client.models.target_info import TargetInfo
|
38
38
|
from crypticorn.hive.client.models.target_type import TargetType
|
@@ -0,0 +1,115 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Hive AI API
|
5
|
+
|
6
|
+
API for Hive AI model training and evaluation
|
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
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import json
|
17
|
+
from enum import Enum
|
18
|
+
from typing_extensions import Self
|
19
|
+
|
20
|
+
|
21
|
+
class ApiErrorIdentifier(str, Enum):
|
22
|
+
"""
|
23
|
+
API error identifiers
|
24
|
+
"""
|
25
|
+
|
26
|
+
"""
|
27
|
+
allowed enum values
|
28
|
+
"""
|
29
|
+
ALLOCATION_BELOW_CURRENT_EXPOSURE = "allocation_below_current_exposure"
|
30
|
+
ALLOCATION_BELOW_MIN_AMOUNT = "allocation_below_min_amount"
|
31
|
+
BLACK_SWAN = "black_swan"
|
32
|
+
BOT_ALREADY_DELETED = "bot_already_deleted"
|
33
|
+
BOT_DISABLED = "bot_disabled"
|
34
|
+
BOT_STOPPING_COMPLETED = "bot_stopping_completed"
|
35
|
+
BOT_STOPPING_STARTED = "bot_stopping_started"
|
36
|
+
CLIENT_ORDER_ID_ALREADY_EXISTS = "client_order_id_already_exists"
|
37
|
+
INVALID_CONTENT_TYPE = "invalid_content_type"
|
38
|
+
DELETE_BOT_ERROR = "delete_bot_error"
|
39
|
+
EXCHANGE_INVALID_SIGNATURE = "exchange_invalid_signature"
|
40
|
+
EXCHANGE_INVALID_TIMESTAMP = "exchange_invalid_timestamp"
|
41
|
+
EXCHANGE_IP_ADDRESS_IS_NOT_AUTHORIZED = "exchange_ip_address_is_not_authorized"
|
42
|
+
EXCHANGE_KEY_ALREADY_EXISTS = "exchange_key_already_exists"
|
43
|
+
EXCHANGE_KEY_IN_USE = "exchange_key_in_use"
|
44
|
+
EXCHANGE_SYSTEM_UNDER_MAINTENANCE = "exchange_system_under_maintenance"
|
45
|
+
EXCHANGE_RATE_LIMIT_EXCEEDED = "exchange_rate_limit_exceeded"
|
46
|
+
INSUFFICIENT_PERMISSIONS_SPOT_AND_FUTURES_REQUIRED = (
|
47
|
+
"insufficient_permissions_spot_and_futures_required"
|
48
|
+
)
|
49
|
+
EXCHANGE_SERVICE_TEMPORARILY_UNAVAILABLE = (
|
50
|
+
"exchange_service_temporarily_unavailable"
|
51
|
+
)
|
52
|
+
EXCHANGE_SYSTEM_IS_BUSY = "exchange_system_is_busy"
|
53
|
+
EXCHANGE_SYSTEM_CONFIGURATION_ERROR = "exchange_system_configuration_error"
|
54
|
+
EXCHANGE_INTERNAL_SYSTEM_ERROR = "exchange_internal_system_error"
|
55
|
+
EXCHANGE_USER_ACCOUNT_IS_FROZEN = "exchange_user_account_is_frozen"
|
56
|
+
API_KEY_EXPIRED = "api_key_expired"
|
57
|
+
BEARER_TOKEN_EXPIRED = "bearer_token_expired"
|
58
|
+
FORBIDDEN = "forbidden"
|
59
|
+
HEDGE_MODE_NOT_ACTIVE = "hedge_mode_not_active"
|
60
|
+
HTTP_REQUEST_ERROR = "http_request_error"
|
61
|
+
INSUFFICIENT_BALANCE = "insufficient_balance"
|
62
|
+
INSUFFICIENT_MARGIN = "insufficient_margin"
|
63
|
+
INSUFFICIENT_SCOPES = "insufficient_scopes"
|
64
|
+
INVALID_API_KEY = "invalid_api_key"
|
65
|
+
INVALID_BEARER = "invalid_bearer"
|
66
|
+
INVALID_DATA = "invalid_data"
|
67
|
+
INVALID_DATA_RESPONSE = "invalid_data_response"
|
68
|
+
INVALID_EXCHANGE_KEY = "invalid_exchange_key"
|
69
|
+
INVALID_MARGIN_MODE = "invalid_margin_mode"
|
70
|
+
INVALID_MODEL_NAME = "invalid_model_name"
|
71
|
+
INVALID_PARAMETER_PROVIDED = "invalid_parameter_provided"
|
72
|
+
LEVERAGE_LIMIT_EXCEEDED = "leverage_limit_exceeded"
|
73
|
+
ORDER_VIOLATES_LIQUIDATION_PRICE_CONSTRAINTS = (
|
74
|
+
"order_violates_liquidation_price_constraints"
|
75
|
+
)
|
76
|
+
MODEL_NAME_NOT_UNIQUE = "model_name_not_unique"
|
77
|
+
NO_CREDENTIALS = "no_credentials"
|
78
|
+
NOW_API_DOWN = "now_api_down"
|
79
|
+
OBJECT_ALREADY_EXISTS = "object_already_exists"
|
80
|
+
OBJECT_CREATED = "object_created"
|
81
|
+
OBJECT_DELETED = "object_deleted"
|
82
|
+
OBJECT_NOT_FOUND = "object_not_found"
|
83
|
+
OBJECT_UPDATED = "object_updated"
|
84
|
+
ORDER_IS_ALREADY_FILLED = "order_is_already_filled"
|
85
|
+
ORDER_IS_BEING_PROCESSED = "order_is_being_processed"
|
86
|
+
ORDER_QUANTITY_LIMIT_EXCEEDED = "order_quantity_limit_exceeded"
|
87
|
+
ORDER_DOES_NOT_EXIST = "order_does_not_exist"
|
88
|
+
ORDER_PRICE_IS_INVALID = "order_price_is_invalid"
|
89
|
+
ORDER_SIZE_TOO_LARGE = "order_size_too_large"
|
90
|
+
ORDER_SIZE_TOO_SMALL = "order_size_too_small"
|
91
|
+
POSITION_LIMIT_EXCEEDED = "position_limit_exceeded"
|
92
|
+
POSITION_DOES_NOT_EXIST = "position_does_not_exist"
|
93
|
+
POSITION_OPENING_TEMPORARILY_SUSPENDED = "position_opening_temporarily_suspended"
|
94
|
+
POST_ONLY_ORDER_WOULD_IMMEDIATELY_MATCH = "post_only_order_would_immediately_match"
|
95
|
+
REQUEST_SCOPE_LIMIT_EXCEEDED = "request_scope_limit_exceeded"
|
96
|
+
RISK_LIMIT_EXCEEDED = "risk_limit_exceeded"
|
97
|
+
RPC_TIMEOUT = "rpc_timeout"
|
98
|
+
SYSTEM_SETTLEMENT_IN_PROCESS = "system_settlement_in_process"
|
99
|
+
STRATEGY_ALREADY_EXISTS = "strategy_already_exists"
|
100
|
+
STRATEGY_DISABLED = "strategy_disabled"
|
101
|
+
STRATEGY_LEVERAGE_MISMATCH = "strategy_leverage_mismatch"
|
102
|
+
STRATEGY_NOT_SUPPORTING_EXCHANGE = "strategy_not_supporting_exchange"
|
103
|
+
SUCCESS = "success"
|
104
|
+
SYMBOL_DOES_NOT_EXIST = "symbol_does_not_exist"
|
105
|
+
TRADING_ACTION_EXPIRED = "trading_action_expired"
|
106
|
+
TRADING_ACTION_SKIPPED = "trading_action_skipped"
|
107
|
+
TRADING_HAS_BEEN_LOCKED = "trading_has_been_locked"
|
108
|
+
TRADING_IS_SUSPENDED = "trading_is_suspended"
|
109
|
+
UNKNOWN_ERROR_OCCURRED = "unknown_error_occurred"
|
110
|
+
REQUESTED_RESOURCE_NOT_FOUND = "requested_resource_not_found"
|
111
|
+
|
112
|
+
@classmethod
|
113
|
+
def from_json(cls, json_str: str) -> Self:
|
114
|
+
"""Create an instance of ApiErrorIdentifier from a JSON string"""
|
115
|
+
return cls(json.loads(json_str))
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Hive AI API
|
5
|
+
|
6
|
+
API for Hive AI model training and evaluation
|
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
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import json
|
17
|
+
from enum import Enum
|
18
|
+
from typing_extensions import Self
|
19
|
+
|
20
|
+
|
21
|
+
class ApiErrorLevel(str, Enum):
|
22
|
+
"""
|
23
|
+
API error levels
|
24
|
+
"""
|
25
|
+
|
26
|
+
"""
|
27
|
+
allowed enum values
|
28
|
+
"""
|
29
|
+
ERROR = "error"
|
30
|
+
INFO = "info"
|
31
|
+
SUCCESS = "success"
|
32
|
+
WARNING = "warning"
|
33
|
+
|
34
|
+
@classmethod
|
35
|
+
def from_json(cls, json_str: str) -> Self:
|
36
|
+
"""Create an instance of ApiErrorLevel from a JSON string"""
|
37
|
+
return cls(json.loads(json_str))
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Hive AI API
|
5
|
+
|
6
|
+
API for Hive AI model training and evaluation
|
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
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import json
|
17
|
+
from enum import Enum
|
18
|
+
from typing_extensions import Self
|
19
|
+
|
20
|
+
|
21
|
+
class ApiErrorType(str, Enum):
|
22
|
+
"""
|
23
|
+
Type of API error
|
24
|
+
"""
|
25
|
+
|
26
|
+
"""
|
27
|
+
allowed enum values
|
28
|
+
"""
|
29
|
+
USER_ERROR = "user error"
|
30
|
+
EXCHANGE_ERROR = "exchange error"
|
31
|
+
SERVER_ERROR = "server error"
|
32
|
+
NO_ERROR = "no error"
|
33
|
+
|
34
|
+
@classmethod
|
35
|
+
def from_json(cls, json_str: str) -> Self:
|
36
|
+
"""Create an instance of ApiErrorType from a JSON string"""
|
37
|
+
return cls(json.loads(json_str))
|
@@ -20,9 +20,7 @@ import json
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
22
22
|
from crypticorn.hive.client.models.coins import Coins
|
23
|
-
from crypticorn.hive.client.models.
|
24
|
-
DataValueValueValueInner,
|
25
|
-
)
|
23
|
+
from crypticorn.hive.client.models.data_options import DataOptions
|
26
24
|
from crypticorn.hive.client.models.data_version_info import DataVersionInfo
|
27
25
|
from crypticorn.hive.client.models.feature_size import FeatureSize
|
28
26
|
from crypticorn.hive.client.models.target_info import TargetInfo
|
@@ -35,7 +33,7 @@ class DataInfo(BaseModel):
|
|
35
33
|
The complete data information for all versions, coins, feature sizes and targets
|
36
34
|
""" # noqa: E501
|
37
35
|
|
38
|
-
data: Dict[str, Dict[str,
|
36
|
+
data: Dict[str, Dict[str, DataOptions]] = Field(
|
39
37
|
description="The complete data information for all versions, coins, feature sizes and targets."
|
40
38
|
)
|
41
39
|
coins: List[Coins] = Field(
|
@@ -99,6 +97,13 @@ class DataInfo(BaseModel):
|
|
99
97
|
exclude=excluded_fields,
|
100
98
|
exclude_none=True,
|
101
99
|
)
|
100
|
+
# override the default output from pydantic by calling `to_dict()` of each value in data (dict)
|
101
|
+
_field_dict = {}
|
102
|
+
if self.data:
|
103
|
+
for _key_data in self.data:
|
104
|
+
if self.data[_key_data]:
|
105
|
+
_field_dict[_key_data] = self.data[_key_data].to_dict()
|
106
|
+
_dict["data"] = _field_dict
|
102
107
|
# override the default output from pydantic by calling `to_dict()` of each item in targets (list)
|
103
108
|
_items = []
|
104
109
|
if self.targets:
|
@@ -133,7 +138,24 @@ class DataInfo(BaseModel):
|
|
133
138
|
|
134
139
|
_obj = cls.model_validate(
|
135
140
|
{
|
136
|
-
"data":
|
141
|
+
"data": (
|
142
|
+
dict(
|
143
|
+
(
|
144
|
+
_k,
|
145
|
+
(
|
146
|
+
dict(
|
147
|
+
(_ik, DataOptions.from_dict(_iv))
|
148
|
+
for _ik, _iv in _v.items()
|
149
|
+
)
|
150
|
+
if _v is not None
|
151
|
+
else None
|
152
|
+
),
|
153
|
+
)
|
154
|
+
for _k, _v in obj.get("data").items()
|
155
|
+
)
|
156
|
+
if obj.get("data") is not None
|
157
|
+
else None
|
158
|
+
),
|
137
159
|
"coins": obj.get("coins"),
|
138
160
|
"feature_sizes": obj.get("feature_sizes"),
|
139
161
|
"targets": (
|
@@ -0,0 +1,92 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Hive AI API
|
5
|
+
|
6
|
+
API for Hive AI model training and evaluation
|
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
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
22
|
+
from crypticorn.hive.client.models.feature_size import FeatureSize
|
23
|
+
from crypticorn.hive.client.models.target import Target
|
24
|
+
from typing import Optional, Set
|
25
|
+
from typing_extensions import Self
|
26
|
+
|
27
|
+
|
28
|
+
class DataOptions(BaseModel):
|
29
|
+
"""
|
30
|
+
DataOptions
|
31
|
+
""" # noqa: E501
|
32
|
+
|
33
|
+
targets: List[Target] = Field(
|
34
|
+
description="The targets available on the latest data version."
|
35
|
+
)
|
36
|
+
feature_sizes: List[FeatureSize] = Field(
|
37
|
+
description="The feature sizes available on the latest data version."
|
38
|
+
)
|
39
|
+
__properties: ClassVar[List[str]] = ["targets", "feature_sizes"]
|
40
|
+
|
41
|
+
model_config = ConfigDict(
|
42
|
+
populate_by_name=True,
|
43
|
+
validate_assignment=True,
|
44
|
+
protected_namespaces=(),
|
45
|
+
)
|
46
|
+
|
47
|
+
def to_str(self) -> str:
|
48
|
+
"""Returns the string representation of the model using alias"""
|
49
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
50
|
+
|
51
|
+
def to_json(self) -> str:
|
52
|
+
"""Returns the JSON representation of the model using alias"""
|
53
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
54
|
+
return json.dumps(self.to_dict())
|
55
|
+
|
56
|
+
@classmethod
|
57
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
58
|
+
"""Create an instance of DataOptions from a JSON string"""
|
59
|
+
return cls.from_dict(json.loads(json_str))
|
60
|
+
|
61
|
+
def to_dict(self) -> Dict[str, Any]:
|
62
|
+
"""Return the dictionary representation of the model using alias.
|
63
|
+
|
64
|
+
This has the following differences from calling pydantic's
|
65
|
+
`self.model_dump(by_alias=True)`:
|
66
|
+
|
67
|
+
* `None` is only added to the output dict for nullable fields that
|
68
|
+
were set at model initialization. Other fields with value `None`
|
69
|
+
are ignored.
|
70
|
+
"""
|
71
|
+
excluded_fields: Set[str] = set([])
|
72
|
+
|
73
|
+
_dict = self.model_dump(
|
74
|
+
by_alias=True,
|
75
|
+
exclude=excluded_fields,
|
76
|
+
exclude_none=True,
|
77
|
+
)
|
78
|
+
return _dict
|
79
|
+
|
80
|
+
@classmethod
|
81
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
82
|
+
"""Create an instance of DataOptions from a dict"""
|
83
|
+
if obj is None:
|
84
|
+
return None
|
85
|
+
|
86
|
+
if not isinstance(obj, dict):
|
87
|
+
return cls.model_validate(obj)
|
88
|
+
|
89
|
+
_obj = cls.model_validate(
|
90
|
+
{"targets": obj.get("targets"), "feature_sizes": obj.get("feature_sizes")}
|
91
|
+
)
|
92
|
+
return _obj
|
@@ -19,6 +19,9 @@ import json
|
|
19
19
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
+
from crypticorn.hive.client.models.api_error_identifier import ApiErrorIdentifier
|
23
|
+
from crypticorn.hive.client.models.api_error_level import ApiErrorLevel
|
24
|
+
from crypticorn.hive.client.models.api_error_type import ApiErrorType
|
22
25
|
from typing import Optional, Set
|
23
26
|
from typing_extensions import Self
|
24
27
|
|
@@ -29,9 +32,9 @@ class ExceptionDetail(BaseModel):
|
|
29
32
|
""" # noqa: E501
|
30
33
|
|
31
34
|
message: Optional[StrictStr] = None
|
32
|
-
code:
|
33
|
-
type:
|
34
|
-
level:
|
35
|
+
code: ApiErrorIdentifier = Field(description="The unique error code")
|
36
|
+
type: ApiErrorType = Field(description="The type of error")
|
37
|
+
level: ApiErrorLevel = Field(description="The level of the error")
|
35
38
|
status_code: StrictInt = Field(description="The HTTP status code")
|
36
39
|
details: Optional[Any] = None
|
37
40
|
__properties: ClassVar[List[str]] = [
|
@@ -33,7 +33,7 @@ class Model(BaseModel):
|
|
33
33
|
Pydantic model for model response
|
34
34
|
""" # noqa: E501
|
35
35
|
|
36
|
-
|
36
|
+
id: StrictInt = Field(description="Unique model identifier")
|
37
37
|
name: StrictStr = Field(description="Model name")
|
38
38
|
coin_id: Coins = Field(description="Coin ID")
|
39
39
|
target: Target = Field(description="Target variable")
|
@@ -44,7 +44,7 @@ class Model(BaseModel):
|
|
44
44
|
created_at: StrictInt = Field(description="Model creation unix timestamp")
|
45
45
|
updated_at: StrictInt = Field(description="Model update unix timestamp")
|
46
46
|
__properties: ClassVar[List[str]] = [
|
47
|
-
"
|
47
|
+
"id",
|
48
48
|
"name",
|
49
49
|
"coin_id",
|
50
50
|
"target",
|
@@ -113,7 +113,7 @@ class Model(BaseModel):
|
|
113
113
|
|
114
114
|
_obj = cls.model_validate(
|
115
115
|
{
|
116
|
-
"
|
116
|
+
"id": obj.get("id"),
|
117
117
|
"name": obj.get("name"),
|
118
118
|
"coin_id": obj.get("coin_id"),
|
119
119
|
"target": obj.get("target"),
|
crypticorn/hive/main.py
CHANGED
@@ -9,8 +9,12 @@ from crypticorn.hive import (
|
|
9
9
|
StatusApi,
|
10
10
|
Configuration,
|
11
11
|
AdminApi,
|
12
|
+
DataVersion,
|
13
|
+
FeatureSize,
|
12
14
|
)
|
13
15
|
from crypticorn.hive.utils import download_file
|
16
|
+
from typing import Optional
|
17
|
+
from pydantic import StrictInt
|
14
18
|
|
15
19
|
|
16
20
|
class DataApiWrapper(DataApi):
|
@@ -18,7 +22,15 @@ class DataApiWrapper(DataApi):
|
|
18
22
|
A wrapper for the DataApi class.
|
19
23
|
"""
|
20
24
|
|
21
|
-
async def download_data(
|
25
|
+
async def download_data(
|
26
|
+
self,
|
27
|
+
model_id: StrictInt,
|
28
|
+
folder: Path = Path("data"),
|
29
|
+
version: Optional[DataVersion] = None,
|
30
|
+
feature_size: Optional[FeatureSize] = None,
|
31
|
+
*args,
|
32
|
+
**kwargs,
|
33
|
+
) -> list[Path]:
|
22
34
|
"""
|
23
35
|
Download data for model training. All three files (y_train, x_test, x_train) are downloaded and saved under e.g. FOLDER/v1/coin_1/*.feather.
|
24
36
|
The folder will be created if it doesn't exist.
|
@@ -28,7 +40,13 @@ class DataApiWrapper(DataApi):
|
|
28
40
|
:param feature_size: The number of features in the data. Default is LARGE. (optional) (type: FeatureSize)
|
29
41
|
:return: A list of paths to the downloaded files.
|
30
42
|
"""
|
31
|
-
response = await super().download_data(
|
43
|
+
response = await super().download_data(
|
44
|
+
model_id=model_id,
|
45
|
+
version=version,
|
46
|
+
feature_size=feature_size,
|
47
|
+
*args,
|
48
|
+
**kwargs,
|
49
|
+
)
|
32
50
|
base_path = f"{folder}/v{response.version.value}/coin_{response.coin.value}/"
|
33
51
|
os.makedirs(base_path, exist_ok=True)
|
34
52
|
|
crypticorn/pay/main.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: crypticorn
|
3
|
-
Version: 2.8.
|
3
|
+
Version: 2.8.0rc8
|
4
4
|
Summary: Maximise Your Crypto Trading Profits with Machine Learning
|
5
5
|
Author-email: Crypticorn <timon@crypticorn.com>
|
6
6
|
License: MIT
|
@@ -84,7 +84,7 @@ The ApiClient serves as the central interface for API operations. It instantiate
|
|
84
84
|
|
85
85
|
<img src="../static/pip-structure.svg" alt="pip package structure" />
|
86
86
|
|
87
|
-
You can either explore each API by clicking through the library or checkout the [API Documentation](https://docs.crypticorn.
|
87
|
+
You can either explore each API by clicking through the library or checkout the [API Documentation](https://docs.crypticorn.com/api).
|
88
88
|
|
89
89
|
Request and response models for API operations should be accessed through the sub package you are using for an operation. All symbols are re-exported at the sub package level for convenience.
|
90
90
|
|
@@ -180,7 +180,7 @@ Some API operations allow to get the returned data formatted as a pandas Datafra
|
|
180
180
|
|
181
181
|
### Data Downloads
|
182
182
|
This utility allows direct data streaming to your local disk, instead of only returning download links. It is being used in the following functions:
|
183
|
-
- `client.hive.data.download_data()` (overrides the [default response](https://docs.crypticorn.
|
183
|
+
- `client.hive.data.download_data()` (overrides the [default response](https://docs.crypticorn.com/api/?api=hive-ai-api#tag/data/GET/data))
|
184
184
|
|
185
185
|
## Advanced Usage
|
186
186
|
|
@@ -1,5 +1,5 @@
|
|
1
|
-
crypticorn/__init__.py,sha256=
|
2
|
-
crypticorn/client.py,sha256=
|
1
|
+
crypticorn/__init__.py,sha256=IWYO6MWcpNmgkH05xEywxcIjcegWuSo5cpNIDTRcpC8,303
|
2
|
+
crypticorn/client.py,sha256=XcJhgMoNSFQZJU3AoYuvxRMh-HPBPBlugKMpGSHxbIE,4700
|
3
3
|
crypticorn/auth/__init__.py,sha256=JAl1tBLK9pYLr_-YKaj581c-c94PWLoqnatTIVAVvMM,81
|
4
4
|
crypticorn/auth/main.py,sha256=j8eRGN2gUWyeOCnWnUPe3mCAfaidGnOMnZRiSQy-yzM,720
|
5
5
|
crypticorn/auth/client/__init__.py,sha256=do16xS84uXvVoJuWERjb9RwlOaLy4UF4uKBZWczFC3c,5291
|
@@ -69,10 +69,10 @@ crypticorn/common/auth.py,sha256=GIb9MikQsSxqz-K5rDIOroP5mFoTgQqwByTGO5JqcdM,871
|
|
69
69
|
crypticorn/common/decorators.py,sha256=pmnGYCIrLv59wZkDbvPyK9NJmgPJWW74LXTdIWSjOkY,1063
|
70
70
|
crypticorn/common/enums.py,sha256=RitDVqlG_HTe6tHT6bWusZNFCeYk1eQvJVH-7x3_Zlg,668
|
71
71
|
crypticorn/common/errors.py,sha256=8jxZ2lLn_NoFKKq6n2JwKPsR0dA2vkGnbXDfEK6ndH0,27851
|
72
|
-
crypticorn/common/exceptions.py,sha256=
|
73
|
-
crypticorn/common/logging.py,sha256=
|
74
|
-
crypticorn/common/middleware.py,sha256=
|
75
|
-
crypticorn/common/mixins.py,sha256=
|
72
|
+
crypticorn/common/exceptions.py,sha256=Kw3AtqaLaAvSs1fLCn7uNMhV6QZdsCpS2CjtIsoiXSA,6198
|
73
|
+
crypticorn/common/logging.py,sha256=MTB94rsKxnfQVMECHW16A1MmnnzrHaEQ6oWHmQqHUFA,4339
|
74
|
+
crypticorn/common/middleware.py,sha256=YF0_tTjQekZkb6ip3xsqy04JCI4S8011CiSL3helU2E,962
|
75
|
+
crypticorn/common/mixins.py,sha256=o-VONtAS_nHH-OPCFXox6kdX_Xdn1g37uTtkLqij-6U,1722
|
76
76
|
crypticorn/common/pagination.py,sha256=c07jrMNrBaNTmgx4sppdP7ND4RNT7NBqBXWvofazIlE,2251
|
77
77
|
crypticorn/common/scopes.py,sha256=ofJ5FDf30wab572XvDzAXVKBIUWa3shScAmzNrJsWqQ,2453
|
78
78
|
crypticorn/common/urls.py,sha256=3Gf1NU1XQYcOTjcdztG3bDAE98FVbgTK2QXzUe7tFVQ,878
|
@@ -80,9 +80,9 @@ crypticorn/common/utils.py,sha256=Kz2-I96MKIGKM18PHQ77VbKHLMGUvZG_jjj7xpQed8k,21
|
|
80
80
|
crypticorn/common/router/admin_router.py,sha256=qtIGJytOq_0YlyZGWvvZ15ymRaDccGsEVwEZ81aNgUk,3388
|
81
81
|
crypticorn/common/router/status_router.py,sha256=922dHfpVM5auOTuNswIhDRmk_1bmU5hH83bxoT70uss,616
|
82
82
|
crypticorn/hive/__init__.py,sha256=hRfTlEzEql4msytdUC_04vfaHzVKG5CGZle1M-9QFgY,81
|
83
|
-
crypticorn/hive/main.py,sha256=
|
83
|
+
crypticorn/hive/main.py,sha256=eoo5bTmbfS94zuYHDkD20orNANESYuTURHQNw3pIEvQ,2875
|
84
84
|
crypticorn/hive/utils.py,sha256=dxQ_OszrnTsslO5hDefMmgfj6yRwRPr8sr17fGizWIw,2066
|
85
|
-
crypticorn/hive/client/__init__.py,sha256=
|
85
|
+
crypticorn/hive/client/__init__.py,sha256=DIC-Gy384GgwFXehCLPrsud67WQn2zADFVo4FbgHWiY,2636
|
86
86
|
crypticorn/hive/client/api_client.py,sha256=fDFsACK7hxXw_sgt3ZJVH2RplEdUhR0YZd4tsZA9P5Q,26869
|
87
87
|
crypticorn/hive/client/api_response.py,sha256=WhxwYDSMm6wPixp9CegO8dJzjFxDz3JF1yCq9s0ZqKE,639
|
88
88
|
crypticorn/hive/client/configuration.py,sha256=J4tZF5m71BMOFE1rfWzgrBWEPQ-DQ-FByFJiNZ81W48,19105
|
@@ -90,28 +90,30 @@ crypticorn/hive/client/exceptions.py,sha256=IKuM8sbMtr3T9z-fOuePTJmheUFahzmyZ8ia
|
|
90
90
|
crypticorn/hive/client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
91
91
|
crypticorn/hive/client/rest.py,sha256=VhXkE7R3y1RD0QmbvIwmsk-LP_DmOei_zd9YiIXer28,6975
|
92
92
|
crypticorn/hive/client/api/__init__.py,sha256=Qp35Nx0HEuKa8YmFcv6iSAqrLuR0YczPK7R-EEBDYuo,281
|
93
|
-
crypticorn/hive/client/api/admin_api.py,sha256=
|
93
|
+
crypticorn/hive/client/api/admin_api.py,sha256=KoEcDZ8tpJ86H8sUZUrZBAzF24ewDfG0HX61IbjnQyo,58649
|
94
94
|
crypticorn/hive/client/api/data_api.py,sha256=GJlH2Qs1KmWCc4nv7y5byyyFDiidLdooG-WvbBv-Z-4,22624
|
95
95
|
crypticorn/hive/client/api/models_api.py,sha256=W35VZR5OQvwHk7v1WFO85m97FovnoWjdsskA4qU165Y,74143
|
96
96
|
crypticorn/hive/client/api/status_api.py,sha256=KIpSewGuK6_cUT6dfUjlvt35k1xW4YZcuSTCPWFURms,19577
|
97
|
-
crypticorn/hive/client/models/__init__.py,sha256=
|
97
|
+
crypticorn/hive/client/models/__init__.py,sha256=SxW9EZLd6FULaHE14S-K8otx7MGj6vB4YpkhWWhLdg4,1786
|
98
|
+
crypticorn/hive/client/models/api_error_identifier.py,sha256=7-y5KzdprlPOS4Ar3z7sWG90vCVjQjNIg_jhQmm0yBk,4901
|
99
|
+
crypticorn/hive/client/models/api_error_level.py,sha256=7ucfXQ27SckkLGSfmexF9kV6mDqFHyP9c_y6nGhFfKc,718
|
100
|
+
crypticorn/hive/client/models/api_error_type.py,sha256=YB6Fw0rmeGtEy2gx0XVfcqyw-VpJkd7KoszPni7STZ4,759
|
98
101
|
crypticorn/hive/client/models/coins.py,sha256=4rPueVFUDbdU-8KrZ5b1jwqasf3uMT_cIsORyKbeydc,875
|
99
102
|
crypticorn/hive/client/models/data_download_response.py,sha256=AVPLov8RO9zq6vThUe7M4p3LlhZQytXyPbFZD1AFDfY,3649
|
100
|
-
crypticorn/hive/client/models/data_info.py,sha256=
|
101
|
-
crypticorn/hive/client/models/
|
103
|
+
crypticorn/hive/client/models/data_info.py,sha256=xhP_JFJP9jikOsOsPT4DJEbwGpDB8rfo5FDA1LT0ecs,6633
|
104
|
+
crypticorn/hive/client/models/data_options.py,sha256=akpUT6EaGS2AxiKPAMS3pwl9XuRoSjKe9T91xhjGlaI,2785
|
102
105
|
crypticorn/hive/client/models/data_version.py,sha256=Id_PKD-6GDVgkxbg194s3gOokgpX3WbLQ3CGdctnajU,663
|
103
106
|
crypticorn/hive/client/models/data_version_info.py,sha256=LdwEwSgGfOzjitxiPXZfEp7IDkMQJs_7SCftZI0-5TQ,2687
|
104
107
|
crypticorn/hive/client/models/download_links.py,sha256=nXq__ZoJ2ZVqeofVolB9B47LgGGDQKorPBNRsdp8uPU,2854
|
105
108
|
crypticorn/hive/client/models/evaluation.py,sha256=WeLJA4tCS4W_CnGxRAgrxySWko3QPYzpxeVDuYyLPgM,2608
|
106
109
|
crypticorn/hive/client/models/evaluation_response.py,sha256=iwE1G1_EOFga6Zztf1A8z6TNiNc_R06r2lKLHIr5_6A,2526
|
107
|
-
crypticorn/hive/client/models/exception_detail.py,sha256=
|
110
|
+
crypticorn/hive/client/models/exception_detail.py,sha256=bWZxtSADoPajuXrPYCskmmzJ14s1R2H3BtsbxkBewWc,3903
|
108
111
|
crypticorn/hive/client/models/feature_size.py,sha256=saLwDjXIzoa9sPO0lMvm3x4FavG2-IbBLub7-TOzW2M,785
|
109
112
|
crypticorn/hive/client/models/log_level.py,sha256=PcqRrIF-dJ1wnssdHlbA6SsPUjB1T4IpRGttsedeuyQ,722
|
110
|
-
crypticorn/hive/client/models/model.py,sha256=
|
113
|
+
crypticorn/hive/client/models/model.py,sha256=iLVq8r5lUL86vubUDTcBXmdpSjhncNEk7BrCG_MZC1s,4512
|
111
114
|
crypticorn/hive/client/models/model_create.py,sha256=f6Ayw3KD39qw0qtvYF77K3huy7_Tmzv8pDyyQ_ooAG8,2828
|
112
115
|
crypticorn/hive/client/models/model_status.py,sha256=-2H6CHw6jhJgv4VJgwr1sgN2NtT1m7LGCX7L8ULTxEQ,685
|
113
116
|
crypticorn/hive/client/models/model_update.py,sha256=iO-VtYt0aRzj9z_GeIUK2OVNg9yvM01OUVfWyCA36fc,2413
|
114
|
-
crypticorn/hive/client/models/response_getuptime.py,sha256=i4IelPWr2yQuJxHQigbpkH0UG9N9AktS8SUWnouiCIk,5014
|
115
117
|
crypticorn/hive/client/models/target.py,sha256=otOJK8s5WVUen6J1AQZpRiD330RIpaJU6JShb-EU8Hs,777
|
116
118
|
crypticorn/hive/client/models/target_info.py,sha256=hFaOMZlirH2B68DQstL_c4WvtejwXyOk67lxIaeuh3Q,2857
|
117
119
|
crypticorn/hive/client/models/target_type.py,sha256=FUMaEFkPM7EvStPJE1auimDJ9mxDf6pbsFf-dF3coGw,684
|
@@ -167,7 +169,7 @@ crypticorn/metrics/client/models/severity.py,sha256=Bwls2jjCMP2lKc-_67d5WZbGPAeb
|
|
167
169
|
crypticorn/metrics/client/models/time_interval.py,sha256=8bHhMNt56xVGvJi5xNFMrAkAZFRKfym1UkeGoM2H0j8,772
|
168
170
|
crypticorn/metrics/client/models/trading_status.py,sha256=_S-KAyuCJsLLY0UTcNKkhLWoPJS-ywf7y3yTdhIuF0w,746
|
169
171
|
crypticorn/pay/__init__.py,sha256=ux-B-YbNetpTlZTb2fijuGUOEmSm4IB0fYtieGnVDBg,78
|
170
|
-
crypticorn/pay/main.py,sha256=
|
172
|
+
crypticorn/pay/main.py,sha256=AP0bQLIP6QehbR6o7lswSu2HTPjnnkTD72VsHMYw_Tk,697
|
171
173
|
crypticorn/pay/client/__init__.py,sha256=t51BXLDtwIAkAUFYhBnme4xRzqf-zHwaJ6tvPPUEeDo,2115
|
172
174
|
crypticorn/pay/client/api_client.py,sha256=HjmMJeQ4hcDNWm5I9LEQtZEGD1hPeyQU2y_SLmgD9mE,26870
|
173
175
|
crypticorn/pay/client/api_response.py,sha256=WhxwYDSMm6wPixp9CegO8dJzjFxDz3JF1yCq9s0ZqKE,639
|
@@ -234,8 +236,8 @@ crypticorn/trade/client/models/strategy_model_input.py,sha256=ala19jARyfA5ysys5D
|
|
234
236
|
crypticorn/trade/client/models/strategy_model_output.py,sha256=2o2lhbgUSTznowpMLEHF1Ex9TG9oRmzlCIb-gXqo7_s,5643
|
235
237
|
crypticorn/trade/client/models/tpsl.py,sha256=C2KgTIZs-a8W4msdaXgBKJcwtA-o5wR4rBauRP-iQxU,4317
|
236
238
|
crypticorn/trade/client/models/trading_action_type.py,sha256=pGq_TFLMPfYFizYP-xKgEC1ZF4U3lGdJYoGa_ZH2x-Q,769
|
237
|
-
crypticorn-2.8.
|
238
|
-
crypticorn-2.8.
|
239
|
-
crypticorn-2.8.
|
240
|
-
crypticorn-2.8.
|
241
|
-
crypticorn-2.8.
|
239
|
+
crypticorn-2.8.0rc8.dist-info/METADATA,sha256=xyT_tWQ05a1RdYJIUHk1rs2GffyzAN9PMGoqKHbE5ak,8098
|
240
|
+
crypticorn-2.8.0rc8.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
|
241
|
+
crypticorn-2.8.0rc8.dist-info/entry_points.txt,sha256=d_xHsGvUTebPveVUK0SrpDFQ5ZRSjlI7lNCc11sn2PM,59
|
242
|
+
crypticorn-2.8.0rc8.dist-info/top_level.txt,sha256=EP3NY216qIBYfmvGl0L2Zc9ItP0DjGSkiYqd9xJwGcM,11
|
243
|
+
crypticorn-2.8.0rc8.dist-info/RECORD,,
|
@@ -1,154 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
"""
|
4
|
-
Hive AI API
|
5
|
-
|
6
|
-
API for Hive AI model training and evaluation
|
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
|
-
|
15
|
-
from __future__ import annotations
|
16
|
-
from inspect import getfullargspec
|
17
|
-
import json
|
18
|
-
import pprint
|
19
|
-
import re # noqa: F401
|
20
|
-
from pydantic import (
|
21
|
-
BaseModel,
|
22
|
-
ConfigDict,
|
23
|
-
Field,
|
24
|
-
StrictStr,
|
25
|
-
ValidationError,
|
26
|
-
field_validator,
|
27
|
-
)
|
28
|
-
from typing import Optional
|
29
|
-
from crypticorn.hive.client.models.feature_size import FeatureSize
|
30
|
-
from crypticorn.hive.client.models.target import Target
|
31
|
-
from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
|
32
|
-
from typing_extensions import Literal, Self
|
33
|
-
from pydantic import Field
|
34
|
-
|
35
|
-
DATAVALUEVALUEVALUEINNER_ANY_OF_SCHEMAS = ["FeatureSize", "Target"]
|
36
|
-
|
37
|
-
|
38
|
-
class DataValueValueValueInner(BaseModel):
|
39
|
-
"""
|
40
|
-
DataValueValueValueInner
|
41
|
-
"""
|
42
|
-
|
43
|
-
# data type: FeatureSize
|
44
|
-
anyof_schema_1_validator: Optional[FeatureSize] = None
|
45
|
-
# data type: Target
|
46
|
-
anyof_schema_2_validator: Optional[Target] = None
|
47
|
-
if TYPE_CHECKING:
|
48
|
-
actual_instance: Optional[Union[FeatureSize, Target]] = None
|
49
|
-
else:
|
50
|
-
actual_instance: Any = None
|
51
|
-
any_of_schemas: Set[str] = {"FeatureSize", "Target"}
|
52
|
-
|
53
|
-
model_config = {
|
54
|
-
"validate_assignment": True,
|
55
|
-
"protected_namespaces": (),
|
56
|
-
}
|
57
|
-
|
58
|
-
def __init__(self, *args, **kwargs) -> None:
|
59
|
-
if args:
|
60
|
-
if len(args) > 1:
|
61
|
-
raise ValueError(
|
62
|
-
"If a position argument is used, only 1 is allowed to set `actual_instance`"
|
63
|
-
)
|
64
|
-
if kwargs:
|
65
|
-
raise ValueError(
|
66
|
-
"If a position argument is used, keyword arguments cannot be used."
|
67
|
-
)
|
68
|
-
super().__init__(actual_instance=args[0])
|
69
|
-
else:
|
70
|
-
super().__init__(**kwargs)
|
71
|
-
|
72
|
-
@field_validator("actual_instance")
|
73
|
-
def actual_instance_must_validate_anyof(cls, v):
|
74
|
-
instance = DataValueValueValueInner.model_construct()
|
75
|
-
error_messages = []
|
76
|
-
# validate data type: FeatureSize
|
77
|
-
if not isinstance(v, FeatureSize):
|
78
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `FeatureSize`")
|
79
|
-
else:
|
80
|
-
return v
|
81
|
-
|
82
|
-
# validate data type: Target
|
83
|
-
if not isinstance(v, Target):
|
84
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `Target`")
|
85
|
-
else:
|
86
|
-
return v
|
87
|
-
|
88
|
-
if error_messages:
|
89
|
-
# no match
|
90
|
-
raise ValueError(
|
91
|
-
"No match found when setting the actual_instance in DataValueValueValueInner with anyOf schemas: FeatureSize, Target. Details: "
|
92
|
-
+ ", ".join(error_messages)
|
93
|
-
)
|
94
|
-
else:
|
95
|
-
return v
|
96
|
-
|
97
|
-
@classmethod
|
98
|
-
def from_dict(cls, obj: Dict[str, Any]) -> Self:
|
99
|
-
return cls.from_json(json.dumps(obj))
|
100
|
-
|
101
|
-
@classmethod
|
102
|
-
def from_json(cls, json_str: str) -> Self:
|
103
|
-
"""Returns the object represented by the json string"""
|
104
|
-
instance = cls.model_construct()
|
105
|
-
error_messages = []
|
106
|
-
# anyof_schema_1_validator: Optional[FeatureSize] = None
|
107
|
-
try:
|
108
|
-
instance.actual_instance = FeatureSize.from_json(json_str)
|
109
|
-
return instance
|
110
|
-
except (ValidationError, ValueError) as e:
|
111
|
-
error_messages.append(str(e))
|
112
|
-
# anyof_schema_2_validator: Optional[Target] = None
|
113
|
-
try:
|
114
|
-
instance.actual_instance = Target.from_json(json_str)
|
115
|
-
return instance
|
116
|
-
except (ValidationError, ValueError) as e:
|
117
|
-
error_messages.append(str(e))
|
118
|
-
|
119
|
-
if error_messages:
|
120
|
-
# no match
|
121
|
-
raise ValueError(
|
122
|
-
"No match found when deserializing the JSON string into DataValueValueValueInner with anyOf schemas: FeatureSize, Target. Details: "
|
123
|
-
+ ", ".join(error_messages)
|
124
|
-
)
|
125
|
-
else:
|
126
|
-
return instance
|
127
|
-
|
128
|
-
def to_json(self) -> str:
|
129
|
-
"""Returns the JSON representation of the actual instance"""
|
130
|
-
if self.actual_instance is None:
|
131
|
-
return "null"
|
132
|
-
|
133
|
-
if hasattr(self.actual_instance, "to_json") and callable(
|
134
|
-
self.actual_instance.to_json
|
135
|
-
):
|
136
|
-
return self.actual_instance.to_json()
|
137
|
-
else:
|
138
|
-
return json.dumps(self.actual_instance)
|
139
|
-
|
140
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], FeatureSize, Target]]:
|
141
|
-
"""Returns the dict representation of the actual instance"""
|
142
|
-
if self.actual_instance is None:
|
143
|
-
return None
|
144
|
-
|
145
|
-
if hasattr(self.actual_instance, "to_dict") and callable(
|
146
|
-
self.actual_instance.to_dict
|
147
|
-
):
|
148
|
-
return self.actual_instance.to_dict()
|
149
|
-
else:
|
150
|
-
return self.actual_instance
|
151
|
-
|
152
|
-
def to_str(self) -> str:
|
153
|
-
"""Returns the string representation of the actual instance"""
|
154
|
-
return pprint.pformat(self.model_dump())
|
@@ -1,159 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
"""
|
4
|
-
Hive AI API
|
5
|
-
|
6
|
-
API for Hive AI model training and evaluation
|
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
|
-
|
15
|
-
from __future__ import annotations
|
16
|
-
from inspect import getfullargspec
|
17
|
-
import json
|
18
|
-
import pprint
|
19
|
-
import re # noqa: F401
|
20
|
-
from pydantic import (
|
21
|
-
BaseModel,
|
22
|
-
ConfigDict,
|
23
|
-
Field,
|
24
|
-
StrictInt,
|
25
|
-
StrictStr,
|
26
|
-
ValidationError,
|
27
|
-
field_validator,
|
28
|
-
)
|
29
|
-
from typing import Optional
|
30
|
-
from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
|
31
|
-
from typing_extensions import Literal, Self
|
32
|
-
from pydantic import Field
|
33
|
-
|
34
|
-
RESPONSEGETUPTIME_ANY_OF_SCHEMAS = ["int", "str"]
|
35
|
-
|
36
|
-
|
37
|
-
class ResponseGetuptime(BaseModel):
|
38
|
-
"""
|
39
|
-
ResponseGetuptime
|
40
|
-
"""
|
41
|
-
|
42
|
-
# data type: int
|
43
|
-
anyof_schema_1_validator: Optional[StrictInt] = None
|
44
|
-
# data type: str
|
45
|
-
anyof_schema_2_validator: Optional[StrictStr] = None
|
46
|
-
if TYPE_CHECKING:
|
47
|
-
actual_instance: Optional[Union[int, str]] = None
|
48
|
-
else:
|
49
|
-
actual_instance: Any = None
|
50
|
-
any_of_schemas: Set[str] = {"int", "str"}
|
51
|
-
|
52
|
-
model_config = {
|
53
|
-
"validate_assignment": True,
|
54
|
-
"protected_namespaces": (),
|
55
|
-
}
|
56
|
-
|
57
|
-
def __init__(self, *args, **kwargs) -> None:
|
58
|
-
if args:
|
59
|
-
if len(args) > 1:
|
60
|
-
raise ValueError(
|
61
|
-
"If a position argument is used, only 1 is allowed to set `actual_instance`"
|
62
|
-
)
|
63
|
-
if kwargs:
|
64
|
-
raise ValueError(
|
65
|
-
"If a position argument is used, keyword arguments cannot be used."
|
66
|
-
)
|
67
|
-
super().__init__(actual_instance=args[0])
|
68
|
-
else:
|
69
|
-
super().__init__(**kwargs)
|
70
|
-
|
71
|
-
@field_validator("actual_instance")
|
72
|
-
def actual_instance_must_validate_anyof(cls, v):
|
73
|
-
instance = ResponseGetuptime.model_construct()
|
74
|
-
error_messages = []
|
75
|
-
# validate data type: int
|
76
|
-
try:
|
77
|
-
instance.anyof_schema_1_validator = v
|
78
|
-
return v
|
79
|
-
except (ValidationError, ValueError) as e:
|
80
|
-
error_messages.append(str(e))
|
81
|
-
# validate data type: str
|
82
|
-
try:
|
83
|
-
instance.anyof_schema_2_validator = v
|
84
|
-
return v
|
85
|
-
except (ValidationError, ValueError) as e:
|
86
|
-
error_messages.append(str(e))
|
87
|
-
if error_messages:
|
88
|
-
# no match
|
89
|
-
raise ValueError(
|
90
|
-
"No match found when setting the actual_instance in ResponseGetuptime with anyOf schemas: int, str. Details: "
|
91
|
-
+ ", ".join(error_messages)
|
92
|
-
)
|
93
|
-
else:
|
94
|
-
return v
|
95
|
-
|
96
|
-
@classmethod
|
97
|
-
def from_dict(cls, obj: Dict[str, Any]) -> Self:
|
98
|
-
return cls.from_json(json.dumps(obj))
|
99
|
-
|
100
|
-
@classmethod
|
101
|
-
def from_json(cls, json_str: str) -> Self:
|
102
|
-
"""Returns the object represented by the json string"""
|
103
|
-
instance = cls.model_construct()
|
104
|
-
error_messages = []
|
105
|
-
# deserialize data into int
|
106
|
-
try:
|
107
|
-
# validation
|
108
|
-
instance.anyof_schema_1_validator = json.loads(json_str)
|
109
|
-
# assign value to actual_instance
|
110
|
-
instance.actual_instance = instance.anyof_schema_1_validator
|
111
|
-
return instance
|
112
|
-
except (ValidationError, ValueError) as e:
|
113
|
-
error_messages.append(str(e))
|
114
|
-
# deserialize data into str
|
115
|
-
try:
|
116
|
-
# validation
|
117
|
-
instance.anyof_schema_2_validator = json.loads(json_str)
|
118
|
-
# assign value to actual_instance
|
119
|
-
instance.actual_instance = instance.anyof_schema_2_validator
|
120
|
-
return instance
|
121
|
-
except (ValidationError, ValueError) as e:
|
122
|
-
error_messages.append(str(e))
|
123
|
-
|
124
|
-
if error_messages:
|
125
|
-
# no match
|
126
|
-
raise ValueError(
|
127
|
-
"No match found when deserializing the JSON string into ResponseGetuptime with anyOf schemas: int, str. Details: "
|
128
|
-
+ ", ".join(error_messages)
|
129
|
-
)
|
130
|
-
else:
|
131
|
-
return instance
|
132
|
-
|
133
|
-
def to_json(self) -> str:
|
134
|
-
"""Returns the JSON representation of the actual instance"""
|
135
|
-
if self.actual_instance is None:
|
136
|
-
return "null"
|
137
|
-
|
138
|
-
if hasattr(self.actual_instance, "to_json") and callable(
|
139
|
-
self.actual_instance.to_json
|
140
|
-
):
|
141
|
-
return self.actual_instance.to_json()
|
142
|
-
else:
|
143
|
-
return json.dumps(self.actual_instance)
|
144
|
-
|
145
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], int, str]]:
|
146
|
-
"""Returns the dict representation of the actual instance"""
|
147
|
-
if self.actual_instance is None:
|
148
|
-
return None
|
149
|
-
|
150
|
-
if hasattr(self.actual_instance, "to_dict") and callable(
|
151
|
-
self.actual_instance.to_dict
|
152
|
-
):
|
153
|
-
return self.actual_instance.to_dict()
|
154
|
-
else:
|
155
|
-
return self.actual_instance
|
156
|
-
|
157
|
-
def to_str(self) -> str:
|
158
|
-
"""Returns the string representation of the actual instance"""
|
159
|
-
return pprint.pformat(self.model_dump())
|
File without changes
|
File without changes
|
File without changes
|