crypticorn 2.10.3__py3-none-any.whl → 2.11.0__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/common/ansi_colors.py +4 -2
- crypticorn/common/auth.py +11 -9
- crypticorn/common/enums.py +5 -1
- crypticorn/common/errors.py +5 -1
- crypticorn/common/exceptions.py +4 -1
- crypticorn/common/logging.py +5 -1
- crypticorn/common/scopes.py +4 -1
- crypticorn/common/urls.py +5 -1
- crypticorn/common/utils.py +3 -3
- crypticorn/common/warnings.py +2 -2
- {crypticorn-2.10.3.dist-info → crypticorn-2.11.0.dist-info}/METADATA +4 -3
- {crypticorn-2.10.3.dist-info → crypticorn-2.11.0.dist-info}/RECORD +16 -16
- {crypticorn-2.10.3.dist-info → crypticorn-2.11.0.dist-info}/WHEEL +0 -0
- {crypticorn-2.10.3.dist-info → crypticorn-2.11.0.dist-info}/entry_points.txt +0 -0
- {crypticorn-2.10.3.dist-info → crypticorn-2.11.0.dist-info}/licenses/LICENSE +0 -0
- {crypticorn-2.10.3.dist-info → crypticorn-2.11.0.dist-info}/top_level.txt +0 -0
crypticorn/common/ansi_colors.py
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
try:
|
2
|
+
from enum import StrEnum
|
3
|
+
except ImportError:
|
4
|
+
from strenum import StrEnum
|
3
5
|
|
4
6
|
class AnsiColors(StrEnum):
|
5
7
|
"""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."""
|
crypticorn/common/auth.py
CHANGED
@@ -18,7 +18,7 @@ from fastapi.security import (
|
|
18
18
|
APIKeyHeader,
|
19
19
|
)
|
20
20
|
from typing_extensions import Annotated
|
21
|
-
|
21
|
+
from typing import Union
|
22
22
|
# Auth Schemes
|
23
23
|
http_bearer = HTTPBearer(
|
24
24
|
bearerFormat="JWT",
|
@@ -132,7 +132,7 @@ class AuthHandler:
|
|
132
132
|
|
133
133
|
async def api_key_auth(
|
134
134
|
self,
|
135
|
-
api_key: Annotated[str
|
135
|
+
api_key: Annotated[Union[str, None], Depends(apikey_header)] = None,
|
136
136
|
sec: SecurityScopes = SecurityScopes(),
|
137
137
|
) -> Verify200Response:
|
138
138
|
"""
|
@@ -144,7 +144,7 @@ class AuthHandler:
|
|
144
144
|
async def bearer_auth(
|
145
145
|
self,
|
146
146
|
bearer: Annotated[
|
147
|
-
HTTPAuthorizationCredentials
|
147
|
+
Union[HTTPAuthorizationCredentials, None],
|
148
148
|
Depends(http_bearer),
|
149
149
|
] = None,
|
150
150
|
sec: SecurityScopes = SecurityScopes(),
|
@@ -158,9 +158,11 @@ class AuthHandler:
|
|
158
158
|
async def combined_auth(
|
159
159
|
self,
|
160
160
|
bearer: Annotated[
|
161
|
-
HTTPAuthorizationCredentials
|
161
|
+
Union[HTTPAuthorizationCredentials, None], Depends(http_bearer)
|
162
|
+
] = None,
|
163
|
+
api_key: Annotated[
|
164
|
+
Union[str, None], Depends(apikey_header)
|
162
165
|
] = None,
|
163
|
-
api_key: Annotated[str | None, Depends(apikey_header)] = None,
|
164
166
|
sec: SecurityScopes = SecurityScopes(),
|
165
167
|
) -> Verify200Response:
|
166
168
|
"""
|
@@ -202,7 +204,7 @@ class AuthHandler:
|
|
202
204
|
|
203
205
|
async def ws_api_key_auth(
|
204
206
|
self,
|
205
|
-
api_key: Annotated[str
|
207
|
+
api_key: Annotated[Union[str, None], Query()] = None,
|
206
208
|
sec: SecurityScopes = SecurityScopes(),
|
207
209
|
) -> Verify200Response:
|
208
210
|
"""
|
@@ -213,7 +215,7 @@ class AuthHandler:
|
|
213
215
|
|
214
216
|
async def ws_bearer_auth(
|
215
217
|
self,
|
216
|
-
bearer: Annotated[str
|
218
|
+
bearer: Annotated[Union[str, None], Query()] = None,
|
217
219
|
sec: SecurityScopes = SecurityScopes(),
|
218
220
|
) -> Verify200Response:
|
219
221
|
"""
|
@@ -224,8 +226,8 @@ class AuthHandler:
|
|
224
226
|
|
225
227
|
async def ws_combined_auth(
|
226
228
|
self,
|
227
|
-
bearer: Annotated[str
|
228
|
-
api_key: Annotated[str
|
229
|
+
bearer: Annotated[Union[str, None], Query()] = None,
|
230
|
+
api_key: Annotated[Union[str, None], Query()] = None,
|
229
231
|
sec: SecurityScopes = SecurityScopes(),
|
230
232
|
) -> Verify200Response:
|
231
233
|
"""
|
crypticorn/common/enums.py
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
"""Defines common enumerations used throughout the codebase for type safety and consistency."""
|
2
2
|
|
3
|
-
|
3
|
+
try:
|
4
|
+
from enum import StrEnum
|
5
|
+
except ImportError:
|
6
|
+
from strenum import StrEnum
|
7
|
+
|
4
8
|
from crypticorn.common.mixins import ValidateEnumMixin
|
5
9
|
|
6
10
|
|
crypticorn/common/errors.py
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
"""Comprehensive error handling system defining various API error types, HTTP exceptions, and error content structures."""
|
2
2
|
|
3
|
-
from enum import Enum
|
3
|
+
from enum import Enum
|
4
4
|
from fastapi import status
|
5
5
|
from crypticorn.common.mixins import ApiErrorFallback
|
6
|
+
try:
|
7
|
+
from enum import StrEnum
|
8
|
+
except ImportError:
|
9
|
+
from strenum import StrEnum
|
6
10
|
|
7
11
|
|
8
12
|
class ApiErrorType(StrEnum):
|
crypticorn/common/exceptions.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
from typing import Optional, Dict, Any
|
2
|
-
from enum import StrEnum
|
3
2
|
from pydantic import BaseModel, Field
|
4
3
|
from fastapi import HTTPException as FastAPIHTTPException, Request, FastAPI
|
5
4
|
from fastapi.exceptions import RequestValidationError, ResponseValidationError
|
@@ -7,6 +6,10 @@ from fastapi.responses import JSONResponse
|
|
7
6
|
from crypticorn.common import ApiError, ApiErrorIdentifier, ApiErrorType, ApiErrorLevel
|
8
7
|
import logging
|
9
8
|
import json
|
9
|
+
try:
|
10
|
+
from enum import StrEnum
|
11
|
+
except ImportError:
|
12
|
+
from strenum import StrEnum
|
10
13
|
|
11
14
|
_logger = logging.getLogger("crypticorn")
|
12
15
|
|
crypticorn/common/logging.py
CHANGED
@@ -2,12 +2,16 @@ from __future__ import annotations
|
|
2
2
|
|
3
3
|
import logging
|
4
4
|
import sys
|
5
|
-
from enum import StrEnum
|
6
5
|
from crypticorn.common.mixins import ValidateEnumMixin
|
7
6
|
from crypticorn.common.ansi_colors import AnsiColors as C
|
8
7
|
from datetime import datetime
|
9
8
|
import os
|
10
9
|
|
10
|
+
try:
|
11
|
+
from enum import StrEnum
|
12
|
+
except ImportError:
|
13
|
+
from strenum import StrEnum
|
14
|
+
|
11
15
|
|
12
16
|
class LogLevel(ValidateEnumMixin, StrEnum):
|
13
17
|
DEBUG = "DEBUG"
|
crypticorn/common/scopes.py
CHANGED
crypticorn/common/urls.py
CHANGED
crypticorn/common/utils.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"""General utility functions and helper methods used across the codebase."""
|
2
2
|
|
3
3
|
from datetime import datetime
|
4
|
-
from typing import Any
|
4
|
+
from typing import Any, Union
|
5
5
|
from decimal import Decimal
|
6
6
|
import string
|
7
7
|
import random
|
@@ -41,8 +41,8 @@ def gen_random_id(length: int = 20) -> str:
|
|
41
41
|
"The `is_equal` method is deprecated; use `math.is_close` instead.", category=None
|
42
42
|
)
|
43
43
|
def is_equal(
|
44
|
-
a: float
|
45
|
-
b: float
|
44
|
+
a: Union[float, Decimal],
|
45
|
+
b: Union[float, Decimal],
|
46
46
|
rel_tol: float = 1e-9,
|
47
47
|
abs_tol: float = 0.0,
|
48
48
|
) -> bool:
|
crypticorn/common/warnings.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"""Crypticorn-specific warnings."""
|
2
2
|
|
3
3
|
from __future__ import annotations
|
4
|
-
|
4
|
+
from typing import Union
|
5
5
|
|
6
6
|
class CrypticornDeprecationWarning(DeprecationWarning):
|
7
7
|
"""A Crypticorn specific deprecation warning.
|
@@ -24,7 +24,7 @@ class CrypticornDeprecationWarning(DeprecationWarning):
|
|
24
24
|
message: str,
|
25
25
|
*args: object,
|
26
26
|
since: tuple[int, int],
|
27
|
-
expected_removal: tuple[int, int]
|
27
|
+
expected_removal: Union[tuple[int, int], None] = None,
|
28
28
|
) -> None:
|
29
29
|
super().__init__(message, *args)
|
30
30
|
self.message = message.rstrip(".")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: crypticorn
|
3
|
-
Version: 2.
|
3
|
+
Version: 2.11.0
|
4
4
|
Summary: Maximise Your Crypto Trading Profits with Machine Learning
|
5
5
|
Author-email: Crypticorn <timon@crypticorn.com>
|
6
6
|
License: Copyright © 2025 Crypticorn
|
@@ -32,13 +32,14 @@ Classifier: Programming Language :: Python :: 3.11
|
|
32
32
|
Classifier: Programming Language :: Python :: 3.12
|
33
33
|
Classifier: Programming Language :: Python :: 3.13
|
34
34
|
Classifier: Typing :: Typed
|
35
|
-
Requires-Python: >=3.
|
35
|
+
Requires-Python: >=3.9
|
36
36
|
Description-Content-Type: text/markdown
|
37
37
|
License-File: LICENSE
|
38
38
|
Requires-Dist: fastapi<1.0.0,>=0.115.0
|
39
39
|
Requires-Dist: click<9.0.0,>=8.0.0
|
40
40
|
Requires-Dist: psutil<8.0.0,>=7.0.0
|
41
41
|
Requires-Dist: setuptools<81.0.0,>=80.0.0
|
42
|
+
Requires-Dist: strenum
|
42
43
|
Requires-Dist: urllib3<3.0.0,>=1.25.3
|
43
44
|
Requires-Dist: python_dateutil<3.0.0,>=2.8.2
|
44
45
|
Requires-Dist: aiohttp<4.0.0,>=3.8.4
|
@@ -76,7 +77,7 @@ crypto market - and programmatically interact with the entire Crypticorn ecosyst
|
|
76
77
|
|
77
78
|
## Installation
|
78
79
|
|
79
|
-
You need Python 3.
|
80
|
+
You need Python 3.9+ installed to be able to use this library.
|
80
81
|
|
81
82
|
You can install the latest stable version from [PyPi](https://pypi.org/project/crypticorn/):
|
82
83
|
```bash
|
@@ -66,21 +66,21 @@ crypticorn/cli/templates/dependabot.yml,sha256=ct5ieB8KAV1KLzoYKUNm6dZ9wKG_P_JQH
|
|
66
66
|
crypticorn/cli/templates/merge-env.sh,sha256=Q6d_RKcp2h6fOifYid8AsCvVGuUdleXkY3AxOVQ5psw,501
|
67
67
|
crypticorn/cli/templates/ruff.yml,sha256=gWicFFTzC4nToSmRkIIGipos8CZ447YG0kebBCJhtJE,319
|
68
68
|
crypticorn/common/__init__.py,sha256=DXEuUU_kaLBSBcvpiFie_ROuK5XEZuTMIfsg-BZE0iE,752
|
69
|
-
crypticorn/common/ansi_colors.py,sha256=
|
70
|
-
crypticorn/common/auth.py,sha256=
|
69
|
+
crypticorn/common/ansi_colors.py,sha256=IA-3_wujtpniJuaZJdAkc0gYX0tkN7RMk5XfLcKJsfI,1391
|
70
|
+
crypticorn/common/auth.py,sha256=u_p2kiS3G2PfE4UZPZ2TuWvLkLkS00C3WnaLcMOvJlM,8807
|
71
71
|
crypticorn/common/decorators.py,sha256=t5Y3vSJ-gt0n2vOYYjYN0dtzNXvZxrJs2SEItpzG8oo,1127
|
72
|
-
crypticorn/common/enums.py,sha256
|
73
|
-
crypticorn/common/errors.py,sha256=
|
74
|
-
crypticorn/common/exceptions.py,sha256=
|
75
|
-
crypticorn/common/logging.py,sha256=
|
72
|
+
crypticorn/common/enums.py,sha256=md7C_p2gAu6BbDboLm-DYYuJWjCHgRdk68iC1H5ZqPg,755
|
73
|
+
crypticorn/common/errors.py,sha256=f109l0Xz-R8QfvRLw4ce7j5enQaqc9fTPBW1tgoY58I,28022
|
74
|
+
crypticorn/common/exceptions.py,sha256=DdBWUYPtojuhzkbRMzvKxh5g0ieQfMWP9p6cEH4wSTM,6097
|
75
|
+
crypticorn/common/logging.py,sha256=3ZTFB9j8Mqy_AlNYABUFQ_134OH0YtophJkP4_GDJ9w,4408
|
76
76
|
crypticorn/common/middleware.py,sha256=O7XiXPimNYUhF9QTv6yFUTVlb91-SK-3CfTrWMNP6Ck,1011
|
77
77
|
crypticorn/common/mixins.py,sha256=l7XQrBISaee6fDZXy96k0HnQ18XYocjTUXlNpVxhaOY,2206
|
78
78
|
crypticorn/common/openapi.py,sha256=D8bCpCVVzYQptHrJ7SYOgCxI3R_d0cjW9KMOBq-x0xk,279
|
79
79
|
crypticorn/common/pagination.py,sha256=BYMNB4JUW9eeiTw1q3CyHXaT_-hk_BrSXAOqvif08Ek,2334
|
80
|
-
crypticorn/common/scopes.py,sha256=
|
81
|
-
crypticorn/common/urls.py,sha256=
|
82
|
-
crypticorn/common/utils.py,sha256=
|
83
|
-
crypticorn/common/warnings.py,sha256=
|
80
|
+
crypticorn/common/scopes.py,sha256=1hSrB0EHhO2aYC1A0Rvc0hdjdihyHM2nl-DGKQWHl3U,2517
|
81
|
+
crypticorn/common/urls.py,sha256=v23H2gevTNZ6HMRXDPiuc8znBbNdNqj0JTAdm5Hhms8,1223
|
82
|
+
crypticorn/common/utils.py,sha256=LcWudhcjZtULg87yYghh5muTYdHvk3UmkEAXmX7xgLk,3073
|
83
|
+
crypticorn/common/warnings.py,sha256=yEDsj8FNla9QMR_DOtD4lyEJInXdygY4sqVJEp5hgjU,2425
|
84
84
|
crypticorn/common/router/admin_router.py,sha256=x81s1gxhH7nLf7txqAIjVxrNgQmXsA1YG7g9v9KJwHA,3740
|
85
85
|
crypticorn/common/router/status_router.py,sha256=it6kfvx_Pn4Rv06fmViwhwr-m6f4WuSgcZwc6VTaMz4,868
|
86
86
|
crypticorn/hive/__init__.py,sha256=hRfTlEzEql4msytdUC_04vfaHzVKG5CGZle1M-9QFgY,81
|
@@ -259,9 +259,9 @@ crypticorn/trade/client/models/strategy_model_input.py,sha256=ala19jARyfA5ysys5D
|
|
259
259
|
crypticorn/trade/client/models/strategy_model_output.py,sha256=2o2lhbgUSTznowpMLEHF1Ex9TG9oRmzlCIb-gXqo7_s,5643
|
260
260
|
crypticorn/trade/client/models/tpsl.py,sha256=C2KgTIZs-a8W4msdaXgBKJcwtA-o5wR4rBauRP-iQxU,4317
|
261
261
|
crypticorn/trade/client/models/trading_action_type.py,sha256=pGq_TFLMPfYFizYP-xKgEC1ZF4U3lGdJYoGa_ZH2x-Q,769
|
262
|
-
crypticorn-2.
|
263
|
-
crypticorn-2.
|
264
|
-
crypticorn-2.
|
265
|
-
crypticorn-2.
|
266
|
-
crypticorn-2.
|
267
|
-
crypticorn-2.
|
262
|
+
crypticorn-2.11.0.dist-info/licenses/LICENSE,sha256=HonAVvzFXkP2C1d7D3ByIKPwjGH8NcHTAQvKH7uvOHQ,1856
|
263
|
+
crypticorn-2.11.0.dist-info/METADATA,sha256=Tpe2gUY6o3_ECAirH9pyvsF5XvXk9fpIu44guCdaqFA,10146
|
264
|
+
crypticorn-2.11.0.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
265
|
+
crypticorn-2.11.0.dist-info/entry_points.txt,sha256=d_xHsGvUTebPveVUK0SrpDFQ5ZRSjlI7lNCc11sn2PM,59
|
266
|
+
crypticorn-2.11.0.dist-info/top_level.txt,sha256=EP3NY216qIBYfmvGl0L2Zc9ItP0DjGSkiYqd9xJwGcM,11
|
267
|
+
crypticorn-2.11.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|