documente_shared 0.1.12__py3-none-any.whl → 0.1.13__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.
- documente_shared/domain/entities.py +2 -2
- documente_shared/infrastructure/s3_bucket.py +6 -6
- {documente_shared-0.1.12.dist-info → documente_shared-0.1.13.dist-info}/METADATA +1 -1
- {documente_shared-0.1.12.dist-info → documente_shared-0.1.13.dist-info}/RECORD +5 -5
- {documente_shared-0.1.12.dist-info → documente_shared-0.1.13.dist-info}/WHEEL +0 -0
|
@@ -11,8 +11,8 @@ class DocumentProcess(object):
|
|
|
11
11
|
digest: str
|
|
12
12
|
status: DocumentProcessStatus
|
|
13
13
|
file_path: str
|
|
14
|
-
processed_csv_path: str
|
|
15
|
-
processed_xlsx_path: str
|
|
14
|
+
processed_csv_path: Optional[str] = None
|
|
15
|
+
processed_xlsx_path: Optional[str] = None
|
|
16
16
|
processing_time: Optional[Decimal] = None
|
|
17
17
|
enqueued_at: Optional[datetime] = None
|
|
18
18
|
started_at: Optional[datetime] = None
|
|
@@ -21,7 +21,7 @@ class S3Bucket(object):
|
|
|
21
21
|
except self._resource.meta.client.exceptions.NoSuchKey:
|
|
22
22
|
return None
|
|
23
23
|
|
|
24
|
-
def get_bytes(self, file_key: str) -> Optional[
|
|
24
|
+
def get_bytes(self, file_key: str) -> Optional[bytes]:
|
|
25
25
|
file_context = self.get(file_key)
|
|
26
26
|
if not file_context:
|
|
27
27
|
return None
|
|
@@ -31,21 +31,21 @@ class S3Bucket(object):
|
|
|
31
31
|
else None
|
|
32
32
|
)
|
|
33
33
|
|
|
34
|
-
def upload(self, file_key, file_content, content_type: Optional[str] = None):
|
|
34
|
+
def upload(self, file_key: str, file_content, content_type: Optional[str] = None):
|
|
35
35
|
optional_params = {'ContentType': content_type}
|
|
36
36
|
return self._resource.Object(self.bucket_name, file_key).put(
|
|
37
37
|
Body=file_content,
|
|
38
38
|
**remove_none_values(optional_params),
|
|
39
39
|
)
|
|
40
40
|
|
|
41
|
-
def delete(self, file_key):
|
|
41
|
+
def delete(self, file_key: str):
|
|
42
42
|
return self._resource.Object(self.bucket_name, file_key).delete()
|
|
43
43
|
|
|
44
|
-
def get_url(self, file_key):
|
|
44
|
+
def get_url(self, file_key: str):
|
|
45
45
|
return 'https://{bucket_url}.s3.amazonaws.com/{file_key}'.format(
|
|
46
46
|
bucket_url=self.bucket_name,
|
|
47
47
|
file_key=file_key,
|
|
48
48
|
)
|
|
49
49
|
|
|
50
|
-
def read(self, file_key):
|
|
51
|
-
return self.get(
|
|
50
|
+
def read(self, file_key: str) -> bytes:
|
|
51
|
+
return self.get(file_key)['Body'].read()
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
documente_shared/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
documente_shared/domain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
documente_shared/domain/base_enum.py,sha256=DojAfn-zQdtjtImeHUpBzE6TBTm07XrbMOdW3h8RVd8,1449
|
|
4
|
-
documente_shared/domain/entities.py,sha256=
|
|
4
|
+
documente_shared/domain/entities.py,sha256=T04VgTUyVC7i3RWVet4xm8ppEGneBshB-EuWu-4Whco,3925
|
|
5
5
|
documente_shared/domain/enums.py,sha256=o20YJClja9FQbbZhdfreGCWYwjd3AH7q2kIzV9wn2dw,251
|
|
6
6
|
documente_shared/domain/repositories.py,sha256=h_nArptP5Xh7Jrhden-Ii9rZQqzgLFHhuzj1p78LgmU,365
|
|
7
7
|
documente_shared/infrastructure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
8
|
documente_shared/infrastructure/dynamo_repositories.py,sha256=9t_ufQBSF7cJbeHYzfJABOQydj1HAvhI8UnqDEDPryA,532
|
|
9
9
|
documente_shared/infrastructure/dynamo_table.py,sha256=5yF5EVQkHTZe4tLYZsfEDS8tp_iorMlMjNu-qn3Oj9E,2095
|
|
10
|
-
documente_shared/infrastructure/s3_bucket.py,sha256=
|
|
10
|
+
documente_shared/infrastructure/s3_bucket.py,sha256=s4VWcl0HK6uhjjZmKefOYW5A3Dx74R9KCuMmXQKUXnQ,1582
|
|
11
11
|
documente_shared/infrastructure/sqs_queue.py,sha256=PSiTAnjXvQ-W-9mzLpH2UjbQJTvYkMiaxNaMecF-cR4,1505
|
|
12
|
-
documente_shared-0.1.
|
|
13
|
-
documente_shared-0.1.
|
|
14
|
-
documente_shared-0.1.
|
|
12
|
+
documente_shared-0.1.13.dist-info/METADATA,sha256=05tr_4-PveJ8iAITktHFT1Etk65tRTjhLLhrDtXSn-Y,640
|
|
13
|
+
documente_shared-0.1.13.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
14
|
+
documente_shared-0.1.13.dist-info/RECORD,,
|
|
File without changes
|