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

@@ -116,7 +116,7 @@ class ProcessingCaseItem(object):
116
116
 
117
117
  @property
118
118
  def combined_id(self) -> str:
119
- return f"{self.case_id}_{self.uuid}"
119
+ return f"{self.case_id}__{self.uuid}"
120
120
 
121
121
  @property
122
122
  def has_processed_csv(self) -> bool:
@@ -1,5 +1,7 @@
1
1
  from dataclasses import dataclass
2
2
  from typing import List, Optional
3
+
4
+ from loguru import logger
3
5
  from requests import Response
4
6
 
5
7
  from documente_shared.application.payloads import camel_to_snake
@@ -17,17 +19,18 @@ class HttpDocumentProcessingRepository(
17
19
  def find(self, digest: str) -> Optional[DocumentProcessing]:
18
20
  response = self.session.get(f"{self.api_url}/documents/{digest}/")
19
21
  if response.status_code == 200:
20
- return self._build_processing_case(response)
22
+ return self._build_document_processing(response)
21
23
  return None
22
24
 
23
25
  def persist(self, instance: DocumentProcessing) -> DocumentProcessing:
26
+ logger.info(f"PERSISTING_DOCUMENT: data={instance.to_simple_dict}")
24
27
  response = self.session.put(
25
28
  url=f"{self.api_url}/documents/{instance.digest}/",
26
29
  json=instance.to_simple_dict,
27
30
  )
28
31
  if response.status_code in [200, 201]:
29
32
  raise Exception(f'Error persisting document processing: {response.text}')
30
- return self._build_processing_case(response)
33
+ return self._build_document_processing(response)
31
34
 
32
35
  def remove(self, instance: DocumentProcessing):
33
36
  self.session.delete(f"{self.api_url}/documents/{instance.digest}/")
@@ -43,7 +46,7 @@ class HttpDocumentProcessingRepository(
43
46
  return []
44
47
 
45
48
  @classmethod
46
- def _build_processing_case(cls, response: Response) -> DocumentProcessing:
49
+ def _build_document_processing(cls, response: Response) -> DocumentProcessing:
47
50
  response_json = response.json()
48
51
  instance_data = response_json.get('data', {})
49
52
  return DocumentProcessing.from_dict(camel_to_snake(instance_data))
@@ -1,6 +1,7 @@
1
1
  from dataclasses import dataclass
2
2
  from typing import List, Optional
3
3
 
4
+ from loguru import logger
4
5
  from requests import Response
5
6
 
6
7
  from documente_shared.application.payloads import camel_to_snake
@@ -22,13 +23,13 @@ class HttpProcessingCaseRepository(
22
23
  return None
23
24
 
24
25
  def persist(self, instance: ProcessingCase) -> ProcessingCase:
26
+ logger.info(f"PERSISTING_PROCESSING_CASE: data={instance.to_dict}")
25
27
  response = self.session.put(
26
28
  url=f"{self.api_url}/v1/processing-cases/{instance.uuid}/",
27
29
  json=instance.to_dict,
28
30
  )
29
31
  if response.status_code not in [200, 201]:
30
32
  raise Exception(f'Error persisting processing case: {response.text}')
31
-
32
33
  return self._build_processing_case(response)
33
34
 
34
35
  def remove(self, instance: ProcessingCase):
@@ -1,6 +1,7 @@
1
1
  from dataclasses import dataclass
2
2
  from typing import List, Optional
3
3
 
4
+ from loguru import logger
4
5
  from requests import Response
5
6
 
6
7
  from documente_shared.application.payloads import camel_to_snake
@@ -28,6 +29,7 @@ class HttpProcessingCaseItemRepository(
28
29
  return None
29
30
 
30
31
  def persist(self, instance: ProcessingCaseItem) -> ProcessingCaseItem:
32
+ logger.info(f"PERSISTING_PROCESSING_CASE_ITEM: data={instance.to_simple_dict}")
31
33
  response: Response = self.session.put(
32
34
  url=f"{self.api_url}/v1/processing-case-items/{instance.uuid}/",
33
35
  json=instance.to_persist_dict,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: documente_shared
3
- Version: 0.1.107
3
+ Version: 0.1.108
4
4
  Summary: Shared utilities for Documente AI projects
5
5
  License: MIT
6
6
  Author: Tech
@@ -19,7 +19,7 @@ documente_shared/domain/entities/document_metadata.py,sha256=ygyFIC5qwxlm8DUM5kv
19
19
  documente_shared/domain/entities/in_memory_document.py,sha256=BswTG1LjrQ8nP3pb0T2bSODPjJ2ud4ifbnYxRdFlIhY,2116
20
20
  documente_shared/domain/entities/processing_case.py,sha256=NwGGGMyXnNprtO1lCP6rkPbhGhZ6C_z30OeHi_LHXDY,5706
21
21
  documente_shared/domain/entities/processing_case_filters.py,sha256=harKyu7QEuL1bI_Z8_UxkVCMo5r9vHeNHyi_Ja07vjs,1953
22
- documente_shared/domain/entities/processing_case_item.py,sha256=LiGtWVw5Di1s87I8ZvY1K8ZcBke06jCV1u7rSh06G7w,10249
22
+ documente_shared/domain/entities/processing_case_item.py,sha256=p9cyJpitd7WPiiRevZW6jRrD3VzCtM2iiYtCXOiLSgs,10250
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=izdBXEz0TMNjxxZVjcM3YclzOv250JOV-amSpqmtQ9c,2180
@@ -43,9 +43,9 @@ documente_shared/infrastructure/repositories/__init__.py,sha256=47DEQpj8HBSa-_TI
43
43
  documente_shared/infrastructure/repositories/dynamo_document.py,sha256=_Yp4gtA-n-hJ2w2wAM5BMCs2Mf46Q2Kq3eHqlxudkL4,1443
44
44
  documente_shared/infrastructure/repositories/dynamo_processing_case.py,sha256=jkTVHThKHshLI53OV7ivK-WchFoAZTnaXlgh_1OX52k,1446
45
45
  documente_shared/infrastructure/repositories/dynamo_processing_case_item.py,sha256=B2ElsASpXNRkwwjdCqXyvDU-LBrLNdwPfHLMvvG9c-Y,1729
46
- documente_shared/infrastructure/repositories/http_document_processing.py,sha256=7n4lHgpN17CCr4_Dz9WRbsXeb4FDMJZNDUshFipA1B8,2179
47
- documente_shared/infrastructure/repositories/http_processing_case.py,sha256=n1NXJtROTfet2QCKSNnQtLmcNgkJDo6q0Hq48FSpwEU,2249
48
- documente_shared/infrastructure/repositories/http_processing_case_item.py,sha256=idciRUH3LGbD13TS6BlEpCpC-lWKqf1MssmjcdR3CKU,2971
46
+ documente_shared/infrastructure/repositories/http_document_processing.py,sha256=cMAaDO15_j2bq2J0UHqLk-OuhN76WJPqb4ExRqTxZBw,2294
47
+ documente_shared/infrastructure/repositories/http_processing_case.py,sha256=zBHscJSlsqTLT-NrUT3spfLgS8ZB5Tv9IokCB2Iyvpo,2350
48
+ documente_shared/infrastructure/repositories/http_processing_case_item.py,sha256=0L8JMkia1-kyIIXydaLtkrAPbW8GgzzPWE3iZ-y51KU,3085
49
49
  documente_shared/infrastructure/repositories/mem_document.py,sha256=jg4rIjgSZijymjY9o7Q1lLcaiW9h-O8j6XljO1bJI7c,1299
50
50
  documente_shared/infrastructure/repositories/mem_processing_case.py,sha256=ZAQwp4j0DXQMt92Z-ZR4h9MtbUp9IYy0OHz_sHgkZxY,1147
51
51
  documente_shared/infrastructure/repositories/mem_processing_case_item.py,sha256=kQufzDTouu3agIXpEzRPdjltjTUFExrFbKkAZarGrUg,1419
@@ -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.107.dist-info/METADATA,sha256=KKuWwC9UvgY_oyO456dwbS7XZZfLuJJfIZSC5PSPFms,963
59
- documente_shared-0.1.107.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
60
- documente_shared-0.1.107.dist-info/RECORD,,
58
+ documente_shared-0.1.108.dist-info/METADATA,sha256=zQzQnLTguvzfldOwccU0YWyG2icaIJMffJWCyMFfsQ4,963
59
+ documente_shared-0.1.108.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
60
+ documente_shared-0.1.108.dist-info/RECORD,,