ipiranga-inovai-project-lib 4.2__py3-none-any.whl → 4.3__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.
- inovai/utils/util.py +14 -3
- {ipiranga_inovai_project_lib-4.2.dist-info → ipiranga_inovai_project_lib-4.3.dist-info}/METADATA +1 -1
- {ipiranga_inovai_project_lib-4.2.dist-info → ipiranga_inovai_project_lib-4.3.dist-info}/RECORD +6 -6
- {ipiranga_inovai_project_lib-4.2.dist-info → ipiranga_inovai_project_lib-4.3.dist-info}/LICENSE +0 -0
- {ipiranga_inovai_project_lib-4.2.dist-info → ipiranga_inovai_project_lib-4.3.dist-info}/WHEEL +0 -0
- {ipiranga_inovai_project_lib-4.2.dist-info → ipiranga_inovai_project_lib-4.3.dist-info}/top_level.txt +0 -0
inovai/utils/util.py
CHANGED
|
@@ -3,11 +3,22 @@ from datetime import datetime
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
def format_date(date_str, date_str_format: str = '%d/%m/%Y', new_format: str = None) -> str:
|
|
6
|
+
|
|
6
7
|
try:
|
|
7
|
-
|
|
8
|
+
if "T" in date_str and "Z" in date_str:
|
|
9
|
+
date_obj = datetime.strptime(date_str, "%Y-%m-%dT%H:%M:%SZ")
|
|
10
|
+
elif " " in date_str and ":" in date_str:
|
|
11
|
+
date_obj = datetime.strptime(date_str, "%Y-%m-%d %H:%M:%S")
|
|
12
|
+
else:
|
|
13
|
+
date_obj = datetime.strptime(date_str, date_str_format)
|
|
14
|
+
|
|
8
15
|
if new_format:
|
|
9
16
|
return date_obj.strftime(new_format)
|
|
17
|
+
|
|
10
18
|
return date_obj.strftime(date_str_format)
|
|
19
|
+
except ValueError as ve:
|
|
20
|
+
logging.error(f"Formato de data inválido. Data '{date_str}', formato esperado: '{date_str_format}'. Erro: {ve}")
|
|
21
|
+
raise
|
|
11
22
|
except Exception as e:
|
|
12
|
-
logging.error(f"
|
|
13
|
-
|
|
23
|
+
logging.error(f"Erro inesperado ao formatar a data '{date_str}': {e}")
|
|
24
|
+
raise
|
{ipiranga_inovai_project_lib-4.2.dist-info → ipiranga_inovai_project_lib-4.3.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ipiranga-inovai-project-lib
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.3
|
|
4
4
|
Summary: Projeto criado para importação genérica de entidades
|
|
5
5
|
Home-page: https://gitlab.ipirangacloud.com/clayton.monteiro.ext/ipiranga-inovai-project-lib
|
|
6
6
|
Author: Clayton Sandes Monteiro
|
{ipiranga_inovai_project_lib-4.2.dist-info → ipiranga_inovai_project_lib-4.3.dist-info}/RECORD
RENAMED
|
@@ -33,9 +33,9 @@ inovai/models/NFeVeiculo.py,sha256=iwnD0uZjHU2l4J_QP7JW9EQpJZWDYCEIhRxpWrvxtns,1
|
|
|
33
33
|
inovai/models/NFeVolume.py,sha256=_cayb-rrz1mSxQ3wFFnB4KCi524jtAsdTTcS4WQTBOc,1970
|
|
34
34
|
inovai/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
35
|
inovai/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
36
|
-
inovai/utils/util.py,sha256=
|
|
37
|
-
ipiranga_inovai_project_lib-4.
|
|
38
|
-
ipiranga_inovai_project_lib-4.
|
|
39
|
-
ipiranga_inovai_project_lib-4.
|
|
40
|
-
ipiranga_inovai_project_lib-4.
|
|
41
|
-
ipiranga_inovai_project_lib-4.
|
|
36
|
+
inovai/utils/util.py,sha256=CsxaZmeKWG8A4w_1XzVm_F9hdWkDVgmHDYL2XF8v5dQ,906
|
|
37
|
+
ipiranga_inovai_project_lib-4.3.dist-info/LICENSE,sha256=UJ3ql8eZec9Y1kER7QSHAuvdgFPuL47asePHYmdzG_o,198
|
|
38
|
+
ipiranga_inovai_project_lib-4.3.dist-info/METADATA,sha256=xdVDnBWH-8dY_YBdnmpWjtJ_oKI4oOZSjK2DbOjUb6Q,518
|
|
39
|
+
ipiranga_inovai_project_lib-4.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
40
|
+
ipiranga_inovai_project_lib-4.3.dist-info/top_level.txt,sha256=BD-APH5oIEb_KDXwrfnZiu9QDsD9ttTEkYc32r9thqg,7
|
|
41
|
+
ipiranga_inovai_project_lib-4.3.dist-info/RECORD,,
|
{ipiranga_inovai_project_lib-4.2.dist-info → ipiranga_inovai_project_lib-4.3.dist-info}/LICENSE
RENAMED
|
File without changes
|
{ipiranga_inovai_project_lib-4.2.dist-info → ipiranga_inovai_project_lib-4.3.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|