documente_shared 0.1.4__tar.gz → 0.1.5__tar.gz

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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: documente_shared
3
- Version: 0.1.4
3
+ Version: 0.1.5
4
4
  Summary: Shared utilities for Documente AI projects
5
5
  License: MIT
6
6
  Author: Tech
@@ -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
  [tool.poetry]
2
2
  name = "documente_shared"
3
- version = "0.1.4"
3
+ version = "0.1.5"
4
4
  description = "Shared utilities for Documente AI projects"
5
5
  authors = ["Tech <tech@llamitai.com>"]
6
6
  license = "MIT"