documente_shared 0.1.85__py3-none-any.whl → 0.1.86__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,7 @@
1
+ import pytz
2
+ from datetime import datetime
3
+
4
+
5
+
6
+ def utc_now() -> datetime:
7
+ return datetime.now(tz=pytz.utc)
@@ -110,3 +110,10 @@ class ProcessingType(BaseEnum):
110
110
  @property
111
111
  def is_processing_case(self):
112
112
  return self == ProcessingType.PROCESSING_CASE
113
+
114
+
115
+ class TaskResultStatus(BaseEnum):
116
+ PENDING = "PENDING"
117
+ SUCCESS = "SUCCESS"
118
+ IN_PROGRESS = "IN_PROGRESS"
119
+ FAILURE = "FAILURE"
@@ -0,0 +1,14 @@
1
+ import json
2
+ import boto3
3
+
4
+
5
+ def invoke_lambda(function_name: str, payload: dict) -> dict | list | None:
6
+ client = boto3.client('lambda')
7
+
8
+ response = client.invoke(
9
+ FunctionName=function_name,
10
+ InvocationType='RequestResponse',
11
+ Payload=json.dumps(payload),
12
+ )
13
+
14
+ return json.loads(response['Payload'].read().decode('utf-8'))
File without changes
@@ -0,0 +1,16 @@
1
+ from dataclasses import dataclass
2
+
3
+ from documente_shared.application.dates import utc_now
4
+ from documente_shared.domain.enums.common import TaskResultStatus
5
+
6
+
7
+ @dataclass
8
+ class TaskResultPresenter(object):
9
+ status: TaskResultStatus = TaskResultStatus.SUCCESS
10
+
11
+ @property
12
+ def to_dict(self) -> dict:
13
+ return {
14
+ "status": str(self.status),
15
+ "completed_at": utc_now().isoformat(),
16
+ }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: documente_shared
3
- Version: 0.1.85
3
+ Version: 0.1.86
4
4
  Summary: Shared utilities for Documente AI projects
5
5
  License: MIT
6
6
  Author: Tech
@@ -1,5 +1,6 @@
1
1
  documente_shared/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  documente_shared/application/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ documente_shared/application/dates.py,sha256=uExNddWmX9VEX_u420JGoC7fL-ieJ4956I0aw_WX3sQ,109
3
4
  documente_shared/application/digest.py,sha256=Um6E8WfFri2_lly4RFWydJyvSfPZGFcOX-opEOzDCWc,172
4
5
  documente_shared/application/exceptions.py,sha256=lQM8m7wmI9OTLGva0gd7s7YT7ldaTk_Ln4t32PpzNf8,654
5
6
  documente_shared/application/files.py,sha256=ADiWi6Mk3YQGx3boGsDqdb5wk8qmabkGRy7bhNFa1OY,649
@@ -20,7 +21,7 @@ documente_shared/domain/entities/processing_case_item.py,sha256=U_g99AJdlRRJpJ0N
20
21
  documente_shared/domain/entities/processing_case_item_filters.py,sha256=-cAQTSWOepMMcGCBg2X3dd0W_8XHuBTlvOB1d-3sVVM,1971
21
22
  documente_shared/domain/entities/processing_event.py,sha256=AMkW4dJjW6ss-uvDeWzVMBIJtax8JNWy-zPo1R-TiWY,1963
22
23
  documente_shared/domain/enums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
- documente_shared/domain/enums/common.py,sha256=yoq__M53bCCf7B2tbOGdOpieYvGpiJ69s6T0FqvLUII,2687
24
+ documente_shared/domain/enums/common.py,sha256=wJWYhh98sdCGL_1WodhYLpoT_IYTzkTDOexclpaIM-0,2827
24
25
  documente_shared/domain/enums/document.py,sha256=QwvckW-VJBSujllIVloKlZUh1pI5UnX4oueYbV5CYGw,3205
25
26
  documente_shared/domain/enums/processing_case.py,sha256=LhFhcoWlockxcpplsVdC6M2kpXn7sOdzQySf24wFhx8,1572
26
27
  documente_shared/domain/repositories/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -30,6 +31,7 @@ documente_shared/domain/repositories/processing_case_item.py,sha256=gPZaQCMYlD6v
30
31
  documente_shared/infrastructure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
32
  documente_shared/infrastructure/documente_client.py,sha256=paO66zNelDyA6D6iqTXXFVQ9ERRZoJCGWR3T3hySsaM,503
32
33
  documente_shared/infrastructure/dynamo_table.py,sha256=TMQbcuty7wjDMbuhI8PbT0IGXelgELsNTtqTEQeZ824,2112
34
+ documente_shared/infrastructure/lambdas.py,sha256=sGgkw7Mhvuq2TpbW_RNdf5JvQnuzxWYH6gPOVtQ4DtE,357
33
35
  documente_shared/infrastructure/repositories/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
36
  documente_shared/infrastructure/repositories/dynamo_document.py,sha256=_Yp4gtA-n-hJ2w2wAM5BMCs2Mf46Q2Kq3eHqlxudkL4,1443
35
37
  documente_shared/infrastructure/repositories/dynamo_processing_case.py,sha256=IoIHtlaEe4G5TqIV9IvG45a3HRBVHLfNC9sSgQjabUk,1464
@@ -39,6 +41,8 @@ documente_shared/infrastructure/repositories/http_processing_case.py,sha256=FcOn
39
41
  documente_shared/infrastructure/repositories/http_processing_case_item.py,sha256=babWakDZfHxWgB1OUwZsPTr8nhDwC-CDBn-vYtgUtUM,2494
40
42
  documente_shared/infrastructure/s3_bucket.py,sha256=vT_yN42RFQXubtUn8ln-j13Os_-25UGClVtXg5Bkv6I,1932
41
43
  documente_shared/infrastructure/sqs_queue.py,sha256=KZWeHZ9zmXmrxoNpOQX7GEdDhZ1knbPXgwSwFwJblGg,1504
42
- documente_shared-0.1.85.dist-info/METADATA,sha256=On4dTXDR9MF1K2P2FjhW_OeCNOLfBQW0XZT2hI8t5Zg,881
43
- documente_shared-0.1.85.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
44
- documente_shared-0.1.85.dist-info/RECORD,,
44
+ documente_shared/presentation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
45
+ documente_shared/presentation/presenters.py,sha256=GGAEwefmjCIVepsUA2oZOVLxXbhhiISPM0Jgt6dT6O0,423
46
+ documente_shared-0.1.86.dist-info/METADATA,sha256=iUB2ODiR3m6PjpgmIqt3l2O5yFcyhGelTcNYOQrjqcY,881
47
+ documente_shared-0.1.86.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
48
+ documente_shared-0.1.86.dist-info/RECORD,,