python3-commons 0.0.18__tar.gz → 0.0.20__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 python3-commons might be problematic. Click here for more details.
- {python3-commons-0.0.18/src/python3_commons.egg-info → python3-commons-0.0.20}/PKG-INFO +1 -1
- {python3-commons-0.0.18 → python3-commons-0.0.20}/src/python3_commons/serializers.py +9 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20/src/python3_commons.egg-info}/PKG-INFO +1 -1
- {python3-commons-0.0.18 → python3-commons-0.0.20}/.coveragerc +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/.github/workflows/python-publish.yaml +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/.gitignore +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/AUTHORS.rst +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/CHANGELOG.rst +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/LICENSE +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/README.md +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/README.rst +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/docs/Makefile +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/docs/_static/.gitignore +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/docs/authors.rst +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/docs/changelog.rst +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/docs/conf.py +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/docs/index.rst +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/docs/license.rst +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/pyproject.toml +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/requirements.txt +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/requirements_dev.txt +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/setup.cfg +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/setup.py +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/src/python3_commons/__init__.py +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/src/python3_commons/conf.py +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/src/python3_commons/db.py +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/src/python3_commons/fs.py +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/src/python3_commons/helpers.py +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/src/python3_commons/json.py +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/src/python3_commons/logging/__init__.py +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/src/python3_commons/logging/filters.py +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/src/python3_commons/logging/formatter.py +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/src/python3_commons/minio.py +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/src/python3_commons/object_storage.py +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/src/python3_commons.egg-info/SOURCES.txt +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/src/python3_commons.egg-info/dependency_links.txt +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/src/python3_commons.egg-info/not-zip-safe +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/src/python3_commons.egg-info/requires.txt +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/src/python3_commons.egg-info/top_level.txt +0 -0
- {python3-commons-0.0.18 → python3-commons-0.0.20}/tests/conftest.py +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import logging
|
|
2
|
+
from datetime import datetime, date
|
|
2
3
|
from decimal import Decimal
|
|
3
4
|
|
|
4
5
|
import msgpack
|
|
@@ -13,6 +14,10 @@ def msgpack_encoder(obj):
|
|
|
13
14
|
|
|
14
15
|
if isinstance(obj, Decimal):
|
|
15
16
|
return ExtType(1, str(obj).encode())
|
|
17
|
+
elif isinstance(obj, datetime):
|
|
18
|
+
return ExtType(2, obj.isoformat().encode())
|
|
19
|
+
elif isinstance(obj, date):
|
|
20
|
+
return ExtType(3, obj.isoformat().encode())
|
|
16
21
|
|
|
17
22
|
return f'no encoder for {obj}'
|
|
18
23
|
|
|
@@ -22,6 +27,10 @@ def msgpack_decoder(code, data):
|
|
|
22
27
|
|
|
23
28
|
if code == 1:
|
|
24
29
|
return Decimal(data.decode())
|
|
30
|
+
elif code == 2:
|
|
31
|
+
return datetime.fromisoformat(data.decode())
|
|
32
|
+
elif code == 3:
|
|
33
|
+
return date.fromisoformat(data.decode())
|
|
25
34
|
|
|
26
35
|
return f'no decoder for type {code}'
|
|
27
36
|
|
|
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
|
|
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
|
{python3-commons-0.0.18 → python3-commons-0.0.20}/src/python3_commons.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python3-commons-0.0.18 → python3-commons-0.0.20}/src/python3_commons.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|