albert 1.9.3__py3-none-any.whl → 1.9.6__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.
- albert/__init__.py +1 -1
- albert/collections/custom_templates.py +3 -0
- albert/collections/data_templates.py +5 -0
- albert/collections/entity_types.py +19 -3
- albert/collections/parameters.py +1 -0
- albert/collections/property_data.py +3 -0
- albert/collections/reports.py +4 -0
- albert/collections/tasks.py +1 -0
- albert/collections/worksheets.py +3 -0
- {albert-1.9.3.dist-info → albert-1.9.6.dist-info}/METADATA +1 -1
- {albert-1.9.3.dist-info → albert-1.9.6.dist-info}/RECORD +13 -13
- {albert-1.9.3.dist-info → albert-1.9.6.dist-info}/WHEEL +0 -0
- {albert-1.9.3.dist-info → albert-1.9.6.dist-info}/licenses/LICENSE +0 -0
albert/__init__.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
from collections.abc import Iterator
|
|
2
2
|
|
|
3
|
+
from pydantic import validate_call
|
|
4
|
+
|
|
3
5
|
from albert.collections.base import BaseCollection
|
|
4
6
|
from albert.core.logging import logger
|
|
5
7
|
from albert.core.pagination import AlbertPaginator
|
|
@@ -28,6 +30,7 @@ class CustomTemplatesCollection(BaseCollection):
|
|
|
28
30
|
super().__init__(session=session)
|
|
29
31
|
self.base_path = f"/api/{CustomTemplatesCollection._api_version}/customtemplates"
|
|
30
32
|
|
|
33
|
+
@validate_call
|
|
31
34
|
def get_by_id(self, *, id: CustomTemplateId) -> CustomTemplate:
|
|
32
35
|
"""Get a Custom Template by ID
|
|
33
36
|
|
|
@@ -82,6 +82,7 @@ class DataTemplateCollection(BaseCollection):
|
|
|
82
82
|
else:
|
|
83
83
|
return self.add_parameters(data_template_id=dt.id, parameters=parameter_values)
|
|
84
84
|
|
|
85
|
+
@validate_call
|
|
85
86
|
def _add_param_enums(
|
|
86
87
|
self,
|
|
87
88
|
*,
|
|
@@ -195,6 +196,7 @@ class DataTemplateCollection(BaseCollection):
|
|
|
195
196
|
response = self.session.get(f"{self.base_path}/{id}")
|
|
196
197
|
return DataTemplate(**response.json())
|
|
197
198
|
|
|
199
|
+
@validate_call
|
|
198
200
|
def get_by_ids(self, *, ids: list[DataTemplateId]) -> list[DataTemplate]:
|
|
199
201
|
"""Get a list of data templates by their IDs.
|
|
200
202
|
|
|
@@ -234,6 +236,7 @@ class DataTemplateCollection(BaseCollection):
|
|
|
234
236
|
return t.hydrate()
|
|
235
237
|
return None
|
|
236
238
|
|
|
239
|
+
@validate_call
|
|
237
240
|
def add_data_columns(
|
|
238
241
|
self, *, data_template_id: DataTemplateId, data_columns: list[DataColumnValue]
|
|
239
242
|
) -> DataTemplate:
|
|
@@ -277,6 +280,7 @@ class DataTemplateCollection(BaseCollection):
|
|
|
277
280
|
)
|
|
278
281
|
return self.get_by_id(id=data_template_id)
|
|
279
282
|
|
|
283
|
+
@validate_call
|
|
280
284
|
def add_parameters(
|
|
281
285
|
self, *, data_template_id: DataTemplateId, parameters: list[ParameterValue]
|
|
282
286
|
) -> DataTemplate:
|
|
@@ -555,6 +559,7 @@ class DataTemplateCollection(BaseCollection):
|
|
|
555
559
|
)
|
|
556
560
|
return self.get_by_id(id=data_template.id)
|
|
557
561
|
|
|
562
|
+
@validate_call
|
|
558
563
|
def delete(self, *, id: DataTemplateId) -> None:
|
|
559
564
|
"""Deletes a data template by its ID.
|
|
560
565
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
from collections.abc import Iterator
|
|
2
2
|
|
|
3
|
+
from pydantic import validate_call
|
|
4
|
+
|
|
3
5
|
from albert.collections.base import BaseCollection
|
|
4
6
|
from albert.core.pagination import AlbertPaginator, PaginationMode
|
|
5
7
|
from albert.core.session import AlbertSession
|
|
@@ -41,6 +43,7 @@ class EntityTypeCollection(BaseCollection):
|
|
|
41
43
|
super().__init__(session=session)
|
|
42
44
|
self.base_path = f"/api/{EntityTypeCollection._api_version}/entitytypes"
|
|
43
45
|
|
|
46
|
+
@validate_call
|
|
44
47
|
def get_by_id(self, *, id: EntityTypeId) -> EntityType:
|
|
45
48
|
"""Get an entity type by its ID.
|
|
46
49
|
Parameters
|
|
@@ -115,8 +118,14 @@ class EntityTypeCollection(BaseCollection):
|
|
|
115
118
|
PatchDatum(
|
|
116
119
|
operation=PatchOperation.UPDATE,
|
|
117
120
|
attribute="customFields",
|
|
118
|
-
new_value=[
|
|
119
|
-
|
|
121
|
+
new_value=[
|
|
122
|
+
x.model_dump(by_alias=True, exclude_none=True)
|
|
123
|
+
for x in updated.custom_fields
|
|
124
|
+
],
|
|
125
|
+
old_value=[
|
|
126
|
+
x.model_dump(by_alias=True, exclude_none=True)
|
|
127
|
+
for x in existing.custom_fields
|
|
128
|
+
],
|
|
120
129
|
)
|
|
121
130
|
)
|
|
122
131
|
if updated.custom_fields is not None and existing.custom_fields is None:
|
|
@@ -124,7 +133,10 @@ class EntityTypeCollection(BaseCollection):
|
|
|
124
133
|
PatchDatum(
|
|
125
134
|
operation=PatchOperation.ADD,
|
|
126
135
|
attribute="customFields",
|
|
127
|
-
new_value=[
|
|
136
|
+
new_value=[
|
|
137
|
+
x.model_dump(by_alias=True, exclude_none=True)
|
|
138
|
+
for x in updated.custom_fields
|
|
139
|
+
],
|
|
128
140
|
)
|
|
129
141
|
)
|
|
130
142
|
|
|
@@ -194,6 +206,7 @@ class EntityTypeCollection(BaseCollection):
|
|
|
194
206
|
|
|
195
207
|
return patches
|
|
196
208
|
|
|
209
|
+
@validate_call
|
|
197
210
|
def delete(self, *, id: EntityTypeId) -> None:
|
|
198
211
|
"""Delete an entity type.
|
|
199
212
|
Parameters
|
|
@@ -203,6 +216,7 @@ class EntityTypeCollection(BaseCollection):
|
|
|
203
216
|
"""
|
|
204
217
|
self.session.delete(f"{self.base_path}/{id}")
|
|
205
218
|
|
|
219
|
+
@validate_call
|
|
206
220
|
def get_rules(self, *, id: EntityTypeId) -> list[EntityTypeRule]:
|
|
207
221
|
"""Get the rules for an entity type.
|
|
208
222
|
Parameters
|
|
@@ -213,6 +227,7 @@ class EntityTypeCollection(BaseCollection):
|
|
|
213
227
|
response = self.session.get(f"{self.base_path}/rules/{id}")
|
|
214
228
|
return [EntityTypeRule(**rule) for rule in response.json()]
|
|
215
229
|
|
|
230
|
+
@validate_call
|
|
216
231
|
def set_rules(self, *, id: EntityTypeId, rules: list[EntityTypeRule]) -> list[EntityTypeRule]:
|
|
217
232
|
"""Create or update the rules for an entity type.
|
|
218
233
|
Parameters
|
|
@@ -232,6 +247,7 @@ class EntityTypeCollection(BaseCollection):
|
|
|
232
247
|
)
|
|
233
248
|
return [EntityTypeRule(**rule) for rule in response.json()]
|
|
234
249
|
|
|
250
|
+
@validate_call
|
|
235
251
|
def delete_rules(self, *, id: EntityTypeId) -> None:
|
|
236
252
|
"""Delete the rules for an entity type.
|
|
237
253
|
Parameters
|
albert/collections/parameters.py
CHANGED
|
@@ -309,6 +309,7 @@ class PropertyDataCollection(BaseCollection):
|
|
|
309
309
|
)
|
|
310
310
|
return all_info
|
|
311
311
|
|
|
312
|
+
@validate_call
|
|
312
313
|
def _resolve_return_scope(
|
|
313
314
|
self,
|
|
314
315
|
*,
|
|
@@ -552,6 +553,7 @@ class PropertyDataCollection(BaseCollection):
|
|
|
552
553
|
lot_id=lot_id,
|
|
553
554
|
)
|
|
554
555
|
|
|
556
|
+
@validate_call
|
|
555
557
|
def bulk_load_task_properties(
|
|
556
558
|
self,
|
|
557
559
|
*,
|
|
@@ -675,6 +677,7 @@ class PropertyDataCollection(BaseCollection):
|
|
|
675
677
|
return_scope=return_scope,
|
|
676
678
|
)
|
|
677
679
|
|
|
680
|
+
@validate_call
|
|
678
681
|
def bulk_delete_task_data(
|
|
679
682
|
self,
|
|
680
683
|
*,
|
albert/collections/reports.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
from typing import Any
|
|
2
2
|
|
|
3
|
+
from pydantic import validate_call
|
|
4
|
+
|
|
3
5
|
from albert.collections.base import BaseCollection
|
|
4
6
|
from albert.core.session import AlbertSession
|
|
5
7
|
from albert.core.shared.identifiers import ReportId
|
|
@@ -136,6 +138,7 @@ class ReportCollection(BaseCollection):
|
|
|
136
138
|
input_data=input_data,
|
|
137
139
|
)
|
|
138
140
|
|
|
141
|
+
@validate_call
|
|
139
142
|
def get_full_report(self, *, report_id: ReportId) -> FullAnalyticalReport:
|
|
140
143
|
"""Get a full analytical report by its ID.
|
|
141
144
|
|
|
@@ -192,6 +195,7 @@ class ReportCollection(BaseCollection):
|
|
|
192
195
|
response = self.session.post(path, json=report_data)
|
|
193
196
|
return FullAnalyticalReport(**response.json())
|
|
194
197
|
|
|
198
|
+
@validate_call
|
|
195
199
|
def delete(self, *, id: ReportId) -> None:
|
|
196
200
|
"""Delete a report.
|
|
197
201
|
|
albert/collections/tasks.py
CHANGED
albert/collections/worksheets.py
CHANGED
|
@@ -48,6 +48,7 @@ class WorksheetCollection(BaseCollection):
|
|
|
48
48
|
response_json = self._add_session_to_sheets(response_json)
|
|
49
49
|
return Worksheet(**response_json)
|
|
50
50
|
|
|
51
|
+
@validate_call
|
|
51
52
|
def setup_worksheet(self, *, project_id: ProjectId, add_sheet=False) -> Worksheet:
|
|
52
53
|
"""Setup a new worksheet for a project.
|
|
53
54
|
|
|
@@ -69,6 +70,7 @@ class WorksheetCollection(BaseCollection):
|
|
|
69
70
|
self.session.post(path, json=params)
|
|
70
71
|
return self.get_by_project_id(project_id=project_id)
|
|
71
72
|
|
|
73
|
+
@validate_call
|
|
72
74
|
def setup_new_sheet_from_template(
|
|
73
75
|
self, *, project_id: ProjectId, sheet_template_id: str, sheet_name: str
|
|
74
76
|
) -> Worksheet:
|
|
@@ -94,6 +96,7 @@ class WorksheetCollection(BaseCollection):
|
|
|
94
96
|
self.session.post(path, json=payload, params=params)
|
|
95
97
|
return self.get_by_project_id(project_id=project_id)
|
|
96
98
|
|
|
99
|
+
@validate_call
|
|
97
100
|
def add_sheet(self, *, project_id: ProjectId, sheet_name: str) -> Worksheet:
|
|
98
101
|
"""Create a new blank sheet in the Worksheet with the specified name.
|
|
99
102
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: albert
|
|
3
|
-
Version: 1.9.
|
|
3
|
+
Version: 1.9.6
|
|
4
4
|
Summary: The official Python SDK for the Albert Invent platform.
|
|
5
5
|
Project-URL: Homepage, https://www.albertinvent.com/
|
|
6
6
|
Project-URL: Documentation, https://docs.developer.albertinvent.com/albert-python
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
albert/__init__.py,sha256=
|
|
1
|
+
albert/__init__.py,sha256=uF5xiIfWRVYm_cC_flb5-Eih5siMCUWKVJNKbt8eijo,238
|
|
2
2
|
albert/client.py,sha256=1BSaI5a_8AycVQgzwhack5CnaqfnHNQ6I18fbNAPluI,11857
|
|
3
3
|
albert/exceptions.py,sha256=-oxOJGE0A__aPUhri3qqb5YQ5qanECcTqamS73vGajM,3172
|
|
4
4
|
albert/collections/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -12,10 +12,10 @@ albert/collections/btmodel.py,sha256=fc30AAcqYxErtilsrc22GFh2wOUXBwA3vbtGmmAmbaE
|
|
|
12
12
|
albert/collections/cas.py,sha256=pi9rZVCj0-_Z4auoFJdIVtELubp728Q3lurVbOEkmhk,9252
|
|
13
13
|
albert/collections/companies.py,sha256=oUgO1TIu_CEhBe5ozrO5PzaAcEUuxiXmJDVPZl8ialw,8720
|
|
14
14
|
albert/collections/custom_fields.py,sha256=0jo7BFHS-9EkGB1SkIolYG4sSbpk7F-OUPLVQx580Z4,9907
|
|
15
|
-
albert/collections/custom_templates.py,sha256
|
|
15
|
+
albert/collections/custom_templates.py,sha256=08l_sMM1m3lqnmppKKtF8Ljoqu7ZYZhkR2fzA8NHEYI,4175
|
|
16
16
|
albert/collections/data_columns.py,sha256=WW7X6-oh8bS26oSWOtfRraQpNL-FkKfgCFHZA73Z5p0,6938
|
|
17
|
-
albert/collections/data_templates.py,sha256=
|
|
18
|
-
albert/collections/entity_types.py,sha256=
|
|
17
|
+
albert/collections/data_templates.py,sha256=wxROpenKxPgz3XwRgjmCT5uzdvkPIUFNQo9UUqOb16Q,23814
|
|
18
|
+
albert/collections/entity_types.py,sha256=T7oll3ajN0Ba7chRqORtzhbLoaIRlVllJ38SUpzq2vU,11337
|
|
19
19
|
albert/collections/files.py,sha256=ZOs_sud9uu3vSniU9SuXZiK5v1eLZYsAHURNBgmCHIQ,5276
|
|
20
20
|
albert/collections/hazards.py,sha256=uVrGci_aONTYpHCSHvLHsj2Xr4fBMTeiczEuhGouVxg,1161
|
|
21
21
|
albert/collections/inventory.py,sha256=GeQ7CEPdFvBnqxPgl8Gt25jX7uAv3KIaltsBDKJivtc,32146
|
|
@@ -26,24 +26,24 @@ albert/collections/lots.py,sha256=3ixur5xzqubIjIZkvwHM28CCDxKInuqMkJtbS5oOwWg,12
|
|
|
26
26
|
albert/collections/notebooks.py,sha256=MIMMx_NF6jBzraC5j8ML2mRmPQXjQNPx9N6aj_8yT4k,8556
|
|
27
27
|
albert/collections/notes.py,sha256=l5duv5mdlCiRSfAo3nqOzMOV8oJAnAtp4kjHYwapyWY,3099
|
|
28
28
|
albert/collections/parameter_groups.py,sha256=8j5X3WJ7dcLFVLdtM7xg-iZzTijK2GCrWKpMYZ3tp6g,8869
|
|
29
|
-
albert/collections/parameters.py,sha256=
|
|
29
|
+
albert/collections/parameters.py,sha256=buvW_2d2MvK0iadaFgaPt5ibJw3rGexXMO-AErlKgvs,6930
|
|
30
30
|
albert/collections/pricings.py,sha256=hrlNOwt3rdmDvdfAMwepTem6iTpo5h6mZzyDlaYIsPE,6089
|
|
31
31
|
albert/collections/product_design.py,sha256=hr3hijrNcE8OPFF5e-Ke2FB39KvyNz4CKoaN_UDj6s4,1855
|
|
32
32
|
albert/collections/projects.py,sha256=uny5tLjyoXocauCpTPSknhztOwuLgyzqqg335oHvVyo,9703
|
|
33
|
-
albert/collections/property_data.py,sha256=
|
|
33
|
+
albert/collections/property_data.py,sha256=2LmtAGXI6xfbxl0xKKFg3Y5A_wuJN6phqYBILVyYt8E,38618
|
|
34
34
|
albert/collections/report_templates.py,sha256=7Alsl-6zqbw_HQpDX89c-DjrpUk_3fb_jgAOMGk_8hU,2208
|
|
35
|
-
albert/collections/reports.py,sha256=
|
|
35
|
+
albert/collections/reports.py,sha256=GzlXO_HH5EMXzzrFruHZVMhTMMQ8Lh55P_xf0yXb-xo,6278
|
|
36
36
|
albert/collections/roles.py,sha256=Yeqy_1_YE7axxPuEj4crMrA0UmA_eyYxifkoHv9vDSs,2036
|
|
37
37
|
albert/collections/storage_classes.py,sha256=z0f9c8bMLlcf1TbLAGixYkyCs8ea-9E66Pwl8HDFAJk,779
|
|
38
38
|
albert/collections/storage_locations.py,sha256=Typ9eXyFRkEcXlLuqmMe1B9zmuCK68ppvsGoAq3UXpo,6103
|
|
39
39
|
albert/collections/substance.py,sha256=0nK6x-kPCxwybwFNhXQnihleSei9Fuwqcnjr_I7GqlA,3126
|
|
40
40
|
albert/collections/tags.py,sha256=ri5J8YNtBK5IkPCRuYfSUUR9I7FmQc6kfF3pF0UNoz0,7851
|
|
41
|
-
albert/collections/tasks.py,sha256=
|
|
41
|
+
albert/collections/tasks.py,sha256=YUhzySD_u8ngLNWxEGwJvAAHFlhY9Ur6DQ3xt5j8JNM,23856
|
|
42
42
|
albert/collections/un_numbers.py,sha256=C0RcmvUy0fOMZMe7s0cO1kAVHWArCvDNy3bPRyerAaw,3319
|
|
43
43
|
albert/collections/units.py,sha256=3KKfZKBUavu5nTEhyN9rAM2ibFUucpZzqbnXkNoCUlg,7347
|
|
44
44
|
albert/collections/users.py,sha256=A5LMsZkoeIZh8wqgmVQjRR38gCf1mCXxhW-WuXI3urc,8606
|
|
45
45
|
albert/collections/workflows.py,sha256=dY5q3DdBUCo6BL0vCK7Ls40AvRdZMSrmF1hLc-qJVBA,6645
|
|
46
|
-
albert/collections/worksheets.py,sha256=
|
|
46
|
+
albert/collections/worksheets.py,sha256=iZQ3KCMS7_HrFwdO3VVhovk5m1VkQiwOC-Vpgg3l_xE,3966
|
|
47
47
|
albert/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
48
48
|
albert/core/base.py,sha256=vG7O665y4ck51baipoWO71qHHmAS1zxYyNocRf3KcNY,426
|
|
49
49
|
albert/core/logging.py,sha256=sqNbIC3CZyaTyLnoV9mn0NCkxKH-jUNDJkAVMxgPSFY,820
|
|
@@ -111,7 +111,7 @@ albert/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
111
111
|
albert/utils/_auth.py,sha256=YjzaGIzI9qP53nwdyE2Ezs-9UokzA38kgdE7Sxnyjd8,124
|
|
112
112
|
albert/utils/_patch.py,sha256=VdMHpRdqTU9DNpXU7wndFRP-u4KEnVVrUpPr9dNriqs,22723
|
|
113
113
|
albert/utils/inventory.py,sha256=ViHxb62DVxniEJqOfD7Gf8HltLeCbq21y4rS1xkVRnY,5349
|
|
114
|
-
albert-1.9.
|
|
115
|
-
albert-1.9.
|
|
116
|
-
albert-1.9.
|
|
117
|
-
albert-1.9.
|
|
114
|
+
albert-1.9.6.dist-info/METADATA,sha256=TXqVHw28d-22M9kBy4gV8-IXUny0PRguajp2K5Buz6I,15395
|
|
115
|
+
albert-1.9.6.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
116
|
+
albert-1.9.6.dist-info/licenses/LICENSE,sha256=S7_vRdIhQmG7PmTlU8-BCCveuEcFZ6_3IUVdcoaJMuA,11348
|
|
117
|
+
albert-1.9.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|