crux package¶
Subpackages¶
- crux.models package
- Submodules
- crux.models.dataset module
- crux.models.file module
- crux.models.folder module
- crux.models.identity module
- crux.models.job module
- crux.models.label module
- crux.models.model module
- crux.models.permission module
- crux.models.query module
- crux.models.resource module
- crux.models.table module
- Module contents
Submodules¶
crux.apis module¶
Module contains Crux object to interact with root APIs.
-
class
crux.apis.
Crux
(api_key=None, api_host=None, proxies=None, user_agent=None, api_prefix=None, only_use_crux_domains=None)¶ Bases:
object
Crux APIs.
-
close
()¶ Closes the Connection.
-
create_dataset
(name, description=None, tags=None)¶ Creates the Dataset.
Parameters: - name (str) – Sets whether to sort or not.
- description (str) – Folder for which resource should be listed. Defaults to None.
- tags (
list
ofstr
) – Sets the offset. Defaults to None.
Returns: Dataset object.
Return type:
-
get_dataset
(id)¶ Fetches the Dataset.
Parameters: id (str) – Dataset ID which is to be fetched. Returns: Dataset object Return type: crux.models.Dataset
-
get_job
(job_id)¶ Fetches the Job.
Parameters: job_id (str) – Job ID which is to be fetched. Returns: Job object. Return type: crux.models.Job
-
get_resource
(id)¶ Fetches the Resource by ID.
Any supported resource can be fetched. The object returned will be an instance of the correct subclass, for example a
crux.models.File
instance will be returned for file resources.Parameters: id (str) – Resource ID which is to be fetched. Returns: Resource or its Child Object. Return type: crux.models.Resource
-
list_datasets
(owned=True, subscribed=True)¶ Fetches a list of owned and/or subscribed Datasets.
Parameters: - owned (bool) – Show datasets owned by the caller. Defaults to True.
- subscribed (bool) – Show datasets the user has a subscription. Defaults to True.
Returns: List of Dataset objects.
Return type: list(
crux.models.Dataset
)
-
list_public_datasets
()¶ Fetches a list of public Datasets.
Returns: List of Dataset objects. Return type: list ( crux.models.Dataset
)
-
set_datasets_provenance
(provenance)¶ Sets the Dataset Provenance
Parameters: provenance (dict) – Provenance dictionary Returns: Provenance response dictionary. Return type: dict Example
from crux import Crux conn = Crux() provenance = { "dataset_id":[ { "workflow_id": "test_id", "pipeline_ids": ["test_id_1","test_id_2"], "cron_spec": "0 0 1 1 0" } ] } response = conn.set_datasets_provenance(provenance=provenance)
-
whoami
()¶ Returns the Identity of Current User.
Returns: Identity object. Return type: crux.models.Identity
-
crux.exceptions module¶
Module contains the set of crux-python’s exceptions.
-
exception
crux.exceptions.
CruxAPIError
(message)¶ Bases:
Exception
Exception which should be raised when the API response expects an error.
-
exception
crux.exceptions.
CruxClientConnectionError
(message)¶ Bases:
crux.exceptions.CruxClientError
Exception should be raised when SDK expects any connection related errors.
-
exception
crux.exceptions.
CruxClientError
(message)¶ Bases:
Exception
Exception which should be raised when the client SDK expects an error.
-
exception
crux.exceptions.
CruxClientHTTPError
(message)¶ Bases:
crux.exceptions.CruxClientError
Exception should be raised when SDK expects any HTTP related errors.
-
exception
crux.exceptions.
CruxClientTimeout
(message)¶ Bases:
crux.exceptions.CruxClientError
Exception should be raised when SDK expects any timeout related errors.
-
exception
crux.exceptions.
CruxResourceNotFoundError
(message)¶ Bases:
crux.exceptions.CruxAPIError
Exception which should be raised when Crux Resource is not found.
Module contents¶
Module packages root level crux objects.
-
class
crux.
Crux
(api_key=None, api_host=None, proxies=None, user_agent=None, api_prefix=None, only_use_crux_domains=None)¶ Bases:
object
Crux APIs.
-
close
()¶ Closes the Connection.
-
create_dataset
(name, description=None, tags=None)¶ Creates the Dataset.
Parameters: - name (str) – Sets whether to sort or not.
- description (str) – Folder for which resource should be listed. Defaults to None.
- tags (
list
ofstr
) – Sets the offset. Defaults to None.
Returns: Dataset object.
Return type:
-
get_dataset
(id)¶ Fetches the Dataset.
Parameters: id (str) – Dataset ID which is to be fetched. Returns: Dataset object Return type: crux.models.Dataset
-
get_job
(job_id)¶ Fetches the Job.
Parameters: job_id (str) – Job ID which is to be fetched. Returns: Job object. Return type: crux.models.Job
-
get_resource
(id)¶ Fetches the Resource by ID.
Any supported resource can be fetched. The object returned will be an instance of the correct subclass, for example a
crux.models.File
instance will be returned for file resources.Parameters: id (str) – Resource ID which is to be fetched. Returns: Resource or its Child Object. Return type: crux.models.Resource
-
list_datasets
(owned=True, subscribed=True)¶ Fetches a list of owned and/or subscribed Datasets.
Parameters: - owned (bool) – Show datasets owned by the caller. Defaults to True.
- subscribed (bool) – Show datasets the user has a subscription. Defaults to True.
Returns: List of Dataset objects.
Return type: list(
crux.models.Dataset
)
-
list_public_datasets
()¶ Fetches a list of public Datasets.
Returns: List of Dataset objects. Return type: list ( crux.models.Dataset
)
-
set_datasets_provenance
(provenance)¶ Sets the Dataset Provenance
Parameters: provenance (dict) – Provenance dictionary Returns: Provenance response dictionary. Return type: dict Example
from crux import Crux conn = Crux() provenance = { "dataset_id":[ { "workflow_id": "test_id", "pipeline_ids": ["test_id_1","test_id_2"], "cron_spec": "0 0 1 1 0" } ] } response = conn.set_datasets_provenance(provenance=provenance)
-
whoami
()¶ Returns the Identity of Current User.
Returns: Identity object. Return type: crux.models.Identity
-