documente_shared 0.1.60__tar.gz → 0.1.62__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 documente_shared might be problematic. Click here for more details.
- {documente_shared-0.1.60 → documente_shared-0.1.62}/PKG-INFO +1 -1
- documente_shared-0.1.62/documente_shared/application/time_utils.py +13 -0
- {documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/domain/entities/document.py +4 -0
- {documente_shared-0.1.60 → documente_shared-0.1.62}/pyproject.toml +1 -1
- documente_shared-0.1.60/documente_shared/application/time_utils.py +0 -10
- {documente_shared-0.1.60 → documente_shared-0.1.62}/README.md +0 -0
- {documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/__init__.py +0 -0
- {documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/application/__init__.py +0 -0
- {documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/application/digest.py +0 -0
- {documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/application/exceptions.py +0 -0
- {documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/application/timezone.py +0 -0
- {documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/domain/__init__.py +0 -0
- {documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/domain/base_enum.py +0 -0
- {documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/domain/constants.py +0 -0
- {documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/domain/entities/__init__.py +0 -0
- {documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/domain/entities/document_metadata.py +0 -0
- {documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/domain/enums.py +0 -0
- {documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/domain/repositories.py +0 -0
- {documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/infrastructure/__init__.py +0 -0
- {documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/infrastructure/dynamo_repositories.py +0 -0
- {documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/infrastructure/dynamo_table.py +0 -0
- {documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/infrastructure/s3_bucket.py +0 -0
- {documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/infrastructure/sqs_queue.py +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
from typing import Union, Optional
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def get_datetime_from_data(input_datetime: Union[datetime, str]) -> Optional[datetime]:
|
|
6
|
+
if isinstance(input_datetime, datetime):
|
|
7
|
+
return input_datetime
|
|
8
|
+
elif isinstance(input_datetime, str) and bool(input_datetime):
|
|
9
|
+
try:
|
|
10
|
+
return datetime.fromisoformat(input_datetime)
|
|
11
|
+
except ValueError:
|
|
12
|
+
return None
|
|
13
|
+
return None
|
{documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/domain/entities/document.py
RENAMED
|
@@ -45,6 +45,7 @@ class DocumentProcessing(object):
|
|
|
45
45
|
failed_reason: Optional[str] = None
|
|
46
46
|
feedback: Optional[list | dict] = None
|
|
47
47
|
completed_at: Optional[datetime] = None
|
|
48
|
+
metadata: Optional[dict] = None
|
|
48
49
|
metadata_items: Optional[List[DocumentProcessingMetadata]] = None
|
|
49
50
|
|
|
50
51
|
def __post_init__(self):
|
|
@@ -212,6 +213,7 @@ class DocumentProcessing(object):
|
|
|
212
213
|
'failed_at': self.failed_at.isoformat() if self.failed_at else None,
|
|
213
214
|
'failed_reason': self.failed_reason,
|
|
214
215
|
'feedback': self.feedback,
|
|
216
|
+
'metadata': self.metadata,
|
|
215
217
|
'completed_at': self.completed_at.isoformat() if self.completed_at else None,
|
|
216
218
|
'metadata_items': [metadata.to_dict for metadata in self.metadata_items],
|
|
217
219
|
}
|
|
@@ -252,6 +254,7 @@ class DocumentProcessing(object):
|
|
|
252
254
|
'failed_at',
|
|
253
255
|
'failed_reason',
|
|
254
256
|
'feedback',
|
|
257
|
+
'metadata',
|
|
255
258
|
'completed_at',
|
|
256
259
|
]
|
|
257
260
|
for _property in instance_properties:
|
|
@@ -298,6 +301,7 @@ class DocumentProcessing(object):
|
|
|
298
301
|
failed_at=get_datetime_from_data(input_datetime=data.get('failed_at')),
|
|
299
302
|
failed_reason=data.get('failed_reason'),
|
|
300
303
|
feedback=data.get('feedback'),
|
|
304
|
+
metadata=data.get('metadata', {}),
|
|
301
305
|
completed_at=get_datetime_from_data(input_datetime=data.get('completed_at')),
|
|
302
306
|
metadata_items=[
|
|
303
307
|
DocumentProcessingMetadata.from_dict(metadata)
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
from datetime import datetime
|
|
2
|
-
from typing import Union
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
def get_datetime_from_data(input_datetime: Union[datetime, str]):
|
|
6
|
-
if isinstance(input_datetime, datetime):
|
|
7
|
-
return input_datetime
|
|
8
|
-
elif isinstance(input_datetime, str):
|
|
9
|
-
return datetime.fromisoformat(input_datetime)
|
|
10
|
-
return None
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/application/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/application/exceptions.py
RENAMED
|
File without changes
|
{documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/application/timezone.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/domain/entities/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/infrastructure/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/infrastructure/dynamo_table.py
RENAMED
|
File without changes
|
{documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/infrastructure/s3_bucket.py
RENAMED
|
File without changes
|
{documente_shared-0.1.60 → documente_shared-0.1.62}/documente_shared/infrastructure/sqs_queue.py
RENAMED
|
File without changes
|