Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 39305e9

Browse files
committed
improve docs
1 parent 4d18e41 commit 39305e9

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

cads_api_client/api_client.py

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ApiClient:
2525
API Key. If None, infer from CADS_API_KEY or CADS_API_RC.
2626
verify: bool, default: True
2727
Whether to verify the TLS certificate at the remote end.
28-
timeout: float | tuple[float, float], default: 60
28+
timeout: float | tuple[float,float], default: 60
2929
How many seconds to wait for the server to send data, as a float, or a (connect, read) tuple.
3030
progress: bool, default: True
3131
Whether to display the progress bar during download.
@@ -207,14 +207,14 @@ def estimate_costs(self, collection_id: str, **request: Any) -> dict[str, Any]:
207207

208208
def get_accepted_licences(
209209
self,
210-
scope: Literal["all", "dataset", "portal"] | None = None,
210+
scope: Literal[None, "all", "dataset", "portal"] = None,
211211
) -> list[dict[str, Any]]:
212212
"""Retrieve acccepted licences.
213213
214214
Parameters
215215
----------
216-
scope: str | None
217-
Licence scope. Options: ``"all", "dataset", "portal"``.
216+
scope: {None, 'all', 'dataset', 'portal'}
217+
Licence scope.
218218
219219
Returns
220220
-------
@@ -243,7 +243,7 @@ def get_collection(self, collection_id: str) -> cads_api_client.Collection:
243243
def get_collections(
244244
self,
245245
limit: int | None = None,
246-
sortby: Literal["id", "relevance", "title", "update"] | None = None,
246+
sortby: Literal[None, "id", "relevance", "title", "update"] = None,
247247
query: str | None = None,
248248
keywords: list[str] | None = None,
249249
) -> cads_api_client.Collections:
@@ -253,8 +253,8 @@ def get_collections(
253253
----------
254254
limit: int | None
255255
Number of processes per page.
256-
sortby: str | None
257-
Field to sort results by. Options: ``"id", "relevance", "title", "update"``.
256+
sortby: {None, 'id', 'relevance', 'title', 'update'}
257+
Field to sort results by.
258258
query: str | None
259259
Full-text search query.
260260
keywords: list[str] | None
@@ -276,19 +276,19 @@ def get_collections(
276276
def get_jobs(
277277
self,
278278
limit: int | None = None,
279-
sortby: Literal["created", "-created"] | None = None,
280-
status: Literal["accepted", "running", "successful", "failed"] | None = None,
279+
sortby: Literal[None, "created", "-created"] = None,
280+
status: Literal[None, "accepted", "running", "successful", "failed"] = None,
281281
) -> cads_api_client.Jobs:
282282
"""Retrieve submitted jobs.
283283
284284
Parameters
285285
----------
286286
limit: int | None
287287
Number of processes per page.
288-
sortby: str | None
289-
Field to sort results by. Options: ``"created", "-created"``.
290-
status: str | None
291-
Status of the results. Options: ``"accepted", "running", "successful", "failed"``.
288+
sortby: {None, 'created', '-created'}
289+
Field to sort results by.
290+
status: {None, 'accepted', 'running', 'successful', 'failed'}
291+
Status of the results.
292292
293293
Returns
294294
-------
@@ -303,14 +303,14 @@ def get_jobs(
303303

304304
def get_licences(
305305
self,
306-
scope: Literal["all", "dataset", "portal"] | None = None,
306+
scope: Literal[None, "all", "dataset", "portal"] = None,
307307
) -> list[dict[str, Any]]:
308308
"""Retrieve licences.
309309
310310
Parameters
311311
----------
312-
scope: str | None
313-
Licence scope. Options: ``"all", "dataset", "portal"``.
312+
scope: {None, 'all', 'dataset', 'portal'}
313+
Licence scope.
314314
315315
Returns
316316
-------
@@ -338,16 +338,18 @@ def get_process(self, collection_id: str) -> cads_api_client.Process:
338338
return self._retrieve_api.get_process(collection_id)
339339

340340
def get_processes(
341-
self, limit: int | None = None, sortby: Literal["id", "-id"] | None = None
341+
self,
342+
limit: int | None = None,
343+
sortby: Literal[None, "id", "-id"] = None,
342344
) -> cads_api_client.Processes:
343345
"""Retrieve available processes.
344346
345347
Parameters
346348
----------
347349
limit: int | None
348350
Number of processes per page.
349-
sortby: str | None
350-
Field to sort results by. Options: ``"id", "-id"``.
351+
sortby: {None, 'id', '-id'}
352+
Field to sort results by.
351353
352354
Returns
353355
-------

0 commit comments

Comments
 (0)