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

@@ -0,0 +1,43 @@
1
+ from dataclasses import dataclass
2
+ from typing import List, Optional
3
+
4
+ from documente_shared.domain.entities.processing_case_item import ProcessingCaseItem
5
+ from documente_shared.domain.entities.processing_case_item_filters import ProcessingCaseItemFilters
6
+
7
+ from documente_shared.domain.repositories.processing_case_item import ProcessingCaseItemRepository
8
+
9
+
10
+ @dataclass
11
+ class MemoryProcessingCaseItemRepository(ProcessingCaseItemRepository):
12
+ collection: dict[str, ProcessingCaseItem] = None
13
+
14
+ def __post_init__(self):
15
+ self.collection = self.collection or {}
16
+
17
+ def find(
18
+ self,
19
+ uuid: str,
20
+ include_items: bool = False,
21
+ ) -> Optional[ProcessingCaseItem]:
22
+ if uuid in self.collection:
23
+ return self.collection[uuid]
24
+ return None
25
+
26
+ def find_by_digest(self, digest: str) -> Optional[ProcessingCaseItem]:
27
+ for item in self.collection.values():
28
+ if item.digest == digest:
29
+ return item
30
+ return None
31
+
32
+
33
+ def persist(self, instance: ProcessingCaseItem) -> ProcessingCaseItem:
34
+ self.collection[instance.uuid] = instance
35
+ return instance
36
+
37
+ def remove(self, instance: ProcessingCaseItem):
38
+ if instance.uuid in self.collection:
39
+ del self.collection[instance.uuid]
40
+ return None
41
+
42
+ def filter(self, filters: ProcessingCaseItemFilters) -> List[ProcessingCaseItem]:
43
+ return []
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: documente_shared
3
- Version: 0.1.103
3
+ Version: 0.1.104
4
4
  Summary: Shared utilities for Documente AI projects
5
5
  License: MIT
6
6
  Author: Tech
@@ -47,12 +47,13 @@ documente_shared/infrastructure/repositories/http_processing_case.py,sha256=n1NX
47
47
  documente_shared/infrastructure/repositories/http_processing_case_item.py,sha256=idciRUH3LGbD13TS6BlEpCpC-lWKqf1MssmjcdR3CKU,2971
48
48
  documente_shared/infrastructure/repositories/mem_document.py,sha256=jg4rIjgSZijymjY9o7Q1lLcaiW9h-O8j6XljO1bJI7c,1299
49
49
  documente_shared/infrastructure/repositories/mem_processing_case.py,sha256=ZAQwp4j0DXQMt92Z-ZR4h9MtbUp9IYy0OHz_sHgkZxY,1147
50
+ documente_shared/infrastructure/repositories/mem_processing_case_item.py,sha256=kQufzDTouu3agIXpEzRPdjltjTUFExrFbKkAZarGrUg,1419
50
51
  documente_shared/infrastructure/s3_bucket.py,sha256=vT_yN42RFQXubtUn8ln-j13Os_-25UGClVtXg5Bkv6I,1932
51
52
  documente_shared/infrastructure/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
52
53
  documente_shared/infrastructure/services/http_scaling.py,sha256=cIo-61nfIwbtO86EGi5r1tFi9g3VJXldhguddt4JUyc,906
53
54
  documente_shared/infrastructure/sqs_queue.py,sha256=KZWeHZ9zmXmrxoNpOQX7GEdDhZ1knbPXgwSwFwJblGg,1504
54
55
  documente_shared/presentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
55
56
  documente_shared/presentation/presenters.py,sha256=GGAEwefmjCIVepsUA2oZOVLxXbhhiISPM0Jgt6dT6O0,423
56
- documente_shared-0.1.103.dist-info/METADATA,sha256=Yx5Ple4KfKdy7iklQkofyD4f-m2Iz7f26XETdrO1tFI,963
57
- documente_shared-0.1.103.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
58
- documente_shared-0.1.103.dist-info/RECORD,,
57
+ documente_shared-0.1.104.dist-info/METADATA,sha256=GNOOWWV0lMU1B_D6PfrbouFMmtFwh0zXHOEc707xSeU,963
58
+ documente_shared-0.1.104.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
59
+ documente_shared-0.1.104.dist-info/RECORD,,