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

@@ -1,7 +1,7 @@
1
1
  from dataclasses import dataclass
2
2
  from datetime import datetime
3
3
  from decimal import Decimal
4
- from typing import Optional
4
+ from typing import Optional, List
5
5
 
6
6
  from documente_shared.domain.enums import (
7
7
  DocumentProcessStatus,
@@ -23,7 +23,7 @@ class DocumentProcess(object):
23
23
  processed_xlsx_path: Optional[str] = None
24
24
  processed_xlsx_bytes: Optional[bytes] = None
25
25
  processing_time: Optional[Decimal] = None
26
- uploded_at: Optional[datetime] = None
26
+ uploaded_at: Optional[datetime] = None
27
27
  enqueued_at: Optional[datetime] = None
28
28
  started_at: Optional[datetime] = None
29
29
  failed_at: Optional[datetime] = None
@@ -101,13 +101,31 @@ class DocumentProcess(object):
101
101
  str(self.processing_time)
102
102
  if self.processing_time else None
103
103
  ),
104
- 'uploded_at': self.uploded_at.isoformat() if self.uploded_at else None,
104
+ 'uploaded_at': self.uploaded_at.isoformat() if self.uploaded_at else None,
105
105
  'enqueued_at': self.enqueued_at.isoformat() if self.enqueued_at else None,
106
106
  'started_at': self.started_at.isoformat() if self.started_at else None,
107
107
  'failed_at': self.failed_at.isoformat() if self.failed_at else None,
108
108
  'completed_at': self.completed_at.isoformat() if self.completed_at else None,
109
109
  }
110
110
 
111
+ def overload(
112
+ self,
113
+ new_instance: 'DocumentProcess',
114
+ properties: List[str] = None,
115
+ ):
116
+ instance_properties = properties or [
117
+ 'status', 'file_path', 'file_bytes', 'category', 'sub_category',
118
+ 'processed_csv_path', 'processed_csv_bytes', 'processed_xlsx_path',
119
+ 'processed_xlsx_bytes', 'processing_time', 'uploaded_at',
120
+ 'enqueued_at', 'started_at', 'failed_at', 'completed_at',
121
+ ]
122
+ for _property in instance_properties:
123
+ property_value = getattr(new_instance, _property)
124
+ if not hasattr(self, _property):
125
+ continue
126
+ setattr(self, _property, property_value)
127
+ return self
128
+
111
129
  @classmethod
112
130
  def from_dict(cls, data: dict) -> 'DocumentProcess':
113
131
  return cls(
@@ -128,9 +146,9 @@ class DocumentProcess(object):
128
146
  Decimal(data.get('processing_time'))
129
147
  if data.get('processing_time') else None
130
148
  ),
131
- uploded_at=(
132
- datetime.fromisoformat(data.get('uploded_at'))
133
- if data.get('uploded_at') else None
149
+ uploaded_at=(
150
+ datetime.fromisoformat(data.get('uploaded_at'))
151
+ if data.get('uploaded_at') else None
134
152
  ),
135
153
  enqueued_at=(
136
154
  datetime.fromisoformat(data.get('enqueued_at'))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: documente_shared
3
- Version: 0.1.17
3
+ Version: 0.1.18
4
4
  Summary: Shared utilities for Documente AI projects
5
5
  License: MIT
6
6
  Author: Tech
@@ -3,7 +3,7 @@ documente_shared/application/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NM
3
3
  documente_shared/application/digest.py,sha256=Um6E8WfFri2_lly4RFWydJyvSfPZGFcOX-opEOzDCWc,172
4
4
  documente_shared/domain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  documente_shared/domain/base_enum.py,sha256=DojAfn-zQdtjtImeHUpBzE6TBTm07XrbMOdW3h8RVd8,1449
6
- documente_shared/domain/entities.py,sha256=YPYVVwn-vq8A1xiRC9kfERk3CE36cG7HTkRsbWri3TM,5188
6
+ documente_shared/domain/entities.py,sha256=q3e4FU-SD8gKjvOpdYfoTO6Wpk7-30TEcrMt1nVVt3I,5924
7
7
  documente_shared/domain/enums.py,sha256=wrMpM-1KgXFkd-He-3onNcqR3Zf53Q-_axjXGjx7MIY,435
8
8
  documente_shared/domain/repositories.py,sha256=OJ6HKYx93RAHtj5M2uMk1P8cPdw7ubfhs1GMeUT_blU,540
9
9
  documente_shared/infrastructure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -11,6 +11,6 @@ documente_shared/infrastructure/dynamo_repositories.py,sha256=0bnDxw-fQglpXXg5E4
11
11
  documente_shared/infrastructure/dynamo_table.py,sha256=5yF5EVQkHTZe4tLYZsfEDS8tp_iorMlMjNu-qn3Oj9E,2095
12
12
  documente_shared/infrastructure/s3_bucket.py,sha256=s4VWcl0HK6uhjjZmKefOYW5A3Dx74R9KCuMmXQKUXnQ,1582
13
13
  documente_shared/infrastructure/sqs_queue.py,sha256=PSiTAnjXvQ-W-9mzLpH2UjbQJTvYkMiaxNaMecF-cR4,1505
14
- documente_shared-0.1.17.dist-info/METADATA,sha256=keoPKGD0e_OrqM4avuizzPx_jZdxhfnXJ0lOucLSB6c,640
15
- documente_shared-0.1.17.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
16
- documente_shared-0.1.17.dist-info/RECORD,,
14
+ documente_shared-0.1.18.dist-info/METADATA,sha256=SRkM4mCT6rY-KdKDYPBPddQcxj8wNv1wduJ9ZijOf18,640
15
+ documente_shared-0.1.18.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
16
+ documente_shared-0.1.18.dist-info/RECORD,,