documente_shared 0.1.25__tar.gz → 0.1.27__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.25 → documente_shared-0.1.27}/PKG-INFO +1 -1
- {documente_shared-0.1.25 → documente_shared-0.1.27}/documente_shared/domain/entities.py +7 -1
- {documente_shared-0.1.25 → documente_shared-0.1.27}/documente_shared/domain/enums.py +1 -0
- {documente_shared-0.1.25 → documente_shared-0.1.27}/pyproject.toml +1 -1
- {documente_shared-0.1.25 → documente_shared-0.1.27}/README.md +0 -0
- {documente_shared-0.1.25 → documente_shared-0.1.27}/documente_shared/__init__.py +0 -0
- {documente_shared-0.1.25 → documente_shared-0.1.27}/documente_shared/application/__init__.py +0 -0
- {documente_shared-0.1.25 → documente_shared-0.1.27}/documente_shared/application/digest.py +0 -0
- {documente_shared-0.1.25 → documente_shared-0.1.27}/documente_shared/application/time_utils.py +0 -0
- {documente_shared-0.1.25 → documente_shared-0.1.27}/documente_shared/domain/__init__.py +0 -0
- {documente_shared-0.1.25 → documente_shared-0.1.27}/documente_shared/domain/base_enum.py +0 -0
- {documente_shared-0.1.25 → documente_shared-0.1.27}/documente_shared/domain/repositories.py +0 -0
- {documente_shared-0.1.25 → documente_shared-0.1.27}/documente_shared/infrastructure/__init__.py +0 -0
- {documente_shared-0.1.25 → documente_shared-0.1.27}/documente_shared/infrastructure/dynamo_repositories.py +0 -0
- {documente_shared-0.1.25 → documente_shared-0.1.27}/documente_shared/infrastructure/dynamo_table.py +0 -0
- {documente_shared-0.1.25 → documente_shared-0.1.27}/documente_shared/infrastructure/s3_bucket.py +0 -0
- {documente_shared-0.1.25 → documente_shared-0.1.27}/documente_shared/infrastructure/sqs_queue.py +0 -0
|
@@ -19,6 +19,7 @@ def remove_slash_from_path(path: str) -> str:
|
|
|
19
19
|
class DocumentProcess(object):
|
|
20
20
|
digest: str
|
|
21
21
|
status: DocumentProcessStatus
|
|
22
|
+
metadata: Optional[dict] = None
|
|
22
23
|
file_path: Optional[str] = None
|
|
23
24
|
file_bytes: Optional[bytes] = None
|
|
24
25
|
category: Optional[DocumentProcessCategory] = None
|
|
@@ -34,6 +35,9 @@ class DocumentProcess(object):
|
|
|
34
35
|
failed_at: Optional[datetime] = None
|
|
35
36
|
completed_at: Optional[datetime] = None
|
|
36
37
|
|
|
38
|
+
def __post_init__(self):
|
|
39
|
+
self.metadata = self.metadata or {}
|
|
40
|
+
|
|
37
41
|
@property
|
|
38
42
|
def is_pending(self) -> bool:
|
|
39
43
|
return self.status == DocumentProcessStatus.PENDING
|
|
@@ -107,6 +111,7 @@ class DocumentProcess(object):
|
|
|
107
111
|
return {
|
|
108
112
|
'digest': self.digest,
|
|
109
113
|
'status': str(self.status),
|
|
114
|
+
'metadata': self.metadata,
|
|
110
115
|
'file_path': self.file_path,
|
|
111
116
|
'category': (
|
|
112
117
|
str(self.category)
|
|
@@ -135,7 +140,7 @@ class DocumentProcess(object):
|
|
|
135
140
|
properties: List[str] = None,
|
|
136
141
|
):
|
|
137
142
|
instance_properties = properties or [
|
|
138
|
-
'status', 'file_path', 'file_bytes', 'category', 'sub_category',
|
|
143
|
+
'status', 'metadata', 'file_path', 'file_bytes', 'category', 'sub_category',
|
|
139
144
|
'processed_csv_path', 'processed_csv_bytes', 'processed_xlsx_path',
|
|
140
145
|
'processed_xlsx_bytes', 'processing_time', 'uploaded_at',
|
|
141
146
|
'enqueued_at', 'started_at', 'failed_at', 'completed_at',
|
|
@@ -152,6 +157,7 @@ class DocumentProcess(object):
|
|
|
152
157
|
return cls(
|
|
153
158
|
digest=data.get('digest'),
|
|
154
159
|
status=DocumentProcessStatus.from_value(data.get('status')),
|
|
160
|
+
metadata=data.get('metadata', {}),
|
|
155
161
|
file_path=data.get('file_path'),
|
|
156
162
|
category=(
|
|
157
163
|
DocumentProcessCategory.from_value(data.get('category'))
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.25 → documente_shared-0.1.27}/documente_shared/application/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.25 → documente_shared-0.1.27}/documente_shared/application/time_utils.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.25 → documente_shared-0.1.27}/documente_shared/infrastructure/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{documente_shared-0.1.25 → documente_shared-0.1.27}/documente_shared/infrastructure/dynamo_table.py
RENAMED
|
File without changes
|
{documente_shared-0.1.25 → documente_shared-0.1.27}/documente_shared/infrastructure/s3_bucket.py
RENAMED
|
File without changes
|
{documente_shared-0.1.25 → documente_shared-0.1.27}/documente_shared/infrastructure/sqs_queue.py
RENAMED
|
File without changes
|