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

@@ -19,6 +19,7 @@ def remove_slash_from_path(path: str) -> str:
19
19
  class DocumentProcess(object):
20
20
  digest: str
21
21
  status: DocumentProcessStatus
22
+ metadata: Optional[dict] = None
22
23
  file_path: Optional[str] = None
23
24
  file_bytes: Optional[bytes] = None
24
25
  category: Optional[DocumentProcessCategory] = None
@@ -34,6 +35,9 @@ class DocumentProcess(object):
34
35
  failed_at: Optional[datetime] = None
35
36
  completed_at: Optional[datetime] = None
36
37
 
38
+ def __post_init__(self):
39
+ self.metadata = self.metadata or {}
40
+
37
41
  @property
38
42
  def is_pending(self) -> bool:
39
43
  return self.status == DocumentProcessStatus.PENDING
@@ -107,6 +111,7 @@ class DocumentProcess(object):
107
111
  return {
108
112
  'digest': self.digest,
109
113
  'status': str(self.status),
114
+ 'metadata': self.metadata,
110
115
  'file_path': self.file_path,
111
116
  'category': (
112
117
  str(self.category)
@@ -135,7 +140,7 @@ class DocumentProcess(object):
135
140
  properties: List[str] = None,
136
141
  ):
137
142
  instance_properties = properties or [
138
- 'status', 'file_path', 'file_bytes', 'category', 'sub_category',
143
+ 'status', 'metadata', 'file_path', 'file_bytes', 'category', 'sub_category',
139
144
  'processed_csv_path', 'processed_csv_bytes', 'processed_xlsx_path',
140
145
  'processed_xlsx_bytes', 'processing_time', 'uploaded_at',
141
146
  'enqueued_at', 'started_at', 'failed_at', 'completed_at',
@@ -152,6 +157,7 @@ class DocumentProcess(object):
152
157
  return cls(
153
158
  digest=data.get('digest'),
154
159
  status=DocumentProcessStatus.from_value(data.get('status')),
160
+ metadata=data.get('metadata', {}),
155
161
  file_path=data.get('file_path'),
156
162
  category=(
157
163
  DocumentProcessCategory.from_value(data.get('category'))
@@ -8,6 +8,7 @@ class DocumentProcessStatus(BaseEnum):
8
8
  COMPLETED = 'COMPLETED'
9
9
  FAILED = 'FAILED'
10
10
  DELETED = 'DELETED'
11
+ CANCELLED = 'CANCELLED'
11
12
 
12
13
 
13
14
  class DocumentProcessCategory(BaseEnum):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: documente_shared
3
- Version: 0.1.25
3
+ Version: 0.1.27
4
4
  Summary: Shared utilities for Documente AI projects
5
5
  License: MIT
6
6
  Author: Tech
@@ -4,14 +4,14 @@ documente_shared/application/digest.py,sha256=Um6E8WfFri2_lly4RFWydJyvSfPZGFcOX-
4
4
  documente_shared/application/time_utils.py,sha256=XDH27cKgoTFO8ad1JgrxKaeT7sZ1fduuJqLkvHUjy-Q,309
5
5
  documente_shared/domain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  documente_shared/domain/base_enum.py,sha256=DojAfn-zQdtjtImeHUpBzE6TBTm07XrbMOdW3h8RVd8,1449
7
- documente_shared/domain/entities.py,sha256=J4B5fMBcwyiVB5xQToPFsOvF5yWIchsmyicC6iq3eRs,6222
8
- documente_shared/domain/enums.py,sha256=wrMpM-1KgXFkd-He-3onNcqR3Zf53Q-_axjXGjx7MIY,435
7
+ documente_shared/domain/entities.py,sha256=itAfic52aUFUZabcspSk8d5IJ3Eo4hLyRl8ZxsTtpZE,6430
8
+ documente_shared/domain/enums.py,sha256=s3bFDkpplWvJWNpUwPOkC9a3OYUYsx8uTusN_FrzNQk,463
9
9
  documente_shared/domain/repositories.py,sha256=EekvB2BE4AnT5myEhU3DfwHfF9MkNJZRbqRVGFxCEWM,509
10
10
  documente_shared/infrastructure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  documente_shared/infrastructure/dynamo_repositories.py,sha256=WULK8_N7PjA397vXTZd6QB7_Kw6dEXHaVMcd9nEvSvs,760
12
12
  documente_shared/infrastructure/dynamo_table.py,sha256=Lod8vwUCGX65SNH_8hvlpG6rRUYb4jfZqoFHD1YloAA,2096
13
13
  documente_shared/infrastructure/s3_bucket.py,sha256=RwcEyYPUUXQ0fFR-Zr1KfkFGGpO6qAIfZ70CWHu1V8M,1923
14
14
  documente_shared/infrastructure/sqs_queue.py,sha256=PSiTAnjXvQ-W-9mzLpH2UjbQJTvYkMiaxNaMecF-cR4,1505
15
- documente_shared-0.1.25.dist-info/METADATA,sha256=yEjSzweJsasaYAPUJgWkwdaCSl1ZT6jZBjDTSl8GdzE,640
16
- documente_shared-0.1.25.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
17
- documente_shared-0.1.25.dist-info/RECORD,,
15
+ documente_shared-0.1.27.dist-info/METADATA,sha256=sXO5zKOY9F9NhkSSUEKMu6RJj9wN2ytHB4EzOB5vtaA,640
16
+ documente_shared-0.1.27.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
17
+ documente_shared-0.1.27.dist-info/RECORD,,