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

@@ -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
@@ -68,7 +68,8 @@ class DocumentProcess(object):
68
68
 
69
69
  @property
70
70
  def filename(self) -> str:
71
- return self.file_path.split('/')[-1]
71
+ filename_with_extension = self.file_path.split('/')[-1]
72
+ return filename_with_extension.split('.')[0]
72
73
 
73
74
  @property
74
75
  def to_dict(self) -> dict:
@@ -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[dict]:
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(file_name)['Body'].read()
50
+ def read(self, file_key: str) -> bytes:
51
+ return self.get(file_key)['Body'].read()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: documente_shared
3
- Version: 0.1.12
3
+ Version: 0.1.14
4
4
  Summary: Shared utilities for Documente AI projects
5
5
  License: MIT
6
6
  Author: Tech
@@ -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=GgsepilXNjGQ_Zdf_dE2OdNguD8EVKhqgyy5i2P5UY4,3891
4
+ documente_shared/domain/entities.py,sha256=1TFf8OcZwNmwqCFwIfI-U4QzJHpeDJ-z88gKzhGQR0s,3997
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=VqE1bVgi4R_mJkoDHk5whZxGwN27mINdV8Mg_-2Cz8I,1553
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.12.dist-info/METADATA,sha256=sTGvg9aNGMZAABOVF2cgzs5O5tVPfmasN0qMSoNQhuQ,640
13
- documente_shared-0.1.12.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
14
- documente_shared-0.1.12.dist-info/RECORD,,
12
+ documente_shared-0.1.14.dist-info/METADATA,sha256=gAxsMatjQ7SsuaOZ_TjJ_fmqhVBCaAhKOxHKoemuCcE,640
13
+ documente_shared-0.1.14.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
14
+ documente_shared-0.1.14.dist-info/RECORD,,