documente_shared 0.1.22__tar.gz → 0.1.24__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.

Files changed (17) hide show
  1. {documente_shared-0.1.22 → documente_shared-0.1.24}/PKG-INFO +1 -1
  2. {documente_shared-0.1.22 → documente_shared-0.1.24}/documente_shared/domain/entities.py +17 -1
  3. {documente_shared-0.1.22 → documente_shared-0.1.24}/documente_shared/infrastructure/dynamo_repositories.py +1 -1
  4. {documente_shared-0.1.22 → documente_shared-0.1.24}/documente_shared/infrastructure/dynamo_table.py +1 -1
  5. {documente_shared-0.1.22 → documente_shared-0.1.24}/pyproject.toml +1 -1
  6. {documente_shared-0.1.22 → documente_shared-0.1.24}/README.md +0 -0
  7. {documente_shared-0.1.22 → documente_shared-0.1.24}/documente_shared/__init__.py +0 -0
  8. {documente_shared-0.1.22 → documente_shared-0.1.24}/documente_shared/application/__init__.py +0 -0
  9. {documente_shared-0.1.22 → documente_shared-0.1.24}/documente_shared/application/digest.py +0 -0
  10. {documente_shared-0.1.22 → documente_shared-0.1.24}/documente_shared/application/time_utils.py +0 -0
  11. {documente_shared-0.1.22 → documente_shared-0.1.24}/documente_shared/domain/__init__.py +0 -0
  12. {documente_shared-0.1.22 → documente_shared-0.1.24}/documente_shared/domain/base_enum.py +0 -0
  13. {documente_shared-0.1.22 → documente_shared-0.1.24}/documente_shared/domain/enums.py +0 -0
  14. {documente_shared-0.1.22 → documente_shared-0.1.24}/documente_shared/domain/repositories.py +0 -0
  15. {documente_shared-0.1.22 → documente_shared-0.1.24}/documente_shared/infrastructure/__init__.py +0 -0
  16. {documente_shared-0.1.22 → documente_shared-0.1.24}/documente_shared/infrastructure/s3_bucket.py +0 -0
  17. {documente_shared-0.1.22 → documente_shared-0.1.24}/documente_shared/infrastructure/sqs_queue.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: documente_shared
3
- Version: 0.1.22
3
+ Version: 0.1.24
4
4
  Summary: Shared utilities for Documente AI projects
5
5
  License: MIT
6
6
  Author: Tech
@@ -10,6 +10,10 @@ from documente_shared.domain.enums import (
10
10
  DocumentProcessCategory,
11
11
  )
12
12
 
13
+ def remove_slash_from_path(path: str) -> str:
14
+ if path and path.startswith('/'):
15
+ return path[1:]
16
+ return path
13
17
 
14
18
  @dataclass
15
19
  class DocumentProcess(object):
@@ -77,6 +81,18 @@ class DocumentProcess(object):
77
81
  def deleted(self):
78
82
  self.status = DocumentProcessStatus.DELETED
79
83
 
84
+ @property
85
+ def file_key(self) -> str:
86
+ return remove_slash_from_path(self.file_path)
87
+
88
+ @property
89
+ def processed_csv_key(self) -> str:
90
+ return remove_slash_from_path(self.processed_csv_path)
91
+
92
+ @property
93
+ def processed_xlsx_key(self) -> str:
94
+ return remove_slash_from_path(self.processed_xlsx_path)
95
+
80
96
  @property
81
97
  def extended_filename(self) -> str:
82
98
  return self.file_path.split('/')[-1]
@@ -90,7 +106,7 @@ class DocumentProcess(object):
90
106
  def to_dict(self) -> dict:
91
107
  return {
92
108
  'digest': self.digest,
93
- 'status': self.status.value,
109
+ 'status': str(self.status),
94
110
  'file_path': self.file_path,
95
111
  'category': (
96
112
  str(self.category)
@@ -11,7 +11,7 @@ class DynamoDocumentProcessRepository(
11
11
  DocumentProcessRepository,
12
12
  ):
13
13
  def find(self, digest: str) -> Optional[DocumentProcess]:
14
- item = self.get(key=digest)
14
+ item = self.get(key={'digest': digest})
15
15
  if item:
16
16
  return DocumentProcess.from_dict(item)
17
17
  return None
@@ -13,7 +13,7 @@ class DynamoDBTable(object):
13
13
  def __post_init__(self):
14
14
  self._table = boto3.resource('dynamodb').Table(self.table_name)
15
15
 
16
- def get(self, key: str):
16
+ def get(self, key: dict):
17
17
  return self._table.get_item(Key=key).get('Item')
18
18
 
19
19
  def get_all(self):
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "documente_shared"
3
- version = "0.1.22"
3
+ version = "0.1.24"
4
4
  description = "Shared utilities for Documente AI projects"
5
5
  authors = ["Tech <tech@llamitai.com>"]
6
6
  license = "MIT"