trd-utils 0.0.11__tar.gz → 0.0.13__tar.gz
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.
Potentially problematic release.
This version of trd-utils might be problematic. Click here for more details.
- {trd_utils-0.0.11 → trd_utils-0.0.13}/PKG-INFO +1 -1
- {trd_utils-0.0.11 → trd_utils-0.0.13}/pyproject.toml +1 -1
- trd_utils-0.0.13/trd_utils/__init__.py +3 -0
- {trd_utils-0.0.11 → trd_utils-0.0.13}/trd_utils/types_helper/base_model.py +15 -5
- trd_utils-0.0.11/trd_utils/__init__.py +0 -3
- {trd_utils-0.0.11 → trd_utils-0.0.13}/LICENSE +0 -0
- {trd_utils-0.0.11 → trd_utils-0.0.13}/README.md +0 -0
- {trd_utils-0.0.11 → trd_utils-0.0.13}/trd_utils/cipher/__init__.py +0 -0
- {trd_utils-0.0.11 → trd_utils-0.0.13}/trd_utils/common_utils/float_utils.py +0 -0
- {trd_utils-0.0.11 → trd_utils-0.0.13}/trd_utils/exchanges/__init__.py +0 -0
- {trd_utils-0.0.11 → trd_utils-0.0.13}/trd_utils/exchanges/blofin/__init__.py +0 -0
- {trd_utils-0.0.11 → trd_utils-0.0.13}/trd_utils/exchanges/blofin/blofin_client.py +0 -0
- {trd_utils-0.0.11 → trd_utils-0.0.13}/trd_utils/exchanges/blofin/blofin_types.py +0 -0
- {trd_utils-0.0.11 → trd_utils-0.0.13}/trd_utils/exchanges/bx_ultra/__init__.py +0 -0
- {trd_utils-0.0.11 → trd_utils-0.0.13}/trd_utils/exchanges/bx_ultra/bx_types.py +0 -0
- {trd_utils-0.0.11 → trd_utils-0.0.13}/trd_utils/exchanges/bx_ultra/bx_ultra_client.py +0 -0
- {trd_utils-0.0.11 → trd_utils-0.0.13}/trd_utils/exchanges/bx_ultra/bx_utils.py +0 -0
- {trd_utils-0.0.11 → trd_utils-0.0.13}/trd_utils/exchanges/exchange_base.py +0 -0
- {trd_utils-0.0.11 → trd_utils-0.0.13}/trd_utils/html_utils/__init__.py +0 -0
- {trd_utils-0.0.11 → trd_utils-0.0.13}/trd_utils/html_utils/html_formats.py +0 -0
- {trd_utils-0.0.11 → trd_utils-0.0.13}/trd_utils/tradingview/__init__.py +0 -0
- {trd_utils-0.0.11 → trd_utils-0.0.13}/trd_utils/tradingview/tradingview_client.py +0 -0
- {trd_utils-0.0.11 → trd_utils-0.0.13}/trd_utils/tradingview/tradingview_types.py +0 -0
- {trd_utils-0.0.11 → trd_utils-0.0.13}/trd_utils/types_helper/__init__.py +0 -0
|
@@ -48,18 +48,25 @@ def is_any_type(target_type: type) -> bool:
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
# TODO: add support for max_depth for this...
|
|
51
|
-
def value_to_normal_obj(value, omit_none: bool = False
|
|
51
|
+
def value_to_normal_obj(value, omit_none: bool = False):
|
|
52
52
|
"""
|
|
53
53
|
Converts a custom value, to a corresponding "normal object" which can be used
|
|
54
54
|
in dict.
|
|
55
55
|
"""
|
|
56
56
|
if isinstance(value, BaseModel):
|
|
57
|
-
return value.to_dict(
|
|
57
|
+
return value.to_dict(
|
|
58
|
+
omit_none=omit_none,
|
|
59
|
+
)
|
|
58
60
|
|
|
59
61
|
if isinstance(value, list):
|
|
60
62
|
results = []
|
|
61
63
|
for current in value:
|
|
62
|
-
results.append(
|
|
64
|
+
results.append(
|
|
65
|
+
value_to_normal_obj(
|
|
66
|
+
value=current,
|
|
67
|
+
omit_none=omit_none,
|
|
68
|
+
)
|
|
69
|
+
)
|
|
63
70
|
return results
|
|
64
71
|
|
|
65
72
|
if isinstance(value, (int, str)) or value is None:
|
|
@@ -71,7 +78,10 @@ def value_to_normal_obj(value, omit_none: bool = False,):
|
|
|
71
78
|
if isinstance(value, dict):
|
|
72
79
|
result = {}
|
|
73
80
|
for inner_key, inner_value in value.items():
|
|
74
|
-
normalized_value = value_to_normal_obj(
|
|
81
|
+
normalized_value = value_to_normal_obj(
|
|
82
|
+
value=inner_value,
|
|
83
|
+
omit_none=omit_none,
|
|
84
|
+
)
|
|
75
85
|
if normalized_value is None and omit_none:
|
|
76
86
|
continue
|
|
77
87
|
|
|
@@ -261,7 +271,7 @@ class BaseModel:
|
|
|
261
271
|
|
|
262
272
|
def serialize(
|
|
263
273
|
self,
|
|
264
|
-
separators
|
|
274
|
+
separators=(",", ":"),
|
|
265
275
|
ensure_ascii: bool = True,
|
|
266
276
|
sort_keys: bool = True,
|
|
267
277
|
omit_none: bool = False,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|