rowan-python 2.1.9__py3-none-any.whl → 2.1.10__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.
rowan/folder.py CHANGED
@@ -58,6 +58,7 @@ class Folder(BaseModel):
58
58
 
59
59
  return self
60
60
 
61
+
61
62
  def update(
62
63
  self,
63
64
  name: str | None = None,
@@ -110,6 +111,15 @@ class Folder(BaseModel):
110
111
  response = client.delete(f"/folder/{self.uuid}")
111
112
  response.raise_for_status()
112
113
 
114
+ def print_folder_tree(self, max_depth: int = 10, show_uuids: bool = False) -> None:
115
+ """
116
+ Retrieves a folder tree from the API.
117
+
118
+ :param max_depth: The maximum depth of the folder tree.
119
+ :param show_uuids: Whether to show the UUIDs of the folders.
120
+ :raises HTTPError: If the API request fails.
121
+ """
122
+ print_folder_tree(self.uuid, max_depth, show_uuids)
113
123
 
114
124
  def retrieve_folder(uuid: str) -> Folder:
115
125
  """
@@ -125,19 +135,6 @@ def retrieve_folder(uuid: str) -> Folder:
125
135
  return Folder(**response.json())
126
136
 
127
137
 
128
- def home_folder() -> Folder:
129
- """
130
- Retrieves the home folder from the API.
131
-
132
- :return: A Folder object representing the home folder.
133
- :raises HTTPError: If the API request fails.
134
- """
135
- with api_client() as client:
136
- response = client.get("/user/me/root_folders")
137
- response.raise_for_status()
138
- return Folder(**response.json()["user_root"])
139
-
140
-
141
138
  def list_folders(
142
139
  parent_uuid: str | None = None,
143
140
  name_contains: str | None = None,
@@ -210,3 +207,22 @@ def create_folder(
210
207
  response.raise_for_status()
211
208
  folder_data = response.json()
212
209
  return Folder(**folder_data)
210
+
211
+ def print_folder_tree(uuid: str, max_depth: int = 10, show_uuids: bool = False) -> None:
212
+ """
213
+ Retrieves a folder tree from the API.
214
+
215
+ :param uuid: The UUID of the root of the folder tree.
216
+ :param max_depth: The maximum depth of the folder tree.
217
+ :param show_uuids: Whether to show the UUIDs of the folders.
218
+ :raises HTTPError: If the API request fails.
219
+ """
220
+ params: dict[str, Any] = {
221
+ "max_depth": max_depth,
222
+ "show_uuids": show_uuids,
223
+ }
224
+ with api_client() as client:
225
+ response = client.get(f"/folder/{uuid}/folder_tree", params=params)
226
+ response.raise_for_status()
227
+ folder_data = response.json()
228
+ print(folder_data)
rowan/workflow.py CHANGED
@@ -408,6 +408,33 @@ def retrieve_workflow(uuid: str) -> Workflow:
408
408
  return Workflow(**response.json())
409
409
 
410
410
 
411
+ def retrieve_workflows(uuids: list[str]) -> list[Workflow]:
412
+ """
413
+ Retrieves a list of workflows from the API.
414
+
415
+ :param uuids: The UUIDs of the workflows to retrieve.
416
+ :return: A list of Workflow objects representing the retrieved workflows.
417
+ :raises HTTPError: If the API request fails.
418
+ """
419
+ with api_client() as client:
420
+ response = client.post("/workflow/batch_retrieve", json={"uuids": uuids})
421
+ response.raise_for_status()
422
+ return [Workflow(**workflow_data) for workflow_data in response.json()]
423
+
424
+ def batch_poll_status(uuids: list[str]) -> list[Workflow]:
425
+ """
426
+ Polls the status of a list of workflows.
427
+
428
+ :param uuids: The UUIDs of the workflows to poll.
429
+ :return: A dictionary of statuses and the count of workflows in that status.
430
+ :raises HTTPError: If the API request fails.
431
+ """
432
+ with api_client() as client:
433
+ response = client.post("/workflow/batch_status", json={"uuids": uuids})
434
+ response.raise_for_status()
435
+ return response.json()
436
+
437
+
411
438
  def retrieve_calculation_molecules(
412
439
  uuid: str, return_frequencies: bool = False
413
440
  ) -> list[dict[str, Any]]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rowan-python
3
- Version: 2.1.9
3
+ Version: 2.1.10
4
4
  Summary: Rowan Python Library
5
5
  Project-URL: Homepage, https://github.com/rowansci/rowan-client
6
6
  Project-URL: Bug Tracker, https://github.com/rowansci/rowan-client/issues
@@ -11,7 +11,7 @@ Requires-Dist: httpx
11
11
  Requires-Dist: nest-asyncio
12
12
  Requires-Dist: rdkit
13
13
  Requires-Dist: setuptools
14
- Requires-Dist: stjames>=0.0.125
14
+ Requires-Dist: stjames>=0.0.128
15
15
  Description-Content-Type: text/markdown
16
16
 
17
17
  # Rowan Python Library
@@ -1,15 +1,15 @@
1
1
  rowan/__init__.py,sha256=2rz6dW0l9DzawiFi6S0WSv8XlZq1CoTBKJrsJ1uesvk,171
2
2
  rowan/constants.py,sha256=emCH4m9OL2Hm5E-6mJGM_FgzrK_JrZT-FiKJ6pMNQ4Y,84
3
- rowan/folder.py,sha256=n9WkjHMweQLtVcWUvCttOrmezvUdbFxam_eDEMzLF_A,6791
3
+ rowan/folder.py,sha256=MF3SU7uG6Hl2SJLFxbPmbhosS-pPEHwbTyummaaRdzM,7509
4
4
  rowan/project.py,sha256=ALPPkMa_cg7w5OkXno1cs6acCofw8AOUYRSeWgr3L0o,3774
5
5
  rowan/protein.py,sha256=mFSVCr-08bSikXBUtJtSWzjKcVAuBmTeRckn7JUHYSE,8810
6
6
  rowan/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  rowan/user.py,sha256=Dl--NPUPATKCs2VmILsW8HnLiunG0Lxr0n6mKuHm21U,3891
8
8
  rowan/utils.py,sha256=64II-cPOe_SFJK302Bm8hP62d_3_CgnTVYCbn3zKT7U,3334
9
- rowan/workflow.py,sha256=ovhjVUaoI0K-pepk3u_xGnymBOq9cEEUEoyzsFr36Sc,60331
9
+ rowan/workflow.py,sha256=l21KygojLRsM6JI2b0H-hcbOnaFsDZGhbqmLy3sexjA,61360
10
10
  rowan/rowan_rdkit/__init__.py,sha256=EATX2VRzywzKxqkpCUMTf7RNQLkWsfi5VcCNDW6EIiw,503
11
11
  rowan/rowan_rdkit/chem_utils.py,sha256=sKCzul2e0ldVYTBImhTwso7ddNgPKmvS-OmvCEjVJH0,34788
12
- rowan_python-2.1.9.dist-info/METADATA,sha256=Teu23XCt-9sjkXXVcsjC5PID3Pgp5bR-conmLvaPiFE,1600
13
- rowan_python-2.1.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
14
- rowan_python-2.1.9.dist-info/licenses/LICENSE,sha256=i05z7xEhyrg6f8j0lR3XYjShnF-MJGFQ-DnpsZ8yiVI,1084
15
- rowan_python-2.1.9.dist-info/RECORD,,
12
+ rowan_python-2.1.10.dist-info/METADATA,sha256=8AzU2Im1apsPTrfFyZ3OYfPYaI9V_vwmRjKOfOy6xiI,1601
13
+ rowan_python-2.1.10.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
14
+ rowan_python-2.1.10.dist-info/licenses/LICENSE,sha256=i05z7xEhyrg6f8j0lR3XYjShnF-MJGFQ-DnpsZ8yiVI,1084
15
+ rowan_python-2.1.10.dist-info/RECORD,,