documente_shared 0.1.131__py3-none-any.whl → 0.1.131b2__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.

File without changes
@@ -49,6 +49,7 @@ class DocumentProcessing(object):
49
49
  feedback: Optional[list | dict] = None
50
50
  completed_at: Optional[datetime] = None
51
51
  metadata: Optional[dict] = None
52
+ document_size: Optional[Decimal] = None
52
53
  metadata_items: Optional[List[DocumentProcessingMetadata]] = None
53
54
 
54
55
  def __post_init__(self):
@@ -108,7 +109,6 @@ class DocumentProcessing(object):
108
109
  DocumentProcessingStatus.COMPLETED,
109
110
  DocumentProcessingStatus.FAILED,
110
111
  ]
111
-
112
112
  @property
113
113
  def file_key(self) -> str:
114
114
  return remove_slash_from_path(self.file_path)
@@ -220,6 +220,12 @@ class DocumentProcessing(object):
220
220
 
221
221
  def in_review(self):
222
222
  self.status = DocumentProcessingStatus.IN_REVIEW
223
+
224
+ def is_size_gt(self, size: Decimal = Decimal(10)):
225
+ return self.document_size and self.document_size >= size
226
+
227
+ def is_size_lt(self, size: Decimal = Decimal(10)):
228
+ return self.document_size and self.document_size <= size
223
229
 
224
230
  def __eq__(self, other: 'DocumentProcessing') -> bool:
225
231
  if not other:
@@ -279,6 +285,7 @@ class DocumentProcessing(object):
279
285
  'metadata': self.metadata,
280
286
  'completed_at': self.completed_at.isoformat() if self.completed_at else None,
281
287
  'metadata_items': [metadata.to_dict for metadata in self.metadata_items],
288
+ 'document_size': self.document_size,
282
289
  }
283
290
 
284
291
  @property
@@ -324,6 +331,7 @@ class DocumentProcessing(object):
324
331
  'failed_reason',
325
332
  'feedback',
326
333
  'metadata',
334
+ 'document_size',
327
335
  'completed_at',
328
336
  ]
329
337
  for _property in instance_properties:
@@ -377,5 +385,6 @@ class DocumentProcessing(object):
377
385
  DocumentProcessingMetadata.from_dict(metadata)
378
386
  for metadata in data.get('metadata_items', [])
379
387
  ],
388
+ document_size=data.get('document_size'),
380
389
  )
381
390
 
@@ -4,14 +4,16 @@ from typing import Optional
4
4
 
5
5
  @dataclass
6
6
  class ScalingRequirements(object):
7
- documents: Optional[int] = 0
7
+ lg_documents: Optional[int] = 0
8
+ md_documents: Optional[int] = 0
8
9
  processing_cases: Optional[int] = 0
9
10
  processing_case_items: Optional[int] = 0
10
11
 
11
12
  @property
12
13
  def to_dict(self):
13
14
  return {
14
- "documents": self.documents,
15
+ "lg_documents": self.lg_documents,
16
+ "md_documents": self.md_documents,
15
17
  "processing_cases": self.processing_cases,
16
18
  "processing_case_items": self.processing_case_items,
17
19
  }
@@ -19,7 +21,8 @@ class ScalingRequirements(object):
19
21
  @classmethod
20
22
  def from_dict(cls, data: dict) -> "ScalingRequirements":
21
23
  return cls(
22
- documents=data.get("documents", 0),
24
+ lg_documents=data.get("lg_documents", 0),
25
+ md_documents=data.get("md_documents", 0),
23
26
  processing_cases=data.get("processing_cases", 0),
24
27
  processing_case_items=data.get("processing_case_items", 0),
25
28
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: documente_shared
3
- Version: 0.1.131
3
+ Version: 0.1.131b2
4
4
  Summary: Shared utilities for Documente AI projects
5
5
  License: MIT
6
6
  Author: Tech
@@ -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=eEEoAujD_wjFdcSvwB1WW6QbCNQSpijc0UfaMlytprk,13464
17
+ documente_shared/domain/entities/document.py,sha256=Os901LfH8FPuFxOHj_RtTmqysi3huUYyvdeM-4VKNeA,13888
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
@@ -23,7 +23,7 @@ documente_shared/domain/entities/processing_case_item.py,sha256=IN46jCGIv_DXEp1H
23
23
  documente_shared/domain/entities/processing_case_item_filters.py,sha256=R_AvDCB496Lww1qn2OwtltqULKE3IpcJB0ejnmRkg7Q,2009
24
24
  documente_shared/domain/entities/processing_documents.py,sha256=YYuTkdCNkqlO8cA0onJsZYtstxGt9M5NMuIO_87lB14,352
25
25
  documente_shared/domain/entities/processing_event.py,sha256=sejo9eM4A6fDDFq3qCX3V1GMGwQVUh_5oJaPDiUwpoc,2350
26
- documente_shared/domain/entities/scaling.py,sha256=Me1z3X-5NjzPMX-TBQ4xHwE_44tIJegi1QSCHQRNtx4,745
26
+ documente_shared/domain/entities/scaling.py,sha256=DPOE_W4NZ903cyNckmDPus_sYWEZfnvn5ar3Zf5JM3Q,897
27
27
  documente_shared/domain/enums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
28
  documente_shared/domain/enums/common.py,sha256=tgM098gKYHCp8LVNA6FKd-O_Meoi0Cx_UjQ3OKLxGYY,3127
29
29
  documente_shared/domain/enums/document.py,sha256=QwvckW-VJBSujllIVloKlZUh1pI5UnX4oueYbV5CYGw,3205
@@ -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.131.dist-info/METADATA,sha256=AXX_tT5o0nB_QV8wrFHu8SE5lk0mKvZMKyFF8M0_Xqw,963
59
- documente_shared-0.1.131.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
60
- documente_shared-0.1.131.dist-info/RECORD,,
58
+ documente_shared-0.1.131b2.dist-info/METADATA,sha256=d3cksEy0mID1ZIAE7VrOVINYuKPoMjNnHvSqfHjOvpU,965
59
+ documente_shared-0.1.131b2.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
60
+ documente_shared-0.1.131b2.dist-info/RECORD,,