documente_shared 0.1.131b0__py3-none-any.whl → 0.1.131b3__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.py +15 -1
- {documente_shared-0.1.131b0.dist-info → documente_shared-0.1.131b3.dist-info}/METADATA +1 -1
- {documente_shared-0.1.131b0.dist-info → documente_shared-0.1.131b3.dist-info}/RECORD +4 -4
- {documente_shared-0.1.131b0.dist-info → documente_shared-0.1.131b3.dist-info}/WHEEL +0 -0
|
@@ -50,6 +50,7 @@ class DocumentProcessing(object):
|
|
|
50
50
|
completed_at: Optional[datetime] = None
|
|
51
51
|
metadata: Optional[dict] = None
|
|
52
52
|
document_size: Optional[Decimal] = None
|
|
53
|
+
document_pages: Optional[int] = None
|
|
53
54
|
metadata_items: Optional[List[DocumentProcessingMetadata]] = None
|
|
54
55
|
|
|
55
56
|
def __post_init__(self):
|
|
@@ -109,7 +110,6 @@ class DocumentProcessing(object):
|
|
|
109
110
|
DocumentProcessingStatus.COMPLETED,
|
|
110
111
|
DocumentProcessingStatus.FAILED,
|
|
111
112
|
]
|
|
112
|
-
|
|
113
113
|
@property
|
|
114
114
|
def file_key(self) -> str:
|
|
115
115
|
return remove_slash_from_path(self.file_path)
|
|
@@ -221,6 +221,18 @@ class DocumentProcessing(object):
|
|
|
221
221
|
|
|
222
222
|
def in_review(self):
|
|
223
223
|
self.status = DocumentProcessingStatus.IN_REVIEW
|
|
224
|
+
|
|
225
|
+
def has_pages_mt(self, pages: int = 100) -> bool:
|
|
226
|
+
return self.document_pages and self.document_pages >= pages
|
|
227
|
+
|
|
228
|
+
def has_pages_lt(self, pages: int = 100) -> bool:
|
|
229
|
+
return self.document_pages and self.document_pages <= pages
|
|
230
|
+
|
|
231
|
+
def is_size_gt(self, size: Decimal = Decimal(10)):
|
|
232
|
+
return self.document_size and self.document_size >= size
|
|
233
|
+
|
|
234
|
+
def is_size_lt(self, size: Decimal = Decimal(10)):
|
|
235
|
+
return self.document_size and self.document_size <= size
|
|
224
236
|
|
|
225
237
|
def __eq__(self, other: 'DocumentProcessing') -> bool:
|
|
226
238
|
if not other:
|
|
@@ -281,6 +293,7 @@ class DocumentProcessing(object):
|
|
|
281
293
|
'completed_at': self.completed_at.isoformat() if self.completed_at else None,
|
|
282
294
|
'metadata_items': [metadata.to_dict for metadata in self.metadata_items],
|
|
283
295
|
'document_size': self.document_size,
|
|
296
|
+
'document_pages': self.document_pages,
|
|
284
297
|
}
|
|
285
298
|
|
|
286
299
|
@property
|
|
@@ -327,6 +340,7 @@ class DocumentProcessing(object):
|
|
|
327
340
|
'feedback',
|
|
328
341
|
'metadata',
|
|
329
342
|
'document_size',
|
|
343
|
+
'document_pages'
|
|
330
344
|
'completed_at',
|
|
331
345
|
]
|
|
332
346
|
for _property in instance_properties:
|
|
@@ -14,7 +14,7 @@ documente_shared/domain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
|
|
|
14
14
|
documente_shared/domain/base_enum.py,sha256=DojAfn-zQdtjtImeHUpBzE6TBTm07XrbMOdW3h8RVd8,1449
|
|
15
15
|
documente_shared/domain/constants.py,sha256=NG5BGaXBr_FnzudjTRPxpDpyiSDdaB_PLCdlYlFUQeU,187
|
|
16
16
|
documente_shared/domain/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
|
-
documente_shared/domain/entities/document.py,sha256=
|
|
17
|
+
documente_shared/domain/entities/document.py,sha256=GPwoeEAhw3BqXgXKdOE19wNwwe1n1gLKwqjjsajx-9g,14263
|
|
18
18
|
documente_shared/domain/entities/document_metadata.py,sha256=ygyFIC5qwxlm8DUM5kvVFny9zJfPQS8vNLM2br5XsQ8,2353
|
|
19
19
|
documente_shared/domain/entities/in_memory_document.py,sha256=6LlUtF9YbFPNxP-ytrWkFYQzvdJJJ9iC8X4_U125hEE,2113
|
|
20
20
|
documente_shared/domain/entities/processing_case.py,sha256=D57zP704mBtt563Pbmd41PFQSna4chVWsWTR_2ZAtTU,6602
|
|
@@ -55,6 +55,6 @@ documente_shared/infrastructure/services/http_scaling.py,sha256=cIo-61nfIwbtO86E
|
|
|
55
55
|
documente_shared/infrastructure/sqs_queue.py,sha256=KZWeHZ9zmXmrxoNpOQX7GEdDhZ1knbPXgwSwFwJblGg,1504
|
|
56
56
|
documente_shared/presentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
57
57
|
documente_shared/presentation/presenters.py,sha256=GGAEwefmjCIVepsUA2oZOVLxXbhhiISPM0Jgt6dT6O0,423
|
|
58
|
-
documente_shared-0.1.
|
|
59
|
-
documente_shared-0.1.
|
|
60
|
-
documente_shared-0.1.
|
|
58
|
+
documente_shared-0.1.131b3.dist-info/METADATA,sha256=pLB8W2brNCyetQp7kJEHgIO-8_-rLM44sakWMoms2TE,965
|
|
59
|
+
documente_shared-0.1.131b3.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
60
|
+
documente_shared-0.1.131b3.dist-info/RECORD,,
|
|
File without changes
|