documente_shared 0.1.131b2__py3-none-any.whl → 0.1.131b4__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 +13 -1
- {documente_shared-0.1.131b2.dist-info → documente_shared-0.1.131b4.dist-info}/METADATA +1 -1
- {documente_shared-0.1.131b2.dist-info → documente_shared-0.1.131b4.dist-info}/RECORD +4 -4
- {documente_shared-0.1.131b2.dist-info → documente_shared-0.1.131b4.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):
|
|
@@ -221,6 +222,12 @@ class DocumentProcessing(object):
|
|
|
221
222
|
def in_review(self):
|
|
222
223
|
self.status = DocumentProcessingStatus.IN_REVIEW
|
|
223
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
|
+
|
|
224
231
|
def is_size_gt(self, size: Decimal = Decimal(10)):
|
|
225
232
|
return self.document_size and self.document_size >= size
|
|
226
233
|
|
|
@@ -285,7 +292,11 @@ class DocumentProcessing(object):
|
|
|
285
292
|
'metadata': self.metadata,
|
|
286
293
|
'completed_at': self.completed_at.isoformat() if self.completed_at else None,
|
|
287
294
|
'metadata_items': [metadata.to_dict for metadata in self.metadata_items],
|
|
288
|
-
'document_size':
|
|
295
|
+
'document_size': (
|
|
296
|
+
normalize_number(self.document_size)
|
|
297
|
+
if self.document_size else None
|
|
298
|
+
),
|
|
299
|
+
'document_pages': self.document_pages,
|
|
289
300
|
}
|
|
290
301
|
|
|
291
302
|
@property
|
|
@@ -332,6 +343,7 @@ class DocumentProcessing(object):
|
|
|
332
343
|
'feedback',
|
|
333
344
|
'metadata',
|
|
334
345
|
'document_size',
|
|
346
|
+
'document_pages'
|
|
335
347
|
'completed_at',
|
|
336
348
|
]
|
|
337
349
|
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=6vwTql8eMZNRiBO4sYOwnXj19DQenVccoLd-dkvldyQ,14361
|
|
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.131b4.dist-info/METADATA,sha256=2mFXloyRc9eNRGjrt_1Z0GcjXFbgMXAmLRGLKmbUTwk,965
|
|
59
|
+
documente_shared-0.1.131b4.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
60
|
+
documente_shared-0.1.131b4.dist-info/RECORD,,
|
|
File without changes
|