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

@@ -63,6 +63,8 @@ class DocumentProcess(object):
63
63
  self.status = DocumentProcessStatus.COMPLETED
64
64
  self.processed_at = datetime.now()
65
65
 
66
+ def deleted(self):
67
+ self.status = DocumentProcessStatus.DELETED
66
68
 
67
69
 
68
70
  @property
@@ -7,4 +7,5 @@ class DocumentProcessStatus(BaseEnum):
7
7
  PROCESSING = 'PROCESSING'
8
8
  COMPLETED = 'COMPLETED'
9
9
  FAILED = 'FAILED'
10
+ DELETED = 'DELETED'
10
11
 
@@ -0,0 +1,31 @@
1
+ import json
2
+ from dataclasses import dataclass
3
+
4
+ import boto3
5
+
6
+
7
+ @dataclass
8
+ class SQSQueue(object):
9
+ queue_url: str
10
+
11
+ def __post_init__(self):
12
+ self._client = boto3.client('sqs')
13
+
14
+ def send_message(
15
+ self,
16
+ payload: dict,
17
+ message_attributes: dict = None,
18
+ delay_seconds: dict = None,
19
+ message_group_id: dict = None,
20
+ message_deduplication_id: dict =None,
21
+ ):
22
+ message_params = {
23
+ 'QueueUrl': self.queue_url,
24
+ 'MessageBody': json.dumps(payload),
25
+ 'MessageAttributes': message_attributes,
26
+ 'DelaySeconds': delay_seconds,
27
+ 'MessageGroupId': message_group_id,
28
+ 'MessageDeduplicationId': message_deduplication_id,
29
+ }
30
+ clean_params = {key: value for key, value in message_params.items() if value} # noqa: E501, WPS110
31
+ return self._client.send_message(**clean_params)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: documente_shared
3
- Version: 0.1.4
3
+ Version: 0.1.6
4
4
  Summary: Shared utilities for Documente AI projects
5
5
  License: MIT
6
6
  Author: Tech
@@ -1,13 +1,14 @@
1
1
  documente_shared/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  documente_shared/domain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  documente_shared/domain/base_enum.py,sha256=DojAfn-zQdtjtImeHUpBzE6TBTm07XrbMOdW3h8RVd8,1449
4
- documente_shared/domain/entities.py,sha256=0Flg2yWYdVM34hAwZmarn8CUKGZ9LchtC6Imeikbthk,3726
5
- documente_shared/domain/enums.py,sha256=LF-gY3EyucQSmGBxXNy8z4Cb4Ry672muPtz5Xt7e9oo,227
4
+ documente_shared/domain/entities.py,sha256=saJ0pB1IDQqed3UqQrwGvXEMWG1R4TNx3se3y6tLOD0,3801
5
+ documente_shared/domain/enums.py,sha256=o20YJClja9FQbbZhdfreGCWYwjd3AH7q2kIzV9wn2dw,251
6
6
  documente_shared/domain/repositories.py,sha256=h_nArptP5Xh7Jrhden-Ii9rZQqzgLFHhuzj1p78LgmU,365
7
7
  documente_shared/infrastructure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  documente_shared/infrastructure/dynamo_repositories.py,sha256=9t_ufQBSF7cJbeHYzfJABOQydj1HAvhI8UnqDEDPryA,532
9
9
  documente_shared/infrastructure/dynamo_table.py,sha256=5yF5EVQkHTZe4tLYZsfEDS8tp_iorMlMjNu-qn3Oj9E,2095
10
10
  documente_shared/infrastructure/s3_bucket.py,sha256=yL1mjwwlj8R72t38OAKg-VzkWqV2NOR7XQl17GxTb8A,1566
11
- documente_shared-0.1.4.dist-info/METADATA,sha256=Rudo2jBOTuKsoXXuOd8WxGS2aRm0fu7iHifThD22HEU,639
12
- documente_shared-0.1.4.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
13
- documente_shared-0.1.4.dist-info/RECORD,,
11
+ documente_shared/infrastructure/sqs_queue.py,sha256=iAlUdvb65_2JxWT6ANjt94AfzvAP2xtGG-YDANb93v8,915
12
+ documente_shared-0.1.6.dist-info/METADATA,sha256=O0qt19tL2hRBOPb9YjD9QgGZvDT3l8mVEhXB0O94b24,639
13
+ documente_shared-0.1.6.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
14
+ documente_shared-0.1.6.dist-info/RECORD,,