documente_shared 0.1.43__py3-none-any.whl → 0.1.45__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.
Potentially problematic release.
This version of documente_shared might be problematic. Click here for more details.
- documente_shared/domain/entities/document_process.py +33 -4
- documente_shared/domain/enums.py +4 -0
- {documente_shared-0.1.43.dist-info → documente_shared-0.1.45.dist-info}/METADATA +3 -3
- {documente_shared-0.1.43.dist-info → documente_shared-0.1.45.dist-info}/RECORD +5 -5
- {documente_shared-0.1.43.dist-info → documente_shared-0.1.45.dist-info}/WHEEL +0 -0
|
@@ -28,8 +28,11 @@ class DocumentProcess(object):
|
|
|
28
28
|
processed_csv_bytes: Optional[bytes] = None
|
|
29
29
|
processed_xlsx_path: Optional[str] = None
|
|
30
30
|
processed_xlsx_bytes: Optional[bytes] = None
|
|
31
|
+
processed_json_path: Optional[str] = None
|
|
32
|
+
processed_json_bytes: Optional[bytes] = None
|
|
31
33
|
processed_metadata_path: Optional[str] = None
|
|
32
34
|
processing_time: Optional[Decimal] = None
|
|
35
|
+
issued_at: Optional[datetime] = None
|
|
33
36
|
uploaded_at: Optional[datetime] = None
|
|
34
37
|
enqueued_at: Optional[datetime] = None
|
|
35
38
|
started_at: Optional[datetime] = None
|
|
@@ -108,6 +111,10 @@ class DocumentProcess(object):
|
|
|
108
111
|
def processed_xlsx_key(self) -> str:
|
|
109
112
|
return remove_slash_from_path(self.processed_xlsx_path)
|
|
110
113
|
|
|
114
|
+
@property
|
|
115
|
+
def processed_json_key(self) -> str:
|
|
116
|
+
return remove_slash_from_path(self.processed_json_path)
|
|
117
|
+
|
|
111
118
|
@property
|
|
112
119
|
def processed_metadata_key(self) -> str:
|
|
113
120
|
return remove_slash_from_path(self.processed_metadata_path)
|
|
@@ -129,6 +136,7 @@ class DocumentProcess(object):
|
|
|
129
136
|
self.digest == other.digest
|
|
130
137
|
and self.status == other.status
|
|
131
138
|
and self.file_path == other.file_path
|
|
139
|
+
and self.issued_at == other.issued_at
|
|
132
140
|
and self.uploaded_at == other.uploaded_at
|
|
133
141
|
and self.enqueued_at == other.enqueued_at
|
|
134
142
|
and self.started_at == other.started_at
|
|
@@ -153,11 +161,13 @@ class DocumentProcess(object):
|
|
|
153
161
|
),
|
|
154
162
|
'processed_csv_path': self.processed_csv_path,
|
|
155
163
|
'processed_xlsx_path': self.processed_xlsx_path,
|
|
164
|
+
'processed_json_path': self.processed_json_path,
|
|
156
165
|
'processed_metadata_path': self.processed_metadata_path,
|
|
157
166
|
'processing_time': (
|
|
158
167
|
str(self.processing_time.quantize(Decimal('0.00001')))
|
|
159
168
|
if self.processing_time else None
|
|
160
169
|
),
|
|
170
|
+
'issued_at': self.issued_at.isoformat() if self.issued_at else None,
|
|
161
171
|
'uploaded_at': self.uploaded_at.isoformat() if self.uploaded_at else None,
|
|
162
172
|
'enqueued_at': self.enqueued_at.isoformat() if self.enqueued_at else None,
|
|
163
173
|
'started_at': self.started_at.isoformat() if self.started_at else None,
|
|
@@ -179,10 +189,27 @@ class DocumentProcess(object):
|
|
|
179
189
|
properties: List[str] = None,
|
|
180
190
|
):
|
|
181
191
|
instance_properties = properties or [
|
|
182
|
-
'status',
|
|
183
|
-
'
|
|
184
|
-
'
|
|
185
|
-
'
|
|
192
|
+
'status',
|
|
193
|
+
'metadata',
|
|
194
|
+
'file_path',
|
|
195
|
+
'file_bytes',
|
|
196
|
+
'category',
|
|
197
|
+
'sub_category',
|
|
198
|
+
'processed_csv_path',
|
|
199
|
+
'processed_csv_bytes',
|
|
200
|
+
'processed_xlsx_path',
|
|
201
|
+
'processed_xlsx_bytes',
|
|
202
|
+
'processed_json_path',
|
|
203
|
+
'processed_json_bytes',
|
|
204
|
+
'processed_metadata_path',
|
|
205
|
+
'processing_time',
|
|
206
|
+
'issued_at',
|
|
207
|
+
'uploaded_at',
|
|
208
|
+
'enqueued_at',
|
|
209
|
+
'started_at',
|
|
210
|
+
'failed_at',
|
|
211
|
+
'failed_reason',
|
|
212
|
+
'completed_at',
|
|
186
213
|
]
|
|
187
214
|
for _property in instance_properties:
|
|
188
215
|
property_value = getattr(new_instance, _property)
|
|
@@ -207,11 +234,13 @@ class DocumentProcess(object):
|
|
|
207
234
|
),
|
|
208
235
|
processed_csv_path=data.get('processed_csv_path'),
|
|
209
236
|
processed_xlsx_path=data.get('processed_xlsx_path'),
|
|
237
|
+
processed_json_path=data.get('processed_json_path'),
|
|
210
238
|
processed_metadata_path=data.get('processed_metadata_path'),
|
|
211
239
|
processing_time=(
|
|
212
240
|
Decimal(data.get('processing_time'))
|
|
213
241
|
if data.get('processing_time') else None
|
|
214
242
|
),
|
|
243
|
+
issued_at=get_datetime_from_data(input_datetime=data.get('issued_at')),
|
|
215
244
|
uploaded_at=get_datetime_from_data(input_datetime=data.get('uploaded_at')),
|
|
216
245
|
enqueued_at=get_datetime_from_data(input_datetime=data.get('enqueued_at')),
|
|
217
246
|
started_at=get_datetime_from_data(input_datetime=data.get('started_at')),
|
documente_shared/domain/enums.py
CHANGED
|
@@ -13,6 +13,7 @@ class DocumentProcessStatus(BaseEnum):
|
|
|
13
13
|
|
|
14
14
|
class DocumentProcessCategory(BaseEnum):
|
|
15
15
|
CIRCULAR = 'CIRCULAR'
|
|
16
|
+
DESGRAVAMEN = 'DESGRAVAMEN'
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
class DocumentProcessSubCategory(BaseEnum):
|
|
@@ -22,3 +23,6 @@ class DocumentProcessSubCategory(BaseEnum):
|
|
|
22
23
|
CC_INFORMATIVA = 'CC_INFORMATIVA'
|
|
23
24
|
CC_RETENCION_SUSPENSION_REMISION = 'CC_RETENCION_SUSPENSION_REMISION'
|
|
24
25
|
|
|
26
|
+
# Desgravamenes
|
|
27
|
+
DS_CREDISEGUROS = 'DS_CREDISEGUROS'
|
|
28
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: documente_shared
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.45
|
|
4
4
|
Summary: Shared utilities for Documente AI projects
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Tech
|
|
@@ -11,8 +11,8 @@ Classifier: Programming Language :: Python :: 3
|
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.10
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
-
Requires-Dist: boto3 (>=1.34.
|
|
15
|
-
Requires-Dist: botocore (>=1.34.
|
|
14
|
+
Requires-Dist: boto3 (>=1.34.80,<2.0.0)
|
|
15
|
+
Requires-Dist: botocore (>=1.34.80,<2.0.0)
|
|
16
16
|
Requires-Dist: sentry-sdk (>=2.19.2,<3.0.0)
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
18
|
|
|
@@ -6,15 +6,15 @@ documente_shared/application/time_utils.py,sha256=XDH27cKgoTFO8ad1JgrxKaeT7sZ1fd
|
|
|
6
6
|
documente_shared/domain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
documente_shared/domain/base_enum.py,sha256=DojAfn-zQdtjtImeHUpBzE6TBTm07XrbMOdW3h8RVd8,1449
|
|
8
8
|
documente_shared/domain/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
documente_shared/domain/entities/document_process.py,sha256=
|
|
9
|
+
documente_shared/domain/entities/document_process.py,sha256=6UMKMAr2GLfsJiW9MXC2KtwC4lhbFs9L4DKoZJOHznQ,9089
|
|
10
10
|
documente_shared/domain/entities/document_process_metadata.py,sha256=rBHkDkoKwrxReKtXIScU1vrCO_6bg2LwWhrtXMcQ8TA,2351
|
|
11
|
-
documente_shared/domain/enums.py,sha256=
|
|
11
|
+
documente_shared/domain/enums.py,sha256=C93aAAesVBC2GS4gI_LBaEu3K-0DxyuaKrh6v3ogf1E,684
|
|
12
12
|
documente_shared/domain/repositories.py,sha256=o9_ty3NPxCjb4hHIZbk71ECLqTjoKQI5MKWQje1KEyk,738
|
|
13
13
|
documente_shared/infrastructure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
documente_shared/infrastructure/dynamo_repositories.py,sha256=w_AW3IACVxRU7A3mNma2Elpbx7naRV4wY5mChW1WmZQ,1394
|
|
15
15
|
documente_shared/infrastructure/dynamo_table.py,sha256=dK05KgFvIYCmOdMpq9-OV_OBrP6cCngiUikCJrxlwt4,2112
|
|
16
16
|
documente_shared/infrastructure/s3_bucket.py,sha256=Nf4bHSC3TJeaKvOQSVtV1hG8dWqEZZnA-JWU0PNTw24,1940
|
|
17
17
|
documente_shared/infrastructure/sqs_queue.py,sha256=PSiTAnjXvQ-W-9mzLpH2UjbQJTvYkMiaxNaMecF-cR4,1505
|
|
18
|
-
documente_shared-0.1.
|
|
19
|
-
documente_shared-0.1.
|
|
20
|
-
documente_shared-0.1.
|
|
18
|
+
documente_shared-0.1.45.dist-info/METADATA,sha256=VrLgxUDNEmyRreoAlCbaRUfkQ6XM_tjshhI6SiS_CJ8,682
|
|
19
|
+
documente_shared-0.1.45.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
20
|
+
documente_shared-0.1.45.dist-info/RECORD,,
|
|
File without changes
|