documente_shared 0.1.54b0__py3-none-any.whl → 0.1.55__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.

@@ -9,14 +9,16 @@ from documente_shared.domain.entities.document_metadata import DocumentProcessin
9
9
  from documente_shared.domain.enums import (
10
10
  DocumentProcessingStatus,
11
11
  DocumentProcessingSubCategory,
12
- DocumentProcessingCategory,
12
+ DocumentProcessingCategory, DocumentProcessingSource,
13
13
  )
14
14
 
15
+
15
16
  def remove_slash_from_path(path: str) -> str:
16
17
  if path and path.startswith('/'):
17
18
  return path[1:]
18
19
  return path
19
20
 
21
+
20
22
  @dataclass
21
23
  class DocumentProcessing(object):
22
24
  digest: str
@@ -25,6 +27,7 @@ class DocumentProcessing(object):
25
27
  file_bytes: Optional[bytes] = None
26
28
  category: Optional[DocumentProcessingCategory] = None
27
29
  sub_category: Optional[DocumentProcessingSubCategory] = None
30
+ uploaded_from: Optional[DocumentProcessingSource] = None
28
31
  processed_csv_path: Optional[str] = None
29
32
  processed_csv_bytes: Optional[bytes] = None
30
33
  processed_xlsx_path: Optional[str] = None
@@ -157,7 +160,6 @@ class DocumentProcessing(object):
157
160
  and self.completed_at == other.completed_at
158
161
  )
159
162
 
160
-
161
163
  @property
162
164
  def to_dict(self) -> dict:
163
165
  return {
@@ -172,6 +174,10 @@ class DocumentProcessing(object):
172
174
  str(self.sub_category)
173
175
  if self.sub_category else None
174
176
  ),
177
+ 'uploaded_from': (
178
+ str(self.uploaded_from)
179
+ if self.uploaded_from else None
180
+ ),
175
181
  'processed_csv_path': self.processed_csv_path,
176
182
  'processed_xlsx_path': self.processed_xlsx_path,
177
183
  'processed_json_path': self.processed_json_path,
@@ -212,6 +218,7 @@ class DocumentProcessing(object):
212
218
  'file_bytes',
213
219
  'category',
214
220
  'sub_category',
221
+ 'uploaded_from',
215
222
  'processed_csv_path',
216
223
  'processed_csv_bytes',
217
224
  'processed_xlsx_path',
@@ -251,6 +258,10 @@ class DocumentProcessing(object):
251
258
  DocumentProcessingSubCategory.from_value(data.get('sub_category'))
252
259
  if data.get('sub_category') else None
253
260
  ),
261
+ uploaded_from=(
262
+ DocumentProcessingSource.from_value(data.get('uploaded_from'))
263
+ if data.get('uploaded_from') else None
264
+ ),
254
265
  processed_csv_path=data.get('processed_csv_path'),
255
266
  processed_xlsx_path=data.get('processed_xlsx_path'),
256
267
  processed_json_path=data.get('processed_json_path'),
@@ -11,6 +11,7 @@ class DocumentProcessingStatus(BaseEnum):
11
11
  CANCELLED = 'CANCELLED'
12
12
  IN_REVIEW = 'IN_REVIEW'
13
13
 
14
+
14
15
  class DocumentProcessingCategory(BaseEnum):
15
16
  CIRCULAR = 'CIRCULAR'
16
17
  DESGRAVAMEN = 'DESGRAVAMEN'
@@ -24,6 +25,39 @@ class DocumentProcessingCategory(BaseEnum):
24
25
  return self == DocumentProcessingCategory.DESGRAVAMEN
25
26
 
26
27
 
