documente_shared 0.1.12__tar.gz → 0.1.13__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: documente_shared
3
- Version: 0.1.12
3
+ Version: 0.1.13
4
4
  Summary: Shared utilities for Documente AI projects
5
5
  License: MIT
6
6
  Author: Tech
@@ -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[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
  [tool.poetry]
2
2
  name = "documente_shared"
3
- version = "0.1.12"
3
+ version = "0.1.13"
4
4
  description = "Shared utilities for Documente AI projects"
5
5
  authors = ["Tech <tech@llamitai.com>"]
6
6
  license = "MIT"