my-aws-helpers 5.0.1__tar.gz → 5.2.0__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 my-aws-helpers might be problematic. Click here for more details.
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/PKG-INFO +1 -1
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/my_aws_helpers/bedrock.py +10 -1
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/my_aws_helpers/s3.py +4 -2
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/my_aws_helpers.egg-info/PKG-INFO +1 -1
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/setup.py +1 -1
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/MANIFEST.in +0 -0
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/README.md +0 -0
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/my_aws_helpers/api.py +0 -0
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/my_aws_helpers/auth.py +0 -0
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/my_aws_helpers/cognito.py +0 -0
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/my_aws_helpers/dynamo.py +0 -0
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/my_aws_helpers/errors.py +0 -0
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/my_aws_helpers/event.py +0 -0
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/my_aws_helpers/logging.py +0 -0
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/my_aws_helpers/prompts/__init__.py +0 -0
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/my_aws_helpers/prompts/markdown_system_prompt.txt +0 -0
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/my_aws_helpers/prompts/transactions_headers_prompt.txt +0 -0
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/my_aws_helpers/prompts/transactions_headers_prompt_v2.txt +0 -0
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/my_aws_helpers/prompts/transactions_prompt.txt +0 -0
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/my_aws_helpers/sfn.py +0 -0
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/my_aws_helpers.egg-info/SOURCES.txt +0 -0
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/my_aws_helpers.egg-info/dependency_links.txt +0 -0
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/my_aws_helpers.egg-info/requires.txt +0 -0
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/my_aws_helpers.egg-info/top_level.txt +0 -0
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/my_aws_helpers.egg-info/zip-safe +0 -0
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/setup.cfg +0 -0
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/tests/test_cognito.py +0 -0
- {my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/tests/test_event.py +0 -0
|
@@ -5,12 +5,13 @@ import json
|
|
|
5
5
|
import time
|
|
6
6
|
import os
|
|
7
7
|
import io
|
|
8
|
-
import
|
|
8
|
+
from copy import copy
|
|
9
9
|
from typing import Optional, List, Dict
|
|
10
10
|
from enum import Enum
|
|
11
11
|
import pymupdf
|
|
12
12
|
import concurrent.futures
|
|
13
13
|
from dataclasses import dataclass
|
|
14
|
+
from my_aws_helpers.s3 import S3Serialiser
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
class ImageType(str, Enum):
|
|
@@ -56,6 +57,14 @@ class OCRResult:
|
|
|
56
57
|
page_number=data.get("page_number", 0),
|
|
57
58
|
)
|
|
58
59
|
|
|
60
|
+
@classmethod
|
|
61
|
+
def from_s3_representation(cls, obj: dict) -> OCRResult:
|
|
62
|
+
return cls(**obj)
|
|
63
|
+
|
|
64
|
+
def to_s3_representation(self) -> dict:
|
|
65
|
+
obj = copy(vars(self))
|
|
66
|
+
return S3Serialiser.object_serialiser(obj=obj)
|
|
67
|
+
|
|
59
68
|
|
|
60
69
|
class Bedrock:
|
|
61
70
|
def __init__(
|
|
@@ -34,7 +34,7 @@ class S3Serialiser:
|
|
|
34
34
|
if isinstance(obj, datetime) or isinstance(obj, date):
|
|
35
35
|
return obj.isoformat()
|
|
36
36
|
if isinstance(obj, S3Location):
|
|
37
|
-
return obj.location
|
|
37
|
+
return obj.location
|
|
38
38
|
return obj
|
|
39
39
|
|
|
40
40
|
@staticmethod
|
|
@@ -103,7 +103,9 @@ class S3:
|
|
|
103
103
|
try:
|
|
104
104
|
response = self.client.list_objects_v2(Bucket=bucket_name, Prefix=prefix)
|
|
105
105
|
contents = response["Contents"]
|
|
106
|
-
locations = [
|
|
106
|
+
locations = [
|
|
107
|
+
S3Location(bucket=bucket_name, file_name=c["Key"]) for c in contents
|
|
108
|
+
]
|
|
107
109
|
return locations
|
|
108
110
|
except Exception as e:
|
|
109
111
|
logger.exception(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/my_aws_helpers/prompts/markdown_system_prompt.txt
RENAMED
|
File without changes
|
{my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/my_aws_helpers/prompts/transactions_headers_prompt.txt
RENAMED
|
File without changes
|
|
File without changes
|
{my_aws_helpers-5.0.1 → my_aws_helpers-5.2.0}/my_aws_helpers/prompts/transactions_prompt.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|