documente_shared 0.1.88__py3-none-any.whl → 0.1.91__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.

@@ -57,6 +57,16 @@ class ProcessingCase(object):
57
57
 
58
58
  def deleted(self):
59
59
  self.status = ProcessingStatus.DELETED
60
+
61
+
62
+ def procesable_items(self) -> List[ProcessingCaseItem]:
63
+ return [
64
+ item for item in self.items
65
+ if item.status in [
66
+ ProcessingStatus.PENDING,
67
+ ProcessingStatus.ENQUEUED,
68
+ ]
69
+ ]
60
70
 
61
71
  def __eq__(self, other: 'ProcessingCase') -> bool:
62
72
  if not other:
@@ -6,5 +6,5 @@ from documente_shared.domain.entities.scaling import ScalingRequirements
6
6
  class ScalingService(ABC):
7
7
 
8
8
  @abstractmethod
9
- def get_scaling_requirements(self) -> ScalingRequirements:
9
+ def get_requirements(self) -> ScalingRequirements:
10
10
  raise NotImplementedError
@@ -51,6 +51,7 @@ class HttpProcessingCaseItemRepository(
51
51
  for item_data in raw_response.get('data', [])
52
52
  ]
53
53
  return []
54
+
54
55
  def filter_with_tenant(
55
56
  self,
56
57
  tenant_slug: str,
@@ -13,11 +13,12 @@ class HttpScalingService(
13
13
  DocumenteClientMixin,
14
14
  ScalingService,
15
15
  ):
16
- def get_scaling_requirements(self) -> ScalingRequirements:
16
+ def get_requirements(self) -> ScalingRequirements:
17
17
  response = self.session.get(f"{self.api_url}/v1/scaling-requirements/")
18
18
  if response.status_code == 200:
19
+ response_json = response.json()
19
20
  return ScalingRequirements.from_dict(
20
- data=camel_to_snake(response.json())
21
+ data=camel_to_snake(response_json.get('data', {}))
21
22
  )
22
23
 
23
24
  logger.warning(f'Error getting scaling requirements: {response.text}')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: documente_shared
3
- Version: 0.1.88
3
+ Version: 0.1.91
4
4
  Summary: Shared utilities for Documente AI projects
5
5
  License: MIT
6
6
  Author: Tech
@@ -15,7 +15,7 @@ documente_shared/domain/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRk
15
15
  documente_shared/domain/entities/document.py,sha256=AthTUyA-QZE3WAT7lMoKVr_Z8mO_3qERuCnZge0DTLQ,12595
16
16
  documente_shared/domain/entities/document_metadata.py,sha256=ygyFIC5qwxlm8DUM5kvVFny9zJfPQS8vNLM2br5XsQ8,2353
17
17
  documente_shared/domain/entities/in_memory_result.py,sha256=0sLNUrovKFQx4M-E9e4DrAiVgch2i4AKA-9BQBRaeI8,1482
18
- documente_shared/domain/entities/processing_case.py,sha256=_UTMCSQjTSttNWa-NC7eWJITkNm6NZuGGT9gNm9D1mA,4970
18
+ documente_shared/domain/entities/processing_case.py,sha256=GHMKKelwGofsjrd40CG8Vkyp8RCc0Fsx57QXBYHZYh4,5230
19
19
  documente_shared/domain/entities/processing_case_filters.py,sha256=harKyu7QEuL1bI_Z8_UxkVCMo5r9vHeNHyi_Ja07vjs,1953
20
20
  documente_shared/domain/entities/processing_case_item.py,sha256=U_g99AJdlRRJpJ0NPfmXzlr2x04l5hc53oNLxx_Q7XQ,9734
21
21
  documente_shared/domain/entities/processing_case_item_filters.py,sha256=R_AvDCB496Lww1qn2OwtltqULKE3IpcJB0ejnmRkg7Q,2009
@@ -26,7 +26,7 @@ documente_shared/domain/enums/common.py,sha256=wJWYhh98sdCGL_1WodhYLpoT_IYTzkTDO
26
26
  documente_shared/domain/enums/document.py,sha256=QwvckW-VJBSujllIVloKlZUh1pI5UnX4oueYbV5CYGw,3205
27
27
  documente_shared/domain/enums/processing_case.py,sha256=LhFhcoWlockxcpplsVdC6M2kpXn7sOdzQySf24wFhx8,1572
28
28
  documente_shared/domain/interfaces/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
- documente_shared/domain/interfaces/scaling.py,sha256=0Mefc_GVNdyRtAdkxlnvQuXrmM4Yx7VOJQCfVZOgISQ,257
29
+ documente_shared/domain/interfaces/scaling.py,sha256=yWAud0rcLKMMf2-QxEE__GRpzqUY0H9_qxlQTfnRYmw,249
30
30
  documente_shared/domain/repositories/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
31
  documente_shared/domain/repositories/document.py,sha256=vJzr6c92gqBzyhaEdjrvnoneKRrWmJ0AsvocPnhxiLU,767
32
32
  documente_shared/domain/repositories/processing_case.py,sha256=QcY0LumRokRLmL3IWkOZTgN-LQ-Kku5_v7DWujO1Dfw,778
@@ -41,13 +41,13 @@ documente_shared/infrastructure/repositories/dynamo_processing_case.py,sha256=jk
41
41
  documente_shared/infrastructure/repositories/dynamo_processing_case_item.py,sha256=B2ElsASpXNRkwwjdCqXyvDU-LBrLNdwPfHLMvvG9c-Y,1729
42
42
  documente_shared/infrastructure/repositories/http_document_processing.py,sha256=7n4lHgpN17CCr4_Dz9WRbsXeb4FDMJZNDUshFipA1B8,2179
43
43
  documente_shared/infrastructure/repositories/http_processing_case.py,sha256=n1NXJtROTfet2QCKSNnQtLmcNgkJDo6q0Hq48FSpwEU,2249
44
- documente_shared/infrastructure/repositories/http_processing_case_item.py,sha256=cCi7uo1aHPhroxRRlFOhIUgGkY_S2dvWl1DAVr_maxw,2966
44
+ documente_shared/infrastructure/repositories/http_processing_case_item.py,sha256=idciRUH3LGbD13TS6BlEpCpC-lWKqf1MssmjcdR3CKU,2971
45
45
  documente_shared/infrastructure/s3_bucket.py,sha256=vT_yN42RFQXubtUn8ln-j13Os_-25UGClVtXg5Bkv6I,1932
46
46
  documente_shared/infrastructure/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
- documente_shared/infrastructure/services/http_scaling.py,sha256=SK0vReNGXzfN2yKNiYq9u1fvDECU5dHynq5507i7fgI,856
47
+ documente_shared/infrastructure/services/http_scaling.py,sha256=cIo-61nfIwbtO86EGi5r1tFi9g3VJXldhguddt4JUyc,906
48
48
  documente_shared/infrastructure/sqs_queue.py,sha256=KZWeHZ9zmXmrxoNpOQX7GEdDhZ1knbPXgwSwFwJblGg,1504
49
49
  documente_shared/presentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
50
50
  documente_shared/presentation/presenters.py,sha256=GGAEwefmjCIVepsUA2oZOVLxXbhhiISPM0Jgt6dT6O0,423
51
- documente_shared-0.1.88.dist-info/METADATA,sha256=VC_ZNbTzYFmzTDDm-HLTH1CVXAVsetokxdoY5oKl-aM,920
52
- documente_shared-0.1.88.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
53
- documente_shared-0.1.88.dist-info/RECORD,,
51
+ documente_shared-0.1.91.dist-info/METADATA,sha256=uQLe_KK-thOLz0Ni0oeNhijUNuUwSNg8j17dWAUUIXA,920
52
+ documente_shared-0.1.91.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
53
+ documente_shared-0.1.91.dist-info/RECORD,,