crypticorn 2.5.0rc4__py3-none-any.whl → 2.5.1__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/auth/main.py +2 -0
- crypticorn/client.py +60 -69
- crypticorn/common/__init__.py +2 -1
- crypticorn/common/auth.py +38 -20
- crypticorn/common/enums.py +5 -34
- crypticorn/common/errors.py +33 -14
- crypticorn/common/exceptions.py +42 -25
- crypticorn/common/mixins.py +36 -0
- crypticorn/common/urls.py +2 -1
- crypticorn/common/utils.py +4 -2
- crypticorn/hive/main.py +2 -0
- crypticorn/klines/client/__init__.py +14 -42
- crypticorn/klines/client/api/__init__.py +1 -1
- crypticorn/klines/client/api/change_in_timeframe_api.py +8 -22
- crypticorn/klines/client/api/funding_rates_api.py +8 -22
- crypticorn/klines/client/api/ohlcv_data_api.py +13 -33
- crypticorn/klines/client/api/status_api.py +260 -0
- crypticorn/klines/client/api/symbols_api.py +14 -29
- crypticorn/klines/client/api/udf_api.py +48 -59
- crypticorn/klines/client/api_client.py +1 -1
- crypticorn/klines/client/configuration.py +1 -1
- crypticorn/klines/client/exceptions.py +1 -1
- crypticorn/klines/client/models/__init__.py +13 -41
- crypticorn/klines/client/models/api_error_identifier.py +108 -0
- crypticorn/klines/client/models/api_error_level.py +37 -0
- crypticorn/klines/client/models/api_error_type.py +37 -0
- crypticorn/klines/client/models/change_in_timeframe.py +86 -0
- crypticorn/klines/client/models/exception_detail.py +117 -0
- crypticorn/klines/client/models/funding_rate.py +92 -0
- crypticorn/klines/client/models/internal_exchange.py +39 -0
- crypticorn/klines/client/models/market_type.py +1 -1
- crypticorn/klines/client/models/ohlcv_history.py +105 -0
- crypticorn/klines/client/models/resolution.py +1 -1
- crypticorn/klines/client/models/search_symbol.py +94 -0
- crypticorn/klines/client/models/sort_direction.py +1 -1
- crypticorn/klines/client/models/symbol_group.py +83 -0
- crypticorn/klines/client/models/symbol_info.py +131 -0
- crypticorn/klines/client/models/symbol_type.py +1 -1
- crypticorn/klines/client/models/timeframe.py +1 -1
- crypticorn/klines/client/models/udf_config.py +149 -0
- crypticorn/klines/client/rest.py +1 -1
- crypticorn/klines/main.py +40 -23
- crypticorn/metrics/client/__init__.py +7 -21
- crypticorn/metrics/client/api/__init__.py +1 -1
- crypticorn/metrics/client/api/exchanges_api.py +36 -78
- crypticorn/metrics/client/api/indicators_api.py +12 -37
- crypticorn/metrics/client/api/logs_api.py +8 -23
- crypticorn/metrics/client/api/marketcap_api.py +22 -73
- crypticorn/metrics/client/api/markets_api.py +12 -40
- crypticorn/metrics/client/api/status_api.py +260 -0
- crypticorn/metrics/client/api/tokens_api.py +7 -21
- crypticorn/metrics/client/api_client.py +1 -1
- crypticorn/metrics/client/configuration.py +5 -3
- crypticorn/metrics/client/exceptions.py +1 -1
- crypticorn/metrics/client/models/__init__.py +6 -20
- crypticorn/{trade → metrics}/client/models/api_error_identifier.py +6 -2
- crypticorn/{trade → metrics}/client/models/api_error_level.py +2 -2
- crypticorn/{trade → metrics}/client/models/api_error_type.py +2 -2
- crypticorn/metrics/client/models/exception_detail.py +117 -0
- crypticorn/metrics/client/models/internal_exchange.py +39 -0
- crypticorn/metrics/client/models/market_type.py +1 -1
- crypticorn/metrics/client/models/severity.py +1 -1
- crypticorn/metrics/client/models/time_interval.py +1 -1
- crypticorn/metrics/client/models/trading_status.py +1 -1
- crypticorn/metrics/client/rest.py +1 -1
- crypticorn/metrics/main.py +51 -43
- crypticorn/pay/main.py +2 -0
- crypticorn/trade/client/__init__.py +0 -3
- crypticorn/trade/client/configuration.py +2 -2
- crypticorn/trade/client/models/__init__.py +0 -3
- crypticorn/trade/client/models/bot_model.py +3 -7
- crypticorn/trade/client/models/execution_ids.py +1 -1
- crypticorn/trade/client/models/notification_model.py +3 -12
- crypticorn/trade/client/models/order_model.py +3 -7
- crypticorn/trade/client/models/spot_trading_action.py +231 -0
- crypticorn/trade/main.py +2 -0
- {crypticorn-2.5.0rc4.dist-info → crypticorn-2.5.1.dist-info}/METADATA +7 -5
- {crypticorn-2.5.0rc4.dist-info → crypticorn-2.5.1.dist-info}/RECORD +82 -65
- {crypticorn-2.5.0rc4.dist-info → crypticorn-2.5.1.dist-info}/WHEEL +1 -1
- crypticorn/common/sorter.py +0 -40
- /crypticorn/common/{pydantic.py → decorators.py} +0 -0
- {crypticorn-2.5.0rc4.dist-info → crypticorn-2.5.1.dist-info}/entry_points.txt +0 -0
- {crypticorn-2.5.0rc4.dist-info → crypticorn-2.5.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,94 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Klines Service API
|
5
|
+
|
6
|
+
API for retrieving OHLCV data, funding rates, and symbol information from Binance.
|
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, StrictStr
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
22
|
+
from crypticorn.klines.client.models.internal_exchange import InternalExchange
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
25
|
+
|
26
|
+
|
27
|
+
class SearchSymbol(BaseModel):
|
28
|
+
"""
|
29
|
+
SearchSymbol
|
30
|
+
""" # noqa: E501
|
31
|
+
|
32
|
+
symbol: StrictStr
|
33
|
+
description: StrictStr
|
34
|
+
exchange: InternalExchange
|
35
|
+
type: StrictStr
|
36
|
+
__properties: ClassVar[List[str]] = ["symbol", "description", "exchange", "type"]
|
37
|
+
|
38
|
+
model_config = ConfigDict(
|
39
|
+
populate_by_name=True,
|
40
|
+
validate_assignment=True,
|
41
|
+
protected_namespaces=(),
|
42
|
+
)
|
43
|
+
|
44
|
+
def to_str(self) -> str:
|
45
|
+
"""Returns the string representation of the model using alias"""
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
47
|
+
|
48
|
+
def to_json(self) -> str:
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
50
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
51
|
+
return json.dumps(self.to_dict())
|
52
|
+
|
53
|
+
@classmethod
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
55
|
+
"""Create an instance of SearchSymbol from a JSON string"""
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
57
|
+
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
60
|
+
|
61
|
+
This has the following differences from calling pydantic's
|
62
|
+
`self.model_dump(by_alias=True)`:
|
63
|
+
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
65
|
+
were set at model initialization. Other fields with value `None`
|
66
|
+
are ignored.
|
67
|
+
"""
|
68
|
+
excluded_fields: Set[str] = set([])
|
69
|
+
|
70
|
+
_dict = self.model_dump(
|
71
|
+
by_alias=True,
|
72
|
+
exclude=excluded_fields,
|
73
|
+
exclude_none=True,
|
74
|
+
)
|
75
|
+
return _dict
|
76
|
+
|
77
|
+
@classmethod
|
78
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
79
|
+
"""Create an instance of SearchSymbol from a dict"""
|
80
|
+
if obj is None:
|
81
|
+
return None
|
82
|
+
|
83
|
+
if not isinstance(obj, dict):
|
84
|
+
return cls.model_validate(obj)
|
85
|
+
|
86
|
+
_obj = cls.model_validate(
|
87
|
+
{
|
88
|
+
"symbol": obj.get("symbol"),
|
89
|
+
"description": obj.get("description"),
|
90
|
+
"exchange": obj.get("exchange"),
|
91
|
+
"type": obj.get("type"),
|
92
|
+
}
|
93
|
+
)
|
94
|
+
return _obj
|
@@ -3,7 +3,7 @@
|
|
3
3
|
"""
|
4
4
|
Klines Service API
|
5
5
|
|
6
|
-
|
6
|
+
API for retrieving OHLCV data, funding rates, and symbol information from Binance.
|
7
7
|
|
8
8
|
The version of the OpenAPI document: 1.0.0
|
9
9
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
@@ -0,0 +1,83 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Klines Service API
|
5
|
+
|
6
|
+
API for retrieving OHLCV data, funding rates, and symbol information from Binance.
|
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, StrictStr
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
+
from typing import Optional, Set
|
23
|
+
from typing_extensions import Self
|
24
|
+
|
25
|
+
|
26
|
+
class SymbolGroup(BaseModel):
|
27
|
+
"""
|
28
|
+
SymbolGroup
|
29
|
+
""" # noqa: E501
|
30
|
+
|
31
|
+
symbol: Optional[List[StrictStr]] = None
|
32
|
+
__properties: ClassVar[List[str]] = ["symbol"]
|
33
|
+
|
34
|
+
model_config = ConfigDict(
|
35
|
+
populate_by_name=True,
|
36
|
+
validate_assignment=True,
|
37
|
+
protected_namespaces=(),
|
38
|
+
)
|
39
|
+
|
40
|
+
def to_str(self) -> str:
|
41
|
+
"""Returns the string representation of the model using alias"""
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
43
|
+
|
44
|
+
def to_json(self) -> str:
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
47
|
+
return json.dumps(self.to_dict())
|
48
|
+
|
49
|
+
@classmethod
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
51
|
+
"""Create an instance of SymbolGroup from a JSON string"""
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
53
|
+
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
56
|
+
|
57
|
+
This has the following differences from calling pydantic's
|
58
|
+
`self.model_dump(by_alias=True)`:
|
59
|
+
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
61
|
+
were set at model initialization. Other fields with value `None`
|
62
|
+
are ignored.
|
63
|
+
"""
|
64
|
+
excluded_fields: Set[str] = set([])
|
65
|
+
|
66
|
+
_dict = self.model_dump(
|
67
|
+
by_alias=True,
|
68
|
+
exclude=excluded_fields,
|
69
|
+
exclude_none=True,
|
70
|
+
)
|
71
|
+
return _dict
|
72
|
+
|
73
|
+
@classmethod
|
74
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
75
|
+
"""Create an instance of SymbolGroup from a dict"""
|
76
|
+
if obj is None:
|
77
|
+
return None
|
78
|
+
|
79
|
+
if not isinstance(obj, dict):
|
80
|
+
return cls.model_validate(obj)
|
81
|
+
|
82
|
+
_obj = cls.model_validate({"symbol": obj.get("symbol")})
|
83
|
+
return _obj
|
@@ -0,0 +1,131 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Klines Service API
|
5
|
+
|
6
|
+
API for retrieving OHLCV data, funding rates, and symbol information from Binance.
|
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, StrictBool, StrictInt, StrictStr
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
22
|
+
from typing import Optional, Set
|
23
|
+
from typing_extensions import Self
|
24
|
+
|
25
|
+
|
26
|
+
class SymbolInfo(BaseModel):
|
27
|
+
"""
|
28
|
+
SymbolInfo
|
29
|
+
""" # noqa: E501
|
30
|
+
|
31
|
+
name: StrictStr
|
32
|
+
exchange_traded: StrictStr = Field(alias="exchange-traded")
|
33
|
+
exchange_listed: StrictStr = Field(alias="exchange-listed")
|
34
|
+
timezone: StrictStr
|
35
|
+
minmov: StrictInt
|
36
|
+
minmov2: StrictInt
|
37
|
+
pointvalue: StrictInt
|
38
|
+
session: StrictStr
|
39
|
+
has_intraday: StrictBool
|
40
|
+
has_no_volume: StrictBool
|
41
|
+
description: StrictStr
|
42
|
+
type: StrictStr
|
43
|
+
supported_resolutions: List[StrictStr]
|
44
|
+
pricescale: StrictInt
|
45
|
+
ticker: StrictStr
|
46
|
+
__properties: ClassVar[List[str]] = [
|
47
|
+
"name",
|
48
|
+
"exchange-traded",
|
49
|
+
"exchange-listed",
|
50
|
+
"timezone",
|
51
|
+
"minmov",
|
52
|
+
"minmov2",
|
53
|
+
"pointvalue",
|
54
|
+
"session",
|
55
|
+
"has_intraday",
|
56
|
+
"has_no_volume",
|
57
|
+
"description",
|
58
|
+
"type",
|
59
|
+
"supported_resolutions",
|
60
|
+
"pricescale",
|
61
|
+
"ticker",
|
62
|
+
]
|
63
|
+
|
64
|
+
model_config = ConfigDict(
|
65
|
+
populate_by_name=True,
|
66
|
+
validate_assignment=True,
|
67
|
+
protected_namespaces=(),
|
68
|
+
)
|
69
|
+
|
70
|
+
def to_str(self) -> str:
|
71
|
+
"""Returns the string representation of the model using alias"""
|
72
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
73
|
+
|
74
|
+
def to_json(self) -> str:
|
75
|
+
"""Returns the JSON representation of the model using alias"""
|
76
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
77
|
+
return json.dumps(self.to_dict())
|
78
|
+
|
79
|
+
@classmethod
|
80
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
81
|
+
"""Create an instance of SymbolInfo from a JSON string"""
|
82
|
+
return cls.from_dict(json.loads(json_str))
|
83
|
+
|
84
|
+
def to_dict(self) -> Dict[str, Any]:
|
85
|
+
"""Return the dictionary representation of the model using alias.
|
86
|
+
|
87
|
+
This has the following differences from calling pydantic's
|
88
|
+
`self.model_dump(by_alias=True)`:
|
89
|
+
|
90
|
+
* `None` is only added to the output dict for nullable fields that
|
91
|
+
were set at model initialization. Other fields with value `None`
|
92
|
+
are ignored.
|
93
|
+
"""
|
94
|
+
excluded_fields: Set[str] = set([])
|
95
|
+
|
96
|
+
_dict = self.model_dump(
|
97
|
+
by_alias=True,
|
98
|
+
exclude=excluded_fields,
|
99
|
+
exclude_none=True,
|
100
|
+
)
|
101
|
+
return _dict
|
102
|
+
|
103
|
+
@classmethod
|
104
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
105
|
+
"""Create an instance of SymbolInfo from a dict"""
|
106
|
+
if obj is None:
|
107
|
+
return None
|
108
|
+
|
109
|
+
if not isinstance(obj, dict):
|
110
|
+
return cls.model_validate(obj)
|
111
|
+
|
112
|
+
_obj = cls.model_validate(
|
113
|
+
{
|
114
|
+
"name": obj.get("name"),
|
115
|
+
"exchange-traded": obj.get("exchange-traded"),
|
116
|
+
"exchange-listed": obj.get("exchange-listed"),
|
117
|
+
"timezone": obj.get("timezone"),
|
118
|
+
"minmov": obj.get("minmov"),
|
119
|
+
"minmov2": obj.get("minmov2"),
|
120
|
+
"pointvalue": obj.get("pointvalue"),
|
121
|
+
"session": obj.get("session"),
|
122
|
+
"has_intraday": obj.get("has_intraday"),
|
123
|
+
"has_no_volume": obj.get("has_no_volume"),
|
124
|
+
"description": obj.get("description"),
|
125
|
+
"type": obj.get("type"),
|
126
|
+
"supported_resolutions": obj.get("supported_resolutions"),
|
127
|
+
"pricescale": obj.get("pricescale"),
|
128
|
+
"ticker": obj.get("ticker"),
|
129
|
+
}
|
130
|
+
)
|
131
|
+
return _obj
|
@@ -3,7 +3,7 @@
|
|
3
3
|
"""
|
4
4
|
Klines Service API
|
5
5
|
|
6
|
-
|
6
|
+
API for retrieving OHLCV data, funding rates, and symbol information from Binance.
|
7
7
|
|
8
8
|
The version of the OpenAPI document: 1.0.0
|
9
9
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
@@ -3,7 +3,7 @@
|
|
3
3
|
"""
|
4
4
|
Klines Service API
|
5
5
|
|
6
|
-
|
6
|
+
API for retrieving OHLCV data, funding rates, and symbol information from Binance.
|
7
7
|
|
8
8
|
The version of the OpenAPI document: 1.0.0
|
9
9
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
@@ -0,0 +1,149 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
Klines Service API
|
5
|
+
|
6
|
+
API for retrieving OHLCV data, funding rates, and symbol information from Binance.
|
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, StrictBool, StrictStr
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
+
from crypticorn.klines.client.models.internal_exchange import InternalExchange
|
23
|
+
from crypticorn.klines.client.models.symbol_type import SymbolType
|
24
|
+
from typing import Optional, Set
|
25
|
+
from typing_extensions import Self
|
26
|
+
|
27
|
+
|
28
|
+
class UDFConfig(BaseModel):
|
29
|
+
"""
|
30
|
+
UDFConfig
|
31
|
+
""" # noqa: E501
|
32
|
+
|
33
|
+
supported_resolutions: List[StrictStr]
|
34
|
+
supports_group_request: Optional[StrictBool] = False
|
35
|
+
supports_marks: Optional[StrictBool] = False
|
36
|
+
supports_search: Optional[StrictBool] = True
|
37
|
+
supports_timescale_marks: Optional[StrictBool] = False
|
38
|
+
supports_time: Optional[StrictBool] = True
|
39
|
+
exchanges: List[InternalExchange]
|
40
|
+
symbols_types: List[SymbolType]
|
41
|
+
currency_codes: List[StrictStr]
|
42
|
+
supported_markets: List[StrictStr]
|
43
|
+
__properties: ClassVar[List[str]] = [
|
44
|
+
"supported_resolutions",
|
45
|
+
"supports_group_request",
|
46
|
+
"supports_marks",
|
47
|
+
"supports_search",
|
48
|
+
"supports_timescale_marks",
|
49
|
+
"supports_time",
|
50
|
+
"exchanges",
|
51
|
+
"symbols_types",
|
52
|
+
"currency_codes",
|
53
|
+
"supported_markets",
|
54
|
+
]
|
55
|
+
|
56
|
+
model_config = ConfigDict(
|
57
|
+
populate_by_name=True,
|
58
|
+
validate_assignment=True,
|
59
|
+
protected_namespaces=(),
|
60
|
+
)
|
61
|
+
|
62
|
+
def to_str(self) -> str:
|
63
|
+
"""Returns the string representation of the model using alias"""
|
64
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
65
|
+
|
66
|
+
def to_json(self) -> str:
|
67
|
+
"""Returns the JSON representation of the model using alias"""
|
68
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
69
|
+
return json.dumps(self.to_dict())
|
70
|
+
|
71
|
+
@classmethod
|
72
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
73
|
+
"""Create an instance of UDFConfig from a JSON string"""
|
74
|
+
return cls.from_dict(json.loads(json_str))
|
75
|
+
|
76
|
+
def to_dict(self) -> Dict[str, Any]:
|
77
|
+
"""Return the dictionary representation of the model using alias.
|
78
|
+
|
79
|
+
This has the following differences from calling pydantic's
|
80
|
+
`self.model_dump(by_alias=True)`:
|
81
|
+
|
82
|
+
* `None` is only added to the output dict for nullable fields that
|
83
|
+
were set at model initialization. Other fields with value `None`
|
84
|
+
are ignored.
|
85
|
+
"""
|
86
|
+
excluded_fields: Set[str] = set([])
|
87
|
+
|
88
|
+
_dict = self.model_dump(
|
89
|
+
by_alias=True,
|
90
|
+
exclude=excluded_fields,
|
91
|
+
exclude_none=True,
|
92
|
+
)
|
93
|
+
# override the default output from pydantic by calling `to_dict()` of each item in symbols_types (list)
|
94
|
+
_items = []
|
95
|
+
if self.symbols_types:
|
96
|
+
for _item_symbols_types in self.symbols_types:
|
97
|
+
if _item_symbols_types:
|
98
|
+
_items.append(_item_symbols_types.to_dict())
|
99
|
+
_dict["symbols_types"] = _items
|
100
|
+
return _dict
|
101
|
+
|
102
|
+
@classmethod
|
103
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
104
|
+
"""Create an instance of UDFConfig from a dict"""
|
105
|
+
if obj is None:
|
106
|
+
return None
|
107
|
+
|
108
|
+
if not isinstance(obj, dict):
|
109
|
+
return cls.model_validate(obj)
|
110
|
+
|
111
|
+
_obj = cls.model_validate(
|
112
|
+
{
|
113
|
+
"supported_resolutions": obj.get("supported_resolutions"),
|
114
|
+
"supports_group_request": (
|
115
|
+
obj.get("supports_group_request")
|
116
|
+
if obj.get("supports_group_request") is not None
|
117
|
+
else False
|
118
|
+
),
|
119
|
+
"supports_marks": (
|
120
|
+
obj.get("supports_marks")
|
121
|
+
if obj.get("supports_marks") is not None
|
122
|
+
else False
|
123
|
+
),
|
124
|
+
"supports_search": (
|
125
|
+
obj.get("supports_search")
|
126
|
+
if obj.get("supports_search") is not None
|
127
|
+
else True
|
128
|
+
),
|
129
|
+
"supports_timescale_marks": (
|
130
|
+
obj.get("supports_timescale_marks")
|
131
|
+
if obj.get("supports_timescale_marks") is not None
|
132
|
+
else False
|
133
|
+
),
|
134
|
+
"supports_time": (
|
135
|
+
obj.get("supports_time")
|
136
|
+
if obj.get("supports_time") is not None
|
137
|
+
else True
|
138
|
+
),
|
139
|
+
"exchanges": obj.get("exchanges"),
|
140
|
+
"symbols_types": (
|
141
|
+
[SymbolType.from_dict(_item) for _item in obj["symbols_types"]]
|
142
|
+
if obj.get("symbols_types") is not None
|
143
|
+
else None
|
144
|
+
),
|
145
|
+
"currency_codes": obj.get("currency_codes"),
|
146
|
+
"supported_markets": obj.get("supported_markets"),
|
147
|
+
}
|
148
|
+
)
|
149
|
+
return _obj
|
crypticorn/klines/client/rest.py
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
"""
|
4
4
|
Klines Service API
|
5
5
|
|
6
|
-
|
6
|
+
API for retrieving OHLCV data, funding rates, and symbol information from Binance.
|
7
7
|
|
8
8
|
The version of the OpenAPI document: 1.0.0
|
9
9
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
crypticorn/klines/main.py
CHANGED
@@ -3,7 +3,7 @@ from crypticorn.klines import (
|
|
3
3
|
ApiClient,
|
4
4
|
Configuration,
|
5
5
|
FundingRatesApi,
|
6
|
-
|
6
|
+
StatusApi,
|
7
7
|
OHLCVDataApi,
|
8
8
|
SymbolsApi,
|
9
9
|
UDFApi,
|
@@ -16,10 +16,15 @@ class FundingRatesApiWrapper(FundingRatesApi):
|
|
16
16
|
A wrapper for the FundingRatesApi class.
|
17
17
|
"""
|
18
18
|
|
19
|
-
def get_funding_rates_fmt(self) -> pd.DataFrame:
|
19
|
+
async def get_funding_rates_fmt(self, *args, **kwargs) -> pd.DataFrame: # type: ignore
|
20
|
+
"""
|
21
|
+
Get the funding rates in a pandas DataFrame.
|
22
|
+
"""
|
20
23
|
pd = optional_import("pandas", "extra")
|
21
|
-
response = self.
|
22
|
-
|
24
|
+
response = await self.get_funding_rates_without_preload_content(*args, **kwargs)
|
25
|
+
response.raise_for_status()
|
26
|
+
json_data = await response.json()
|
27
|
+
return pd.DataFrame(json_data)
|
23
28
|
|
24
29
|
|
25
30
|
class OHLCVDataApiWrapper(OHLCVDataApi):
|
@@ -27,10 +32,24 @@ class OHLCVDataApiWrapper(OHLCVDataApi):
|
|
27
32
|
A wrapper for the OHLCVDataApi class.
|
28
33
|
"""
|
29
34
|
|
30
|
-
def get_ohlcv_data_fmt(self) -> pd.DataFrame:
|
35
|
+
async def get_ohlcv_data_fmt(self, *args, **kwargs) -> pd.DataFrame: # type: ignore
|
36
|
+
"""
|
37
|
+
Get the OHLCV data in a pandas DataFrame.
|
38
|
+
"""
|
31
39
|
pd = optional_import("pandas", "extra")
|
32
|
-
response = self.
|
33
|
-
|
40
|
+
response = await self.get_ohlcv_without_preload_content(*args, **kwargs)
|
41
|
+
response.raise_for_status()
|
42
|
+
json_data = await response.json()
|
43
|
+
return pd.DataFrame(
|
44
|
+
{
|
45
|
+
"timestamp": json_data["timestamp"],
|
46
|
+
"open": json_data["open"],
|
47
|
+
"high": json_data["high"],
|
48
|
+
"low": json_data["low"],
|
49
|
+
"close": json_data["close"],
|
50
|
+
"volume": json_data["volume"],
|
51
|
+
}
|
52
|
+
)
|
34
53
|
|
35
54
|
|
36
55
|
class SymbolsApiWrapper(SymbolsApi):
|
@@ -38,21 +57,17 @@ class SymbolsApiWrapper(SymbolsApi):
|
|
38
57
|
A wrapper for the SymbolsApi class.
|
39
58
|
"""
|
40
59
|
|
41
|
-
def get_symbols_fmt(self) -> pd.DataFrame:
|
60
|
+
async def get_symbols_fmt(self, *args, **kwargs) -> pd.DataFrame: # type: ignore
|
61
|
+
"""
|
62
|
+
Get the symbols in a pandas DataFrame.
|
63
|
+
"""
|
42
64
|
pd = optional_import("pandas", "extra")
|
43
|
-
response = self.
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
A wrapper for the UDFApi class.
|
50
|
-
"""
|
51
|
-
|
52
|
-
def get_udf_fmt(self) -> pd.DataFrame:
|
53
|
-
pd = optional_import("pandas", "extra")
|
54
|
-
response = self.get_history_udf_history_get()
|
55
|
-
return pd.DataFrame(response.json())
|
65
|
+
response = await self.get_klines_symbols_without_preload_content(
|
66
|
+
*args, **kwargs
|
67
|
+
)
|
68
|
+
response.raise_for_status()
|
69
|
+
json_data = await response.json()
|
70
|
+
return pd.DataFrame(json_data["data"], columns=["symbol"])
|
56
71
|
|
57
72
|
|
58
73
|
class KlinesClient:
|
@@ -60,6 +75,8 @@ class KlinesClient:
|
|
60
75
|
A client for interacting with the Crypticorn Klines API.
|
61
76
|
"""
|
62
77
|
|
78
|
+
config_class = Configuration
|
79
|
+
|
63
80
|
def __init__(
|
64
81
|
self,
|
65
82
|
config: Configuration,
|
@@ -70,5 +87,5 @@ class KlinesClient:
|
|
70
87
|
self.funding = FundingRatesApiWrapper(self.base_client)
|
71
88
|
self.ohlcv = OHLCVDataApiWrapper(self.base_client)
|
72
89
|
self.symbols = SymbolsApiWrapper(self.base_client)
|
73
|
-
self.udf =
|
74
|
-
self.
|
90
|
+
self.udf = UDFApi(self.base_client)
|
91
|
+
self.status = StatusApi(self.base_client)
|
@@ -5,7 +5,7 @@
|
|
5
5
|
"""
|
6
6
|
Marketcap Service API
|
7
7
|
|
8
|
-
|
8
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
9
9
|
|
10
10
|
The version of the OpenAPI document: 1.0.0
|
11
11
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
@@ -18,11 +18,11 @@ __version__ = "1.0.0"
|
|
18
18
|
|
19
19
|
# import apis into sdk package
|
20
20
|
from crypticorn.metrics.client.api.exchanges_api import ExchangesApi
|
21
|
-
from crypticorn.metrics.client.api.health_check_api import HealthCheckApi
|
22
21
|
from crypticorn.metrics.client.api.indicators_api import IndicatorsApi
|
23
22
|
from crypticorn.metrics.client.api.logs_api import LogsApi
|
24
23
|
from crypticorn.metrics.client.api.marketcap_api import MarketcapApi
|
25
24
|
from crypticorn.metrics.client.api.markets_api import MarketsApi
|
25
|
+
from crypticorn.metrics.client.api.status_api import StatusApi
|
26
26
|
from crypticorn.metrics.client.api.tokens_api import TokensApi
|
27
27
|
|
28
28
|
# import ApiClient
|
@@ -37,26 +37,12 @@ from crypticorn.metrics.client.exceptions import ApiAttributeError
|
|
37
37
|
from crypticorn.metrics.client.exceptions import ApiException
|
38
38
|
|
39
39
|
# import models into sdk package
|
40
|
-
from crypticorn.metrics.client.models.
|
41
|
-
from crypticorn.metrics.client.models.
|
42
|
-
|
43
|
-
|
44
|
-
from crypticorn.metrics.client.models.
|
45
|
-
BaseResponseListDict,
|
46
|
-
)
|
47
|
-
from crypticorn.metrics.client.models.base_response_list_exchange_mapping import (
|
48
|
-
BaseResponseListExchangeMapping,
|
49
|
-
)
|
50
|
-
from crypticorn.metrics.client.models.base_response_list_str import BaseResponseListStr
|
51
|
-
from crypticorn.metrics.client.models.error_response import ErrorResponse
|
52
|
-
from crypticorn.metrics.client.models.exchange_mapping import ExchangeMapping
|
53
|
-
from crypticorn.metrics.client.models.http_validation_error import HTTPValidationError
|
54
|
-
from crypticorn.metrics.client.models.health_check_response import HealthCheckResponse
|
40
|
+
from crypticorn.metrics.client.models.api_error_identifier import ApiErrorIdentifier
|
41
|
+
from crypticorn.metrics.client.models.api_error_level import ApiErrorLevel
|
42
|
+
from crypticorn.metrics.client.models.api_error_type import ApiErrorType
|
43
|
+
from crypticorn.metrics.client.models.exception_detail import ExceptionDetail
|
44
|
+
from crypticorn.metrics.client.models.internal_exchange import InternalExchange
|
55
45
|
from crypticorn.metrics.client.models.market_type import MarketType
|
56
46
|
from crypticorn.metrics.client.models.severity import Severity
|
57
47
|
from crypticorn.metrics.client.models.time_interval import TimeInterval
|
58
48
|
from crypticorn.metrics.client.models.trading_status import TradingStatus
|
59
|
-
from crypticorn.metrics.client.models.validation_error import ValidationError
|
60
|
-
from crypticorn.metrics.client.models.validation_error_loc_inner import (
|
61
|
-
ValidationErrorLocInner,
|
62
|
-
)
|
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
# import apis into api package
|
4
4
|
from crypticorn.metrics.client.api.exchanges_api import ExchangesApi
|
5
|
-
from crypticorn.metrics.client.api.health_check_api import HealthCheckApi
|
6
5
|
from crypticorn.metrics.client.api.indicators_api import IndicatorsApi
|
7
6
|
from crypticorn.metrics.client.api.logs_api import LogsApi
|
8
7
|
from crypticorn.metrics.client.api.marketcap_api import MarketcapApi
|
9
8
|
from crypticorn.metrics.client.api.markets_api import MarketsApi
|
9
|
+
from crypticorn.metrics.client.api.status_api import StatusApi
|
10
10
|
from crypticorn.metrics.client.api.tokens_api import TokensApi
|