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

@@ -0,0 +1,3 @@
1
+ import pytz
2
+
3
+ la_paz_tz = pytz.timezone("America/La_Paz")
@@ -1,9 +1,10 @@
1
1
  from dataclasses import dataclass
2
- from datetime import datetime
2
+ from datetime import datetime, tzinfo
3
3
  from decimal import Decimal
4
4
  from typing import Optional, List
5
5
 
6
6
  from documente_shared.application.time_utils import get_datetime_from_data
7
+ from documente_shared.domain.constants import la_paz_tz
7
8
  from documente_shared.domain.entities.document_metadata import DocumentProcessingMetadata
8
9
  from documente_shared.domain.enums import (
9
10
  DocumentProcessingStatus,
@@ -79,22 +80,26 @@ class DocumentProcessing(object):
79
80
  DocumentProcessingStatus.FAILED,
80
81
  ]
81
82
 
82
- def enqueue(self):
83
+ def enqueue(self, timezone: tzinfo = la_paz_tz):
83
84
  self.status = DocumentProcessingStatus.ENQUEUED
84
- self.enqueued_at = datetime.now()
85
+ self.enqueued_at = datetime.now(tz=timezone)
85
86
 
86
- def processing(self):
87
+ def processing(self, timezone: tzinfo = la_paz_tz):
87
88
  self.status = DocumentProcessingStatus.PROCESSING
88
- self.started_at = datetime.now()
89
+ self.started_at = datetime.now(tz=timezone)
89
90
 
90
- def failed(self, error_message: Optional[str] = None):
91
+ def failed(
92
+ self,
93
+ error_message: Optional[str] = None,
94
+ timezone: tzinfo = la_paz_tz,
95
+ ):
91
96
  self.failed_reason = error_message
92
97
  self.status = DocumentProcessingStatus.FAILED
93
- self.failed_at = datetime.now()
98
+ self.failed_at = datetime.now(tz=timezone)
94
99
 
95
- def completed(self):
100
+ def completed(self, timezone: tzinfo = la_paz_tz):
96
101
  self.status = DocumentProcessingStatus.COMPLETED
97
- self.completed_at = datetime.now()
102
+ self.completed_at = datetime.now(tz=timezone)
98
103
 
99
104
  def deleted(self):
100
105
  self.status = DocumentProcessingStatus.DELETED
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: documente_shared
3
- Version: 0.1.50
3
+ Version: 0.1.51
4
4
  Summary: Shared utilities for Documente AI projects
5
5
  License: MIT
6
6
  Author: Tech
@@ -6,8 +6,9 @@ documente_shared/application/time_utils.py,sha256=XDH27cKgoTFO8ad1JgrxKaeT7sZ1fd
6
6
  documente_shared/application/timezone.py,sha256=NHpzTzOPD_fWQiJ4BrRqt_TIDs5XyB5ZMR7x8vUk8gQ,183
7
7
  documente_shared/domain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  documente_shared/domain/base_enum.py,sha256=DojAfn-zQdtjtImeHUpBzE6TBTm07XrbMOdW3h8RVd8,1449
9
+ documente_shared/domain/constants.py,sha256=jOlMKFq12FgiYMJcQHku8IVwuOE5t-HEPuSV_zEeIFo,56
9
10
  documente_shared/domain/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- documente_shared/domain/entities/document.py,sha256=HSRz_EpyLBg8icUjGjx2JQojAyiR5UBqzvaKobESz4M,9205
11
+ documente_shared/domain/entities/document.py,sha256=EMltckX1zCJ2JtGWOihzLZc9pJFtdbDJy9uEWrgmsnA,9464
11
12
  documente_shared/domain/entities/document_metadata.py,sha256=Oa-c0xJODXaGtFkNxt9k86rSWGxY2LHVDOgu9tQxCGY,2354
12
13
  documente_shared/domain/enums.py,sha256=l-u_Zka8TW5mpMabymtEkBCEdavermKZwPLY_hALJww,899
13
14
  documente_shared/domain/repositories.py,sha256=g3qLUy2kT8esmvU4VxxSVnDaXeySKKQ7mUvIvxOwh9A,757
@@ -16,6 +17,6 @@ documente_shared/infrastructure/dynamo_repositories.py,sha256=SEad_HLppp2h_BKDSz
16
17
  documente_shared/infrastructure/dynamo_table.py,sha256=dK05KgFvIYCmOdMpq9-OV_OBrP6cCngiUikCJrxlwt4,2112
17
18
  documente_shared/infrastructure/s3_bucket.py,sha256=vT_yN42RFQXubtUn8ln-j13Os_-25UGClVtXg5Bkv6I,1932
18
19
  documente_shared/infrastructure/sqs_queue.py,sha256=PSiTAnjXvQ-W-9mzLpH2UjbQJTvYkMiaxNaMecF-cR4,1505
19
- documente_shared-0.1.50.dist-info/METADATA,sha256=J2U35CtrlhdWteSL3VUeKZ-b_Phgc5n4hn6W2DJsERI,682
20
- documente_shared-0.1.50.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
21
- documente_shared-0.1.50.dist-info/RECORD,,
20
+ documente_shared-0.1.51.dist-info/METADATA,sha256=taAnvSh9EPgH53aMUXLGUvb6OTXwdtWRESjgq2o_s9g,682
21
+ documente_shared-0.1.51.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
22
+ documente_shared-0.1.51.dist-info/RECORD,,