documente_shared 0.1.37__tar.gz → 0.1.38__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 (19) hide show
  1. {documente_shared-0.1.37 → documente_shared-0.1.38}/PKG-INFO +1 -1
  2. {documente_shared-0.1.37 → documente_shared-0.1.38}/documente_shared/domain/entities/document_process.py +23 -0
  3. {documente_shared-0.1.37 → documente_shared-0.1.38}/pyproject.toml +1 -1
  4. {documente_shared-0.1.37 → documente_shared-0.1.38}/README.md +0 -0
  5. {documente_shared-0.1.37 → documente_shared-0.1.38}/documente_shared/__init__.py +0 -0
  6. {documente_shared-0.1.37 → documente_shared-0.1.38}/documente_shared/application/__init__.py +0 -0
  7. {documente_shared-0.1.37 → documente_shared-0.1.38}/documente_shared/application/digest.py +0 -0
  8. {documente_shared-0.1.37 → documente_shared-0.1.38}/documente_shared/application/time_utils.py +0 -0
  9. {documente_shared-0.1.37 → documente_shared-0.1.38}/documente_shared/domain/__init__.py +0 -0
  10. {documente_shared-0.1.37 → documente_shared-0.1.38}/documente_shared/domain/base_enum.py +0 -0
  11. {documente_shared-0.1.37 → documente_shared-0.1.38}/documente_shared/domain/entities/__init__.py +0 -0
  12. {documente_shared-0.1.37 → documente_shared-0.1.38}/documente_shared/domain/entities/document_process_metadata.py +0 -0
  13. {documente_shared-0.1.37 → documente_shared-0.1.38}/documente_shared/domain/enums.py +0 -0
  14. {documente_shared-0.1.37 → documente_shared-0.1.38}/documente_shared/domain/repositories.py +0 -0
  15. {documente_shared-0.1.37 → documente_shared-0.1.38}/documente_shared/infrastructure/__init__.py +0 -0
  16. {documente_shared-0.1.37 → documente_shared-0.1.38}/documente_shared/infrastructure/dynamo_repositories.py +0 -0
  17. {documente_shared-0.1.37 → documente_shared-0.1.38}/documente_shared/infrastructure/dynamo_table.py +0 -0
  18. {documente_shared-0.1.37 → documente_shared-0.1.38}/documente_shared/infrastructure/s3_bucket.py +0 -0
  19. {documente_shared-0.1.37 → documente_shared-0.1.38}/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.37
3
+ Version: 0.1.38
4
4
  Summary: Shared utilities for Documente AI projects
5
5
  License: MIT
6
6
  Author: Tech
@@ -69,6 +69,13 @@ class DocumentProcess(object):
69
69
  self.file_path,
70
70
  ])
71
71
 
72
+ @property
73
+ def is_finished(self) -> bool:
74
+ return self.status in [
75
+ DocumentProcessStatus.COMPLETED,
76
+ DocumentProcessStatus.FAILED,
77
+ ]
78
+
72
79
  def enqueue(self):
73
80
  self.status = DocumentProcessStatus.ENQUEUED
74
81
  self.enqueued_at = datetime.now()
@@ -114,6 +121,22 @@ class DocumentProcess(object):
114
121
  filename_with_extension = self.extended_filename
115
122
  return filename_with_extension.split('.')[0]
116
123
 
124
+ def __eq__(self, other: 'DocumentProcess') -> bool:
125
+ if not other:
126
+ return False
127
+
128
+ return (
129
+ self.digest == other.digest
130
+ and self.status == other.status
131
+ and self.file_path == other.file_path
132
+ and self.uploaded_at == other.uploaded_at
133
+ and self.enqueued_at == other.enqueued_at
134
+ and self.started_at == other.started_at
135
+ and self.failed_at == other.failed_at
136
+ and self.completed_at == other.completed_at
137
+ )
138
+
139
+
117
140
  @property
118
141
  def to_dict(self) -> dict:
119
142
  return {
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "documente_shared"
3
- version = "0.1.37"
3
+ version = "0.1.38"
4
4
  description = "Shared utilities for Documente AI projects"
5
5
  authors = ["Tech <tech@llamitai.com>"]
6
6
  license = "MIT"