python3-commons 0.6.5__py3-none-any.whl → 0.6.7__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.
- python3_commons/serializers/msgspec.py +15 -1
- {python3_commons-0.6.5.dist-info → python3_commons-0.6.7.dist-info}/METADATA +3 -3
- {python3_commons-0.6.5.dist-info → python3_commons-0.6.7.dist-info}/RECORD +7 -7
- {python3_commons-0.6.5.dist-info → python3_commons-0.6.7.dist-info}/AUTHORS.rst +0 -0
- {python3_commons-0.6.5.dist-info → python3_commons-0.6.7.dist-info}/LICENSE +0 -0
- {python3_commons-0.6.5.dist-info → python3_commons-0.6.7.dist-info}/WHEEL +0 -0
- {python3_commons-0.6.5.dist-info → python3_commons-0.6.7.dist-info}/top_level.txt +0 -0
@@ -7,7 +7,7 @@ from datetime import datetime, date
|
|
7
7
|
from typing import Any
|
8
8
|
|
9
9
|
from msgspec import msgpack
|
10
|
-
from msgspec.msgpack import Ext
|
10
|
+
from msgspec.msgpack import encode, Ext
|
11
11
|
|
12
12
|
from python3_commons.serializers.json import CustomJSONEncoder
|
13
13
|
|
@@ -42,6 +42,20 @@ def ext_hook(code: int, data: memoryview) -> Any:
|
|
42
42
|
|
43
43
|
MSGPACK_ENCODER = msgpack.Encoder(enc_hook=enc_hook)
|
44
44
|
MSGPACK_DECODER = msgpack.Decoder(ext_hook=ext_hook)
|
45
|
+
MSGPACK_DECODER_NATIVE = msgpack.Decoder()
|
46
|
+
|
47
|
+
|
48
|
+
def serialize_msgpack_native(data) -> bytes:
|
49
|
+
return encode(data)
|
50
|
+
|
51
|
+
|
52
|
+
def deserialize_msgpack_native(data: bytes, data_type=None):
|
53
|
+
if data_type:
|
54
|
+
result = msgpack.decode(data, type=data_type)
|
55
|
+
else:
|
56
|
+
result = MSGPACK_DECODER_NATIVE.decode(data)
|
57
|
+
|
58
|
+
return result
|
45
59
|
|
46
60
|
|
47
61
|
def serialize_msgpack(data) -> bytes:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: python3-commons
|
3
|
-
Version: 0.6.
|
3
|
+
Version: 0.6.7
|
4
4
|
Summary: Re-usable Python3 code
|
5
5
|
Author-email: Oleg Korsak <kamikaze.is.waiting.you@gmail.com>
|
6
6
|
License: gpl-3
|
@@ -12,9 +12,9 @@ Requires-Python: >=3.13
|
|
12
12
|
Description-Content-Type: text/x-rst
|
13
13
|
License-File: LICENSE
|
14
14
|
License-File: AUTHORS.rst
|
15
|
-
Requires-Dist: aiohttp[speedups]==3.11.
|
15
|
+
Requires-Dist: aiohttp[speedups]==3.11.12
|
16
16
|
Requires-Dist: asyncpg==0.30.0
|
17
|
-
Requires-Dist: lxml==5.3.
|
17
|
+
Requires-Dist: lxml==5.3.1
|
18
18
|
Requires-Dist: minio==7.2.15
|
19
19
|
Requires-Dist: msgpack==1.1.0
|
20
20
|
Requires-Dist: msgspec==0.19.0
|
@@ -12,10 +12,10 @@ python3_commons/logging/formatters.py,sha256=UXmmh1yd5Kc2dpvSHn6uCWLDWE2LMjlYAaH
|
|
12
12
|
python3_commons/serializers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
13
13
|
python3_commons/serializers/json.py,sha256=P288wWz9ic38QWEMrpp_uwKPYkQiOgvE1cI4WZn6ZCg,808
|
14
14
|
python3_commons/serializers/msgpack.py,sha256=tzIGGyDL3UpZnnouCtnxuYDx6InKM_C3PP1N4PN8wd4,1269
|
15
|
-
python3_commons/serializers/msgspec.py,sha256=
|
16
|
-
python3_commons-0.6.
|
17
|
-
python3_commons-0.6.
|
18
|
-
python3_commons-0.6.
|
19
|
-
python3_commons-0.6.
|
20
|
-
python3_commons-0.6.
|
21
|
-
python3_commons-0.6.
|
15
|
+
python3_commons/serializers/msgspec.py,sha256=FuZVqOLJb0-lEKrs7dtjhwEbHIpfMUk5yu1hD64zRdc,2038
|
16
|
+
python3_commons-0.6.7.dist-info/AUTHORS.rst,sha256=3R9JnfjfjH5RoPWOeqKFJgxVShSSfzQPIrEr1nxIo9Q,90
|
17
|
+
python3_commons-0.6.7.dist-info/LICENSE,sha256=xxILuojHm4fKQOrMHPSslbyy6WuKAN2RiG74HbrYfzM,34575
|
18
|
+
python3_commons-0.6.7.dist-info/METADATA,sha256=6L7NNsUmrmT5EOpjKf_dh605zkUZ8ltIMRn-lq0j5ME,985
|
19
|
+
python3_commons-0.6.7.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
20
|
+
python3_commons-0.6.7.dist-info/top_level.txt,sha256=lJI6sCBf68eUHzupCnn2dzG10lH3jJKTWM_hrN1cQ7M,16
|
21
|
+
python3_commons-0.6.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|