UncountablePythonSDK 0.0.15__py3-none-any.whl → 0.0.17__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 UncountablePythonSDK might be problematic. Click here for more details.
- {UncountablePythonSDK-0.0.15.dist-info → UncountablePythonSDK-0.0.17.dist-info}/METADATA +14 -1
- {UncountablePythonSDK-0.0.15.dist-info → UncountablePythonSDK-0.0.17.dist-info}/RECORD +57 -20
- {UncountablePythonSDK-0.0.15.dist-info → UncountablePythonSDK-0.0.17.dist-info}/top_level.txt +1 -0
- docs/.gitignore +1 -0
- docs/conf.py +52 -0
- docs/index.md +13 -0
- docs/justfile +12 -0
- docs/quickstart.md +19 -0
- docs/requirements.txt +7 -0
- docs/static/favicons/android-chrome-192x192.png +0 -0
- docs/static/favicons/android-chrome-512x512.png +0 -0
- docs/static/favicons/apple-touch-icon.png +0 -0
- docs/static/favicons/browserconfig.xml +9 -0
- docs/static/favicons/favicon-16x16.png +0 -0
- docs/static/favicons/favicon-32x32.png +0 -0
- docs/static/favicons/manifest.json +18 -0
- docs/static/favicons/mstile-150x150.png +0 -0
- docs/static/favicons/safari-pinned-tab.svg +32 -0
- docs/static/logo_blue.png +0 -0
- examples/create_entity.py +23 -16
- pkgs/argument_parser/argument_parser.py +13 -6
- pkgs/type_spec/actions_registry/__init__.py +0 -0
- pkgs/type_spec/actions_registry/__main__.py +108 -0
- pkgs/type_spec/actions_registry/emit_typescript.py +106 -0
- pkgs/type_spec/builder.py +4 -0
- pkgs/type_spec/emit_python.py +35 -1
- pkgs/type_spec/emit_typescript.py +6 -7
- pkgs/type_spec/value_spec/emit_python.py +1 -0
- type_spec/external/api/chemical/convert_chemical_formats.yaml +33 -0
- type_spec/external/api/entity/create_entities.yaml +1 -1
- type_spec/external/api/entity/create_entity.yaml +1 -1
- type_spec/external/api/recipe_links/create_recipe_link.yaml +25 -0
- type_spec/external/api/recipes/associate_recipe_as_input.yaml +19 -0
- type_spec/external/api/recipes/associate_recipe_as_lot.yaml +19 -0
- type_spec/external/api/recipes/create_recipe.yaml +35 -0
- type_spec/external/api/recipes/set_recipe_inputs.yaml +3 -0
- type_spec/external/api/recipes/set_recipe_metadata.yaml +19 -0
- uncountable/core/client.py +13 -14
- uncountable/integration/executors/script_executor.py +7 -6
- uncountable/types/__init__.py +20 -0
- uncountable/types/api/chemical/__init__.py +1 -0
- uncountable/types/api/chemical/convert_chemical_formats.py +50 -0
- uncountable/types/api/entity/create_entities.py +1 -1
- uncountable/types/api/entity/create_entity.py +1 -1
- uncountable/types/api/recipe_links/__init__.py +1 -0
- uncountable/types/api/recipe_links/create_recipe_link.py +39 -0
- uncountable/types/api/recipes/associate_recipe_as_input.py +35 -0
- uncountable/types/api/recipes/associate_recipe_as_lot.py +36 -0
- uncountable/types/api/recipes/create_recipe.py +41 -0
- uncountable/types/api/recipes/set_recipe_inputs.py +1 -0
- uncountable/types/api/recipes/set_recipe_metadata.py +36 -0
- uncountable/types/async_batch.py +23 -0
- uncountable/types/chemical_structure.py +27 -0
- uncountable/types/client_base.py +303 -2
- uncountable/types/identifier.py +54 -0
- uncountable/types/recipe_identifiers.py +62 -0
- {UncountablePythonSDK-0.0.15.dist-info → UncountablePythonSDK-0.0.17.dist-info}/WHEEL +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: UncountablePythonSDK
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.17
|
|
4
4
|
Summary: Uncountable SDK
|
|
5
5
|
Project-URL: Homepage, https://github.com/uncountableinc/uncountable-python-sdk
|
|
6
6
|
Project-URL: Repository, https://github.com/uncountableinc/uncountable-python-sdk.git
|
|
@@ -30,3 +30,16 @@ Requires-Dist: coverage[toml] >=6.5.0 ; extra == 'test'
|
|
|
30
30
|
Requires-Dist: pytest-cov >=4.1.0 ; extra == 'test'
|
|
31
31
|
Requires-Dist: pytest-xdist >=3.5.0 ; extra == 'test'
|
|
32
32
|
|
|
33
|
+
# Uncountable Python SDK
|
|
34
|
+
|
|
35
|
+
## Documentation
|
|
36
|
+
[https://uncountableinc.github.io/uncountable-python-sdk/](https://uncountableinc.github.io/uncountable-python-sdk/)
|
|
37
|
+
|
|
38
|
+
## Installation
|
|
39
|
+
|
|
40
|
+
Install from PyPI:
|
|
41
|
+
|
|
42
|
+
```console
|
|
43
|
+
pip install UncountablePythonSDK
|
|
44
|
+
```
|
|
45
|
+
|
|
@@ -1,10 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
docs/.gitignore,sha256=_ebkZUcwfvfnGEJ95rfj1lxoBNd6EE9ZvtOc7FsbfFE,7
|
|
2
|
+
docs/conf.py,sha256=_NTPzzM_NS92AWqpYdlNKQlTc-IEolfYYKLLHm6lFAk,1700
|
|
3
|
+
docs/index.md,sha256=eEdirX_Ds6ICTRtIS5iT4irCquHcQyKN7E4M5QP9T8A,257
|
|
4
|
+
docs/justfile,sha256=cvNcpb-ByPOF2aCrFlg3DDZBoYMx5W8xGdr13m9HcnI,215
|
|
5
|
+
docs/quickstart.md,sha256=3GuJ0MB1O5kjlsrgAmdSkDq0rYqATrYy-tzEHDy8H-c,422
|
|
6
|
+
docs/requirements.txt,sha256=jNFoVqyOwGZ4GToYiyoVeFFIzJTmXMLYbv5h2FU5Sr4,139
|
|
7
|
+
docs/static/logo_blue.png,sha256=SyYpMTVhhBbhF5Wl8lWaVwz-_p1MIR6dW6bVhufQRME,46708
|
|
8
|
+
docs/static/favicons/android-chrome-192x192.png,sha256=XoF-AhD55JlSBDGsEPJKfT_VeXT-awhwKyZnxLhrwvk,1369
|
|
9
|
+
docs/static/favicons/android-chrome-512x512.png,sha256=1S4xwY9YtJQ5ifFsZ-DOzssoyBYs0t9uwdOUmYx0Xso,3888
|
|
10
|
+
docs/static/favicons/apple-touch-icon.png,sha256=4qdKI-pFHxrot00cFGY-_jD7Kame6Ct_klQBNmW3j80,1403
|
|
11
|
+
docs/static/favicons/browserconfig.xml,sha256=oU7ZjY1qKLU992MIOAOZ7h-uVyqmEah2TKzyae4Uw0s,263
|
|
12
|
+
docs/static/favicons/favicon-16x16.png,sha256=M4r4A3_NVuw3h5pWZs5-CmhmquSMiKaNcCqyyJRjNmU,392
|
|
13
|
+
docs/static/favicons/favicon-32x32.png,sha256=U4UU652zGnSeU3P9kUqxPeEnVf6zhtdNdNwGz1E40UU,511
|
|
14
|
+
docs/static/favicons/manifest.json,sha256=6q_3nZkcg_x0xut4eE-xpdeMY1TydwiZIcbXlLAq9X8,437
|
|
15
|
+
docs/static/favicons/mstile-150x150.png,sha256=eAK4QdEofhdLtfmjuPTpnX3MJqYnvGXsHYUjlcQekyY,1035
|
|
16
|
+
docs/static/favicons/safari-pinned-tab.svg,sha256=S84fRnz0ZxLnQrKtmmFZytiRyu1xLtMR_RVy5jmwU7k,1926
|
|
17
|
+
examples/create_entity.py,sha256=54AmZt83EpypxGcYZSIMmWlGz2oAgHFOsKuLSZOcHsI,625
|
|
2
18
|
examples/recipe-import/importer.py,sha256=baD71xuNibxDTe3bGHsMEIZEf9Xtb-IumBNpCEV0RZU,1134
|
|
3
19
|
pkgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
20
|
pkgs/argument_parser/__init__.py,sha256=CsQ6QoPKSLLRVl-z6URAmPkiUL9ZPZoV4rJHgy_-RjA,385
|
|
5
21
|
pkgs/argument_parser/_is_enum.py,sha256=bwX2lOmhv28hWLY4rf4eS_saOBq2fhcmruGLuw5rIzU,264
|
|
6
22
|
pkgs/argument_parser/_is_namedtuple.py,sha256=Rjc1bKanIPPogl3qG5JPBxglG1TqWYOo1nxxhBASQWY,265
|
|
7
|
-
pkgs/argument_parser/argument_parser.py,sha256=
|
|
23
|
+
pkgs/argument_parser/argument_parser.py,sha256=XaxN0d8v_F5dl3pZK_lMm9DhEDbYQfR6xbxnQOagcQw,14768
|
|
8
24
|
pkgs/argument_parser/case_convert.py,sha256=J9wahIE-P95LvTqn4M4gDUx_RXeiW2SRo9i_1bz1E6A,558
|
|
9
25
|
pkgs/serialization/__init__.py,sha256=quvXMSl1szddLTr4Yxo9KA9oBMoeX7qGpFkkAplFBbY,603
|
|
10
26
|
pkgs/serialization/missing_sentry.py,sha256=aM_9KxbCk9dVvXvcOKgkIQBqFWvLhv8QlIUCiuFEXMo,806
|
|
@@ -17,18 +33,21 @@ pkgs/strenum_compat/__init__.py,sha256=wXRFeNvBm8RU6dy1PFJ5sRLgUIEeH_DVR95Sv5qpG
|
|
|
17
33
|
pkgs/strenum_compat/strenum_compat.py,sha256=vGJlrMZpOqiGXvv21IbS0amdB2xQ2CdYKvnfEfHLr8E,156
|
|
18
34
|
pkgs/type_spec/__init__.py,sha256=h5DmJTca4QVV10sZR1x0-MlkZfuGYDfapR3zHvXfzto,19
|
|
19
35
|
pkgs/type_spec/__main__.py,sha256=5bJaX9Y_-FavP0qwzhk-z-V97UY7uaezJTa1zhO_HHQ,1048
|
|
20
|
-
pkgs/type_spec/builder.py,sha256=
|
|
36
|
+
pkgs/type_spec/builder.py,sha256=s_OPjN3Gg1Ljxs_U2UUb-9l0C8SFkDTfRDB2B8dkeI4,39138
|
|
21
37
|
pkgs/type_spec/config.py,sha256=wXALehQr_CcteOY_KbeI3rtmGgqVzHcveAhgKCDfQoQ,4934
|
|
22
38
|
pkgs/type_spec/emit_io_ts.py,sha256=gCEfS81w_ifqjLVJ3_cpy9Gq03o6H5nEsh35WAkqGGE,5606
|
|
23
39
|
pkgs/type_spec/emit_open_api.py,sha256=dnGazdVBjdEWQ4WK8Ujq966quRZY2TyQ05PGR48Md2I,17461
|
|
24
40
|
pkgs/type_spec/emit_open_api_util.py,sha256=xnzPOuPO8Pbhf6xf1tkHUKgXs1n-jH-lWFac8pOtd4I,1882
|
|
25
|
-
pkgs/type_spec/emit_python.py,sha256=
|
|
26
|
-
pkgs/type_spec/emit_typescript.py,sha256=
|
|
41
|
+
pkgs/type_spec/emit_python.py,sha256=wtwfIy14dloej5UJ4hDWcO7nyFZ-U-Zkc0gR6HyKHNA,36619
|
|
42
|
+
pkgs/type_spec/emit_typescript.py,sha256=lfddBy3_SDwfZr_4lPStS-cxL51_YFn9jo05rQ4fnwQ,17512
|
|
27
43
|
pkgs/type_spec/emit_typescript_util.py,sha256=MZMigIsYIYOXLjJqp-DSRYsztWbIKd9QQEmYRRqnGQ4,894
|
|
28
44
|
pkgs/type_spec/load_types.py,sha256=LMIkrk0n-Kh4I4CUOBzuboYtsAHBYuMrL9d2hkU83f4,2184
|
|
29
45
|
pkgs/type_spec/open_api_util.py,sha256=kOxDc1P4dgjWRxOQNNRtayUEHiHcxbc4OGzBsCWsKsM,7462
|
|
30
46
|
pkgs/type_spec/test.py,sha256=4ueujBq-pEgnX3Z69HyPmD-bullFXmpixcpVzfOkhP4,489
|
|
31
47
|
pkgs/type_spec/util.py,sha256=pTV9EB4_M0tucWwape9_1m5maIi3UKPw44SA_Mc8KNA,4856
|
|
48
|
+
pkgs/type_spec/actions_registry/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
49
|
+
pkgs/type_spec/actions_registry/__main__.py,sha256=anN0zAg1Np6b8h59VNXZf1IBxiNX8XDFATSIO_o0WHk,3489
|
|
50
|
+
pkgs/type_spec/actions_registry/emit_typescript.py,sha256=oOn35czuoFazM9Njx6H8qN1khcOwT5fn3TWzsK-4tsk,3841
|
|
32
51
|
pkgs/type_spec/parts/base.py.prepart,sha256=2RsjF9nTwERb7M0LKsPjGbN5cL2QMwMVt4QHpUPPM70,2147
|
|
33
52
|
pkgs/type_spec/parts/base.ts.prepart,sha256=2FJJvpg2olCcavxj0nbYWdwKl6KeScour2JjSvN42l8,1001
|
|
34
53
|
pkgs/type_spec/type_info/__main__.py,sha256=pmVjVqXyVh8vKTNCTFgz80Sg74C5BKToP3E6GS-X_So,857
|
|
@@ -36,11 +55,12 @@ pkgs/type_spec/type_info/emit_type_info.py,sha256=xWcZsgdEwApqqvtinZXyyBM61FZ9rm
|
|
|
36
55
|
pkgs/type_spec/value_spec/__init__.py,sha256=Z-grlcZtxAfEXhPHsK0nD7PFLGsv4eqvunaPN7_TA84,83
|
|
37
56
|
pkgs/type_spec/value_spec/__main__.py,sha256=syggR7J5MjFiULgPKcwb1T9u6eEyJUm9UlkIwP8V5IU,8300
|
|
38
57
|
pkgs/type_spec/value_spec/convert_type.py,sha256=SAYyEV6orQJJbkXSE4hhtOQJ2vKUXJCKPeYPrB8G9oA,2272
|
|
39
|
-
pkgs/type_spec/value_spec/emit_python.py,sha256=
|
|
58
|
+
pkgs/type_spec/value_spec/emit_python.py,sha256=rjg6LIGYdaagrZ19XpDfW_Z7LPNwCMDceBje5dsMFbw,6959
|
|
40
59
|
pkgs/type_spec/value_spec/types.py,sha256=a2zxbbCRWepY1l8OtjeCDKgBKFPFHVgV99oP6pTtaro,441
|
|
41
60
|
type_spec/external/api/batch/execute_batch.yaml,sha256=gpdSev3sLEC_cMVSZdj-9bc_XDFDqdPdOII9Ojme2N8,1170
|
|
42
|
-
type_spec/external/api/
|
|
43
|
-
type_spec/external/api/entity/
|
|
61
|
+
type_spec/external/api/chemical/convert_chemical_formats.yaml,sha256=EidTxMCRs-ko5yMFDptJPyAEWYZVruP41OG3cwyBLQQ,1069
|
|
62
|
+
type_spec/external/api/entity/create_entities.yaml,sha256=l24aCHcKD3rnCOIREL3B1th0NXUahSO-thWWBvTEx3Y,1144
|
|
63
|
+
type_spec/external/api/entity/create_entity.yaml,sha256=BjnJC7U_RW063B4E2tg6aXXLpLredrtSHMBNnJobkxE,1339
|
|
44
64
|
type_spec/external/api/entity/get_entities_data.yaml,sha256=3XujG7bOpuBQlfFrYtG3L4fBk7LsmdSekmP9iU0zjF0,796
|
|
45
65
|
type_spec/external/api/entity/list_entities.yaml,sha256=H2YVv6il-XVKd_7IipZqauTDvWCrvHok7z47bDH2sI4,1798
|
|
46
66
|
type_spec/external/api/entity/resolve_entity_ids.yaml,sha256=Zf3OhAohwLJO7wWj0e-sK5lhIsXlD8A5Bu3OGjY4-tA,732
|
|
@@ -56,7 +76,11 @@ type_spec/external/api/outputs/get_output_names.yaml,sha256=IqEYCOHeyHIu45Lf37sf
|
|
|
56
76
|
type_spec/external/api/outputs/resolve_output_conditions.yaml,sha256=lGrG6XPGiQtHx24GccPcO18xxAoMynTSC_2WwxCjFrc,1640
|
|
57
77
|
type_spec/external/api/project/get_projects.yaml,sha256=pQXGGPHenmFWYUuzEmZ-ORf0_d6lpQkTrXXMRrEqvDI,1676
|
|
58
78
|
type_spec/external/api/project/get_projects_data.yaml,sha256=8xQoyL8HlAropfZPYYcQ-W4fO4yuqueAWTKxRzTXAa0,1981
|
|
79
|
+
type_spec/external/api/recipe_links/create_recipe_link.yaml,sha256=7b2p7Ei4LnQXqccHsOVAfYyNK4WXm0n1IqxPG-qQDh0,941
|
|
59
80
|
type_spec/external/api/recipe_metadata/get_recipe_metadata_data.yaml,sha256=mJs82Ci8XSp2ng0W9MKqoeYwIjjgaVYmC5MWFmWFkR8,1759
|
|
81
|
+
type_spec/external/api/recipes/associate_recipe_as_input.yaml,sha256=pX6XCiBlsCiGPHTLW3GP1FkB2NLnLBqZlp6W8hKuym4,486
|
|
82
|
+
type_spec/external/api/recipes/associate_recipe_as_lot.yaml,sha256=8wzeJg5njt4qG2kavA6Jpo9PkWE6rIbuA4IPNdhcwEg,605
|
|
83
|
+
type_spec/external/api/recipes/create_recipe.yaml,sha256=1yQx3l4VKEEXtQ72zo8z3n4ofr7OvVmbqLc3N5q3T60,1133
|
|
60
84
|
type_spec/external/api/recipes/create_recipes.yaml,sha256=eXMlXRpB5TFt1mUTECBa4aAIG3KrxYT2mJ5vxmZ9Q3A,1503
|
|
61
85
|
type_spec/external/api/recipes/get_curve.yaml,sha256=QFRFst1EJ6T13G9R07kTiz-wvfxgDKbwHbmjgcvEaNc,568
|
|
62
86
|
type_spec/external/api/recipes/get_recipe_calculations.yaml,sha256=ZE7PzfWrjS7TiO4q7iyCwEj5In8GwO6fFIYGqUlTEXo,1240
|
|
@@ -64,12 +88,13 @@ type_spec/external/api/recipes/get_recipe_links.yaml,sha256=Vwm0OVWl3VvDaI7chY_o
|
|
|
64
88
|
type_spec/external/api/recipes/get_recipe_names.yaml,sha256=4tqcVj-xLeEu0lhdm8NpLYmAvfkmq08GZ0Mr59I5nLI,896
|
|
65
89
|
type_spec/external/api/recipes/get_recipe_output_metadata.yaml,sha256=YImW94JXVKR6Wz_7R7sRbhD9Ul51Ba-j-x9vJB__AAU,1216
|
|
66
90
|
type_spec/external/api/recipes/get_recipes_data.yaml,sha256=motc7yhI104V1TsMD9W_WdeTKNWLQwcuOeftAWAxnpE,11541
|
|
67
|
-
type_spec/external/api/recipes/set_recipe_inputs.yaml,sha256=
|
|
91
|
+
type_spec/external/api/recipes/set_recipe_inputs.yaml,sha256=xgS6L3jUsXiZGOPeIaPQUhpy4eq_MAzEpfGEk0sSkYQ,1638
|
|
92
|
+
type_spec/external/api/recipes/set_recipe_metadata.yaml,sha256=XLVwhBSkhbomXYD4AboBEVQt4vBhibvjmWQsDFS10sc,543
|
|
68
93
|
type_spec/external/api/recipes/set_recipe_outputs.yaml,sha256=Oe8XGYXbPNmrbEDXk3qucfS1L3P9TnXI5cxaNAl6x5A,1875
|
|
69
94
|
uncountable/__init__.py,sha256=281cC2hs8pbrD0jVKMol-tbWSh7Zcsc8oRT42dKteyE,102
|
|
70
95
|
uncountable/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
71
96
|
uncountable/core/__init__.py,sha256=GCXRRhhYv-yKzqKjAij7GcNiOr90BBbgdhhpusWtmUc,100
|
|
72
|
-
uncountable/core/client.py,sha256=
|
|
97
|
+
uncountable/core/client.py,sha256=PWHdiUmLzwxZkw8Refh2ArFi-o4rADJyHSsJdNX7_N4,4113
|
|
73
98
|
uncountable/integration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
74
99
|
uncountable/integration/construct_client.py,sha256=r6M5pnIO0fKcjf5d_AREPtWZ6AkWgcjkdu_jHQEYlT8,1084
|
|
75
100
|
uncountable/integration/cron.py,sha256=TIPqMPMSMtMJTu4aXwLf6QY-OLrpmyITLDp48UIr4Ok,919
|
|
@@ -80,20 +105,24 @@ uncountable/integration/types.py,sha256=n9idu2_qHOA5CQdE6NK8HS6aZ8ugTZKTfTTnm4sy
|
|
|
80
105
|
uncountable/integration/db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
81
106
|
uncountable/integration/db/connect.py,sha256=iI9e8a2hfbFP-dvH0MGLsrG-RpM0dHKCL-oCLkah9hs,181
|
|
82
107
|
uncountable/integration/executors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
83
|
-
uncountable/integration/executors/script_executor.py,sha256=
|
|
84
|
-
uncountable/types/__init__.py,sha256=
|
|
108
|
+
uncountable/integration/executors/script_executor.py,sha256=6oMPAFe0PUdqt76e8jMi4vXszGVsVHLULob7Qbl3o38,816
|
|
109
|
+
uncountable/types/__init__.py,sha256=OzhmRWjGxW-BRuugTyFJS12h-2_75ihzN1kENB8u8Lc,4792
|
|
110
|
+
uncountable/types/async_batch.py,sha256=ndEJORehBusfM9QkQTf-oOqvNjgjdULyLucNd3edvvc,629
|
|
85
111
|
uncountable/types/base.py,sha256=7yMC3sCQ13wd92896Ga2XbZffCqq98SKv09rFGb1ulg,2682
|
|
86
112
|
uncountable/types/calculations.py,sha256=16J-KKMp-I8ZQUkYNmKCHfAn6DGb99cFinALcDIdGHY,562
|
|
87
|
-
uncountable/types/
|
|
113
|
+
uncountable/types/chemical_structure.py,sha256=zQKl53DGtQQONIUHFXuwjWLQaG7FPZY7x6SBSOzkGV0,758
|
|
114
|
+
uncountable/types/client_base.py,sha256=m6chGEKvWw4hqT3KrORbMBCUwqnNVEJnYECCWEtLndE,37635
|
|
88
115
|
uncountable/types/curves.py,sha256=qYyRntMmFNonEwTrGhquMLbgMqjyP1moQflNTP0FMec,1308
|
|
89
116
|
uncountable/types/entity.py,sha256=NjMZrqBwQ7sZe_oUuJqy9IEG7dWZmFMkQQXJ0_odcnA,11637
|
|
90
117
|
uncountable/types/experiment_groups.py,sha256=ZBEk06F4n98Jz3oEA09WaDmw5rqPs7iVAm_Ysr4gc_o,599
|
|
91
118
|
uncountable/types/field_values.py,sha256=2unBAeBqQPqLQKaL6nGpnDDksZ-5MZepgEF3sgy6oOk,1670
|
|
92
119
|
uncountable/types/fields.py,sha256=eGtZ6axTYGFxLmPAyri2LwlcR4SZ2sX2c6QDX0ybKz0,570
|
|
120
|
+
uncountable/types/identifier.py,sha256=O_J3sHsG3pFeSIxUKmgIK97FZl6f4qkRDwsNLvY7ymE,1389
|
|
93
121
|
uncountable/types/input_attributes.py,sha256=u-JABoZ-Ij1Ynq5g6MxOgRdQeYbM7OnGP2q_N7KuVdw,826
|
|
94
122
|
uncountable/types/inputs.py,sha256=q7fNGaSKIk3R6uXCEhSQpiHvXu82YcK3oZHDI7bxE88,1597
|
|
95
123
|
uncountable/types/outputs.py,sha256=hSUlu41sisYKIZpPrj1G1DRfKm6hsKNcd1eNKFYb-4w,671
|
|
96
124
|
uncountable/types/phases.py,sha256=eaqwQlSRC2Ug7YFL0gqLbg3wDDHeRvBOhcABG7khW8c,550
|
|
125
|
+
uncountable/types/recipe_identifiers.py,sha256=uJ_1xRSYa02AwGi0gxDHqoQoI0tu1KW5AzTAXwnr9Nc,1768
|
|
97
126
|
uncountable/types/recipe_links.py,sha256=RldSV7SdeBYa0bx02DzMg4jfPdgrlMRE40T16Fdy8u4,1406
|
|
98
127
|
uncountable/types/recipe_metadata.py,sha256=NpRnz9QO2t21eTyf-M9_HBdQzcd55OgFM1dx6ZEg22w,1341
|
|
99
128
|
uncountable/types/recipe_output_metadata.py,sha256=XJA8R1r4NTzyR_DhMkmH4ZtYD-vqpvBMji9Be8OcFmo,613
|
|
@@ -105,9 +134,11 @@ uncountable/types/workflows.py,sha256=JJKM0SeDqAMA2oxwzlG1c1FxeSBI7E49duoITcUrEZ
|
|
|
105
134
|
uncountable/types/api/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
|
|
106
135
|
uncountable/types/api/batch/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
|
|
107
136
|
uncountable/types/api/batch/execute_batch.py,sha256=cCZo_akwJR4_ET6oOBChdlrCQlxUw8V9i8tDpv7JTIc,1696
|
|
137
|
+
uncountable/types/api/chemical/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
|
|
138
|
+
uncountable/types/api/chemical/convert_chemical_formats.py,sha256=COGzkfpTL_Ermg2cbasoVKGAxDAtJaTFay18IZtrWCA,1305
|
|
108
139
|
uncountable/types/api/entity/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
|
|
109
|
-
uncountable/types/api/entity/create_entities.py,sha256=
|
|
110
|
-
uncountable/types/api/entity/create_entity.py,sha256=
|
|
140
|
+
uncountable/types/api/entity/create_entities.py,sha256=fJn6mgRfPjmt_fFd4IjsaxnXJtbP6fyxVSidprC3zxE,1550
|
|
141
|
+
uncountable/types/api/entity/create_entity.py,sha256=KT-V2ePz-V1aPrKbkVhuR7tb0G2SfAn7ug6C3ZJCJAs,1720
|
|
111
142
|
uncountable/types/api/entity/get_entities_data.py,sha256=XjrJGZucIn1TYUlDLRnRA0JTQw-vXHIAT-m0H9hk37A,1170
|
|
112
143
|
uncountable/types/api/entity/list_entities.py,sha256=_bIIZJj3N0E6YiHgqzfCOKxD1fQW6biWJQMp5wIVbBw,1514
|
|
113
144
|
uncountable/types/api/entity/resolve_entity_ids.py,sha256=AidGpPmI9ATDv0E7vd9LDOl3n3beGxUlRojh5uZrkl4,1086
|
|
@@ -127,9 +158,14 @@ uncountable/types/api/outputs/resolve_output_conditions.py,sha256=XZqUseXcGhApHm
|
|
|
127
158
|
uncountable/types/api/project/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
|
|
128
159
|
uncountable/types/api/project/get_projects.py,sha256=dMPq8CHxE4k1Vs42TmC4dp9b1jYp0TPlkICacAqrwXQ,1235
|
|
129
160
|
uncountable/types/api/project/get_projects_data.py,sha256=HtUI5YN7S24v7o2VvNBWZkYFnGjFqJzBNoV0ojRx39E,1491
|
|
161
|
+
uncountable/types/api/recipe_links/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
|
|
162
|
+
uncountable/types/api/recipe_links/create_recipe_link.py,sha256=1Ok6XMGFKBIPV-uRsjvclEMCcAqyNVyrVLASLaJ8UrU,1213
|
|
130
163
|
uncountable/types/api/recipe_metadata/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
|
|
131
164
|
uncountable/types/api/recipe_metadata/get_recipe_metadata_data.py,sha256=el6Pn5XqExX66ZEEHM8CHPxnyXSMZPdfdvLBz86sAVY,1267
|
|
132
165
|
uncountable/types/api/recipes/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
|
|
166
|
+
uncountable/types/api/recipes/associate_recipe_as_input.py,sha256=Mo-J2DgwZpbzjS-8pOBvX2VuRfGqnboJXMvFyIzwiPs,880
|
|
167
|
+
uncountable/types/api/recipes/associate_recipe_as_lot.py,sha256=bTYjbnY3B7GKz4MV4UGn7vPjaqMkAfUTio8872d4iws,955
|
|
168
|
+
uncountable/types/api/recipes/create_recipe.py,sha256=PlaUAIjxYUbwV-dP7UUuroRMOLLt84Ac0Th1Dcdm4Ks,1226
|
|
133
169
|
uncountable/types/api/recipes/create_recipes.py,sha256=qwIYa8hfcjY7_VOFt9lxmVtJ-HOJqQN3GDNSbZsRCZU,1544
|
|
134
170
|
uncountable/types/api/recipes/get_curve.py,sha256=lF8MDmBfxm_cIuDxhE80viSFNbcPEkgYkadNFeuI5e4,854
|
|
135
171
|
uncountable/types/api/recipes/get_recipe_calculations.py,sha256=eQmkdZzCEuq8S2f_kf_7GPvDLX1pTnY1CRmkK0SkMCI,1472
|
|
@@ -137,9 +173,10 @@ uncountable/types/api/recipes/get_recipe_links.py,sha256=hk5dfQjv7yU2r-S9b8vwWEJ
|
|
|
137
173
|
uncountable/types/api/recipes/get_recipe_names.py,sha256=uCpXZq5oWjr9a_Vf-yYPaVS72XOlLHgAlju6KHeQ3UA,986
|
|
138
174
|
uncountable/types/api/recipes/get_recipe_output_metadata.py,sha256=L9s2ykPP4pd02Pc98LDisY8bgV8CToS6t6fXKTWqGRw,1464
|
|
139
175
|
uncountable/types/api/recipes/get_recipes_data.py,sha256=dOKokz6rJp3AiqNrF8rAZFlmJSs3ejdNIJhwKw0Utr0,5317
|
|
140
|
-
uncountable/types/api/recipes/set_recipe_inputs.py,sha256=
|
|
176
|
+
uncountable/types/api/recipes/set_recipe_inputs.py,sha256=7Mh-Hav6jYqZ9TRMAPWlAsn6Z0p8p2iAFLW_IHVFc7M,1385
|
|
177
|
+
uncountable/types/api/recipes/set_recipe_metadata.py,sha256=Ba6ttd1JuS_Ypt-KpckSviWtOcQ-OTdTEJiaSYyoQL8,933
|
|
141
178
|
uncountable/types/api/recipes/set_recipe_outputs.py,sha256=QYq39TNchQ80ET1C77OE9fwhbu_HmIoEDmrQJHkkCu0,1609
|
|
142
|
-
UncountablePythonSDK-0.0.
|
|
143
|
-
UncountablePythonSDK-0.0.
|
|
144
|
-
UncountablePythonSDK-0.0.
|
|
145
|
-
UncountablePythonSDK-0.0.
|
|
179
|
+
UncountablePythonSDK-0.0.17.dist-info/METADATA,sha256=5uVmAakSJWcMi2_LkzMCrfX1X5_Qj7ApQ2fVmK-hlqE,1545
|
|
180
|
+
UncountablePythonSDK-0.0.17.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
181
|
+
UncountablePythonSDK-0.0.17.dist-info/top_level.txt,sha256=HaMiBnH1wA7SG9-RVHIJPBH3l8X5gee2jUf-77Nz-Dk,41
|
|
182
|
+
UncountablePythonSDK-0.0.17.dist-info/RECORD,,
|
docs/.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
_build
|
docs/conf.py
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Configuration file for the Sphinx documentation builder.
|
|
2
|
+
#
|
|
3
|
+
# For the full list of built-in configuration values, see the documentation:
|
|
4
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
|
5
|
+
|
|
6
|
+
# -- Project information -----------------------------------------------------
|
|
7
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
|
8
|
+
|
|
9
|
+
from datetime import date
|
|
10
|
+
import uncountable
|
|
11
|
+
|
|
12
|
+
project = "Uncountable SDK"
|
|
13
|
+
copyright = f"{date.today().year}, Uncountable Inc"
|
|
14
|
+
author = "Uncountable Inc"
|
|
15
|
+
|
|
16
|
+
# -- General configuration ---------------------------------------------------
|
|
17
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
|
18
|
+
|
|
19
|
+
extensions = [
|
|
20
|
+
"autoapi.extension",
|
|
21
|
+
"myst_parser",
|
|
22
|
+
"sphinx_design",
|
|
23
|
+
"sphinx_copybutton",
|
|
24
|
+
"sphinx_favicon",
|
|
25
|
+
]
|
|
26
|
+
myst_enable_extensions = ["fieldlist", "deflist"]
|
|
27
|
+
|
|
28
|
+
autoapi_dirs = ["../uncountable"]
|
|
29
|
+
autoapi_options = [ 'members', 'undoc-members', 'show-inheritance', 'show-module-summary', 'imported-members' ]
|
|
30
|
+
autoapi_ignore = ['*integration*']
|
|
31
|
+
autodoc_typehints = 'description'
|
|
32
|
+
|
|
33
|
+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
# -- Options for HTML output -------------------------------------------------
|
|
37
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
|
38
|
+
|
|
39
|
+
html_theme = "furo"
|
|
40
|
+
html_title = "Python SDK"
|
|
41
|
+
html_static_path = ["static"]
|
|
42
|
+
html_logo = "static/logo_blue.png"
|
|
43
|
+
|
|
44
|
+
favicons = [
|
|
45
|
+
"favicons/android-chrome-192x192.png",
|
|
46
|
+
"favicons/android-chrome-512x512.png",
|
|
47
|
+
"favicons/apple-touch-icon.png",
|
|
48
|
+
"favicons/favicon-16x16.png",
|
|
49
|
+
"favicons/favicon-32x32.png",
|
|
50
|
+
"favicons/mstile-150x150.png",
|
|
51
|
+
"favicons/safari-pinned-tab.svg",
|
|
52
|
+
]
|
docs/index.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Uncountable Python SDK
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
`Uncountable Python SDK` is a python package that allows interacting with the uncountable platform
|
|
7
|
+
|
|
8
|
+
```{toctree}
|
|
9
|
+
:maxdepth: 2
|
|
10
|
+
|
|
11
|
+
quickstart
|
|
12
|
+
```
|
|
13
|
+
|
docs/justfile
ADDED
docs/quickstart.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Quickstart
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
Install from PyPI:
|
|
6
|
+
|
|
7
|
+
```{code-block} bash
|
|
8
|
+
pip install UncountablePythonSDK
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Available SDK methods
|
|
12
|
+
See the following class for a reference for the available python sdk methods. Then see the example in the next section on how to setup and call these methods.
|
|
13
|
+
[](uncountable.types.client_base.ClientMethods)
|
|
14
|
+
|
|
15
|
+
## Run a simple example
|
|
16
|
+
|
|
17
|
+
```{literalinclude} ../examples/create_entity.py
|
|
18
|
+
```
|
|
19
|
+
|
docs/requirements.txt
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "",
|
|
3
|
+
"icons": [
|
|
4
|
+
{
|
|
5
|
+
"src": "/static/img/icons/android-chrome-192x192.png",
|
|
6
|
+
"sizes": "192x192",
|
|
7
|
+
"type": "image/png"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"src": "/static/img/icons/android-chrome-512x512.png",
|
|
11
|
+
"sizes": "512x512",
|
|
12
|
+
"type": "image/png"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"theme_color": "#ffffff",
|
|
16
|
+
"background_color": "#ffffff",
|
|
17
|
+
"display": "standalone"
|
|
18
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<?xml version="1.0" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
|
3
|
+
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
|
4
|
+
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
width="16.000000pt" height="16.000000pt" viewBox="0 0 16.000000 16.000000"
|
|
6
|
+
preserveAspectRatio="xMidYMid meet">
|
|
7
|
+
<metadata>
|
|
8
|
+
Created by potrace 1.11, written by Peter Selinger 2001-2013
|
|
9
|
+
</metadata>
|
|
10
|
+
<g transform="translate(0.000000,16.000000) scale(0.002312,-0.002312)"
|
|
11
|
+
fill="#000000" stroke="none">
|
|
12
|
+
<path d="M3425 6902 c-16 -10 -50 -30 -75 -44 -25 -14 -85 -49 -135 -78 -49
|
|
13
|
+
-29 -110 -64 -135 -78 -25 -13 -70 -39 -100 -57 -119 -71 -800 -463 -875 -505
|
|
14
|
+
-22 -12 -80 -46 -130 -75 -74 -43 -876 -506 -980 -565 -27 -15 -194 -112 -445
|
|
15
|
+
-257 l-85 -49 0 -1733 c0 -1723 0 -1734 20 -1745 11 -6 23 -15 26 -19 3 -5 8
|
|
16
|
+
-7 10 -6 2 2 15 -4 29 -13 14 -9 117 -69 230 -133 113 -65 219 -126 235 -135
|
|
17
|
+
17 -10 59 -34 95 -55 36 -21 77 -45 92 -54 16 -9 187 -107 380 -219 194 -112
|
|
18
|
+
360 -208 368 -213 8 -5 60 -35 115 -66 55 -31 143 -81 195 -111 93 -54 165
|
|
19
|
+
-96 239 -138 20 -11 52 -30 71 -41 19 -11 170 -98 335 -193 165 -95 317 -184
|
|
20
|
+
337 -197 21 -12 40 -23 42 -23 3 0 29 -14 58 -31 29 -18 68 -40 85 -50 l33
|
|
21
|
+
-18 57 31 c32 17 65 37 74 44 8 8 18 14 22 14 4 0 51 26 104 58 54 32 105 61
|
|
22
|
+
113 65 8 4 33 18 55 31 22 14 56 33 75 44 19 11 123 70 230 132 227 132 219
|
|
23
|
+
127 378 219 68 39 128 71 132 71 5 0 10 4 12 8 2 4 30 23 63 41 71 40 113 64
|
|
24
|
+
158 90 88 51 426 246 457 263 68 39 176 101 230 133 30 18 163 94 295 170 132
|
|
25
|
+
76 308 178 390 225 l150 87 0 1733 0 1733 -80 48 c-44 27 -86 48 -92 49 -7 0
|
|
26
|
+
-13 5 -13 10 0 6 -4 10 -9 10 -5 0 -67 34 -136 75 -70 41 -128 75 -130 75 -2
|
|
27
|
+
0 -95 53 -207 118 -111 65 -223 130 -248 144 -48 27 -60 34 -369 212 -112 65
|
|
28
|
+
-218 126 -235 136 -160 91 -474 272 -486 280 -8 5 -42 24 -75 43 -33 19 -76
|
|
29
|
+
43 -95 55 -180 104 -472 271 -502 287 -21 11 -38 23 -38 27 0 5 -4 8 -8 8 -5
|
|
30
|
+
0 -68 34 -140 75 -72 41 -133 75 -134 75 -2 0 -16 -8 -33 -18z"/>
|
|
31
|
+
</g>
|
|
32
|
+
</svg>
|
|
Binary file
|
examples/create_entity.py
CHANGED
|
@@ -1,18 +1,25 @@
|
|
|
1
|
-
from uncountable.
|
|
2
|
-
from uncountable.types
|
|
1
|
+
from uncountable.core import AuthDetailsApiKey, Client
|
|
2
|
+
from uncountable.types import (
|
|
3
|
+
entity_t,
|
|
4
|
+
field_values_t,
|
|
5
|
+
)
|
|
3
6
|
|
|
4
7
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
client = Client(
|
|
9
|
+
base_url="https://app.uncountable.com",
|
|
10
|
+
auth_details=AuthDetailsApiKey(
|
|
11
|
+
api_id="X",
|
|
12
|
+
api_secret_key="X",
|
|
13
|
+
),
|
|
14
|
+
)
|
|
15
|
+
entities = client.create_entity(
|
|
16
|
+
definition_id=24,
|
|
17
|
+
entity_type=entity_t.EntityType.LAB_REQUEST,
|
|
18
|
+
field_values=[
|
|
19
|
+
field_values_t.FieldRefNameValue(
|
|
20
|
+
field_ref_name="name", value="SDK Lab Request"
|
|
21
|
+
),
|
|
22
|
+
field_values_t.FieldRefNameValue(field_ref_name="materialFamilyId", value=1),
|
|
23
|
+
],
|
|
24
|
+
)
|
|
25
|
+
print(entities)
|
|
@@ -43,9 +43,7 @@ def is_missing(field_type: typing.Any) -> bool:
|
|
|
43
43
|
if origin is not typing.Union:
|
|
44
44
|
return False
|
|
45
45
|
args = typing.get_args(field_type)
|
|
46
|
-
|
|
47
|
-
return False
|
|
48
|
-
return True
|
|
46
|
+
return not (len(args) == 0 or args[0] is not MissingSentryType)
|
|
49
47
|
|
|
50
48
|
|
|
51
49
|
def _invoke_tuple_parsers(
|
|
@@ -72,14 +70,17 @@ def _invoke_fallback_parsers(
|
|
|
72
70
|
arg_parsers: typing.Sequence[typing.Callable[[typing.Any], T]],
|
|
73
71
|
value: typing.Any,
|
|
74
72
|
) -> T:
|
|
73
|
+
exceptions = []
|
|
74
|
+
|
|
75
75
|
for parser in arg_parsers:
|
|
76
76
|
try:
|
|
77
77
|
return parser(value)
|
|
78
|
-
except Exception:
|
|
78
|
+
except Exception as e:
|
|
79
|
+
exceptions.append(e)
|
|
79
80
|
continue
|
|
80
81
|
raise ValueError(
|
|
81
82
|
f"Unhandled value {value} cannot be cast to a member of {original_type}"
|
|
82
|
-
)
|
|
83
|
+
) from ExceptionGroup("Fallback Parser Exception", exceptions)
|
|
83
84
|
|
|
84
85
|
|
|
85
86
|
def _invoke_membership_parser(
|
|
@@ -173,10 +174,16 @@ def _build_parser_inner(
|
|
|
173
174
|
raise ValueError("List types only support one argument")
|
|
174
175
|
arg_parser = _build_parser_inner(args[0], context)
|
|
175
176
|
|
|
177
|
+
def parse_element(value: typing.Any) -> typing.Any:
|
|
178
|
+
try:
|
|
179
|
+
return arg_parser(value)
|
|
180
|
+
except Exception as e:
|
|
181
|
+
raise ValueError("Failed to parse element", value) from e
|
|
182
|
+
|
|
176
183
|
def parse(value: typing.Any) -> typing.Any:
|
|
177
184
|
if not isinstance(value, list):
|
|
178
185
|
raise ValueError("value is not a list", parsed_type)
|
|
179
|
-
return origin(
|
|
186
|
+
return origin(parse_element(x) for x in value)
|
|
180
187
|
|
|
181
188
|
return parse
|
|
182
189
|
|
|
File without changes
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This processes the directory main/unc/materials/shared/actions_registry and emits actions_registry/action_definitions.tsx
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
import sys
|
|
7
|
+
from collections import defaultdict
|
|
8
|
+
from dataclasses import dataclass
|
|
9
|
+
from typing import TypeVar
|
|
10
|
+
|
|
11
|
+
from main.base.types import actions_registry_t
|
|
12
|
+
from pkgs.type_spec import builder
|
|
13
|
+
|
|
14
|
+
from ...argument_parser import CachedParser
|
|
15
|
+
from ..emit_typescript_util import ts_name
|
|
16
|
+
from ..util import rewrite_file
|
|
17
|
+
from .emit_typescript import emit_action_definitions
|
|
18
|
+
|
|
19
|
+
key_name = "name"
|
|
20
|
+
key_icon = "icon"
|
|
21
|
+
key_short_description = "short_description"
|
|
22
|
+
key_description = "description"
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
TypeT = TypeVar("TypeT")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class InvalidSpecException(Exception):
|
|
29
|
+
pass
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@dataclass(kw_only=True)
|
|
33
|
+
class ActionRegistryFileInfo:
|
|
34
|
+
directories: list[str]
|
|
35
|
+
filename: str
|
|
36
|
+
filepath: str
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
ACTIONS_REGISTRY_ROOT = "main/unc/materials/shared/actions_registry/"
|
|
40
|
+
action_definition_parser = CachedParser(
|
|
41
|
+
dict[str, actions_registry_t.ActionDefinitionYaml]
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def get_action_registry_files_info() -> list[ActionRegistryFileInfo]:
|
|
46
|
+
files_info = []
|
|
47
|
+
for dirname, _, files in os.walk(ACTIONS_REGISTRY_ROOT):
|
|
48
|
+
directories = dirname.replace(ACTIONS_REGISTRY_ROOT, "").split("/")
|
|
49
|
+
for filename in files:
|
|
50
|
+
filepath = os.path.join(dirname, filename)
|
|
51
|
+
if os.path.isfile(filepath) and filepath.endswith(".yaml"):
|
|
52
|
+
files_info.append(
|
|
53
|
+
ActionRegistryFileInfo(
|
|
54
|
+
directories=directories,
|
|
55
|
+
filename=filename.replace(".yaml", ""),
|
|
56
|
+
filepath=filepath,
|
|
57
|
+
)
|
|
58
|
+
)
|
|
59
|
+
return files_info
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def main() -> None:
|
|
63
|
+
files_info = get_action_registry_files_info()
|
|
64
|
+
action_definitions: defaultdict[str, list[actions_registry_t.ActionDefinition]] = (
|
|
65
|
+
defaultdict(list)
|
|
66
|
+
)
|
|
67
|
+
for file_info in files_info:
|
|
68
|
+
in_action_definitions = action_definition_parser.parse_yaml_file(
|
|
69
|
+
file_info.filepath
|
|
70
|
+
)
|
|
71
|
+
if len(in_action_definitions) == 0:
|
|
72
|
+
continue
|
|
73
|
+
|
|
74
|
+
for ref_name, definition in in_action_definitions.items():
|
|
75
|
+
modules = [*file_info.directories]
|
|
76
|
+
# if the actions are stored in index.yaml, parent dir should be treated as module
|
|
77
|
+
if file_info.filename != "index":
|
|
78
|
+
modules.append(file_info.filename)
|
|
79
|
+
|
|
80
|
+
module_str = "_".join(modules)
|
|
81
|
+
action_definitions[module_str].append(
|
|
82
|
+
actions_registry_t.ActionDefinition(
|
|
83
|
+
name=definition.name,
|
|
84
|
+
short_description=definition.short_description,
|
|
85
|
+
description=definition.description,
|
|
86
|
+
icon=definition.icon,
|
|
87
|
+
ref_name=ref_name,
|
|
88
|
+
module=actions_registry_t.ActionsRegistryModule(
|
|
89
|
+
ts_name(module_str, name_case=builder.NameCase.convert)
|
|
90
|
+
),
|
|
91
|
+
visibility_scope=[
|
|
92
|
+
actions_registry_t.ActionDefinitionVisibilityScope(item)
|
|
93
|
+
for item in definition.visibility_scope
|
|
94
|
+
]
|
|
95
|
+
if definition.visibility_scope is not None
|
|
96
|
+
else None,
|
|
97
|
+
)
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
ts_content = emit_action_definitions(action_definitions)
|
|
101
|
+
rewrite_file(
|
|
102
|
+
"main/site/js/materials/base/actions_registry/action_definitions.tsx",
|
|
103
|
+
ts_content,
|
|
104
|
+
)
|
|
105
|
+
sys.exit(0)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
main()
|