28
+ class DocumentProcessingSource(BaseEnum):
29
+ AGENT_UI = 'AGENT_UI'
30
+ AGENT_CRAWLER = 'AGENT_CRAWLER'
31
+ PLATFORM_UI = 'PLATFORM_UI'
32
+ PLATFORM_API = 'PLATFORM_API'
33
+ AWS_CONSOLE = 'AWS_CONSOLE'
34
+ LOCAL_MANUAL = 'LOCAL_MANUAL'
35
+
36
+ @property
37
+ def is_agent_ui(self):
38
+ return self == DocumentProcessingSource.AGENT_UI
39
+
40
+ @property
41
+ def is_agent_crawler(self):
42
+ return self == DocumentProcessingSource.AGENT_CRAWLER
43
+
44
+ @property
45
+ def is_platform_ui(self):
46
+ return self == DocumentProcessingSource.PLATFORM_UI
47
+
48
+ @property
49
+ def is_platform_api(self):
50
+ return self == DocumentProcessingSource.PLATFORM_API
51
+
52
+ @property
53
+ def is_aws_console(self):
54
+ return self == DocumentProcessingSource.AWS_CONSOLE
55
+
56
+ @property
57
+ def is_local_manual(self):
58
+ return self == DocumentProcessingSource.LOCAL_MANUAL
59
+
60
+
27
61
  class DocumentProcessingSubCategory(BaseEnum):
28
62
  # Circulares
29
63
  CC_COMBINADA = 'CC_COMBINADA'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: documente_shared
3
- Version: 0.1.54b0
3
+ Version: 0.1.55
4
4
  Summary: Shared utilities for Documente AI projects
5
5
  License: MIT
6
6
  Author: Tech
@@ -8,15 +8,15 @@ documente_shared/domain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
8
8
  documente_shared/domain/base_enum.py,sha256=DojAfn-zQdtjtImeHUpBzE6TBTm07XrbMOdW3h8RVd8,1449
9
9
  documente_shared/domain/constants.py,sha256=jOlMKFq12FgiYMJcQHku8IVwuOE5t-HEPuSV_zEeIFo,56
10
10
  documente_shared/domain/entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- documente_shared/domain/entities/document.py,sha256=X8uEw7TCy5o87-kscok2CcH67exsE6BrRqs6L-SvuTg,10111
11
+ documente_shared/domain/entities/document.py,sha256=ZrtIzxS8SnMujYBCTURik4b0r1KsEPfGmBIH4QO0dog,10539
12
12
  documente_shared/domain/entities/document_metadata.py,sha256=Oa-c0xJODXaGtFkNxt9k86rSWGxY2LHVDOgu9tQxCGY,2354
13
- documente_shared/domain/enums.py,sha256=EA8RsuusX065Isp8qUTv9TPpWPkae6mbIC-yYENrkow,926
13
+ documente_shared/domain/enums.py,sha256=zdy3kRWfKVxc-4wv5TLdQl-AbZkwsXEqlUZppCsMlsY,1797
14
14
  documente_shared/domain/repositories.py,sha256=g3qLUy2kT8esmvU4VxxSVnDaXeySKKQ7mUvIvxOwh9A,757
15
15
  documente_shared/infrastructure/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  documente_shared/infrastructure/dynamo_repositories.py,sha256=SEad_HLppp2h_BKDSzb9oo1VlAVRZWelOPvJPlDwbzQ,1453
17
17
  documente_shared/infrastructure/dynamo_table.py,sha256=dK05KgFvIYCmOdMpq9-OV_OBrP6cCngiUikCJrxlwt4,2112
18
18
  documente_shared/infrastructure/s3_bucket.py,sha256=vT_yN42RFQXubtUn8ln-j13Os_-25UGClVtXg5Bkv6I,1932
19
19
  documente_shared/infrastructure/sqs_queue.py,sha256=PSiTAnjXvQ-W-9mzLpH2UjbQJTvYkMiaxNaMecF-cR4,1505
20
- documente_shared-0.1.54b0.dist-info/METADATA,sha256=X26yn3WiedJpJOzIwzdkIw9IIBg162aLmI_hsOFX2JM,802
21
- documente_shared-0.1.54b0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
22
- documente_shared-0.1.54b0.dist-info/RECORD,,
20
+ documente_shared-0.1.55.dist-info/METADATA,sha256=VTVTbWymdNgEYUd9Ylhnxrz1oecxpNVC9AWJ6d3l4QA,800
21
+ documente_shared-0.1.55.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
22
+ documente_shared-0.1.55.dist-info/RECORD,,