diff --git a/labelbox/client.py b/labelbox/client.py index 02d11669f..518e63fa7 100644 --- a/labelbox/client.py +++ b/labelbox/client.py @@ -309,6 +309,7 @@ def _get_single(self, db_object_type, uid): def get_project(self, project_id): """ Gets a single Project with the given ID. + >>> project = client.get_project("") Args: project_id (str): Unique ID of the Project. @@ -322,6 +323,7 @@ def get_project(self, project_id): def get_dataset(self, dataset_id): """ Gets a single Dataset with the given ID. + >>> dataset = client.get_dataset("") Args: dataset_id (str): Unique ID of the Dataset. @@ -334,11 +336,17 @@ def get_dataset(self, dataset_id): return self._get_single(Dataset, dataset_id) def get_user(self): - """ Gets the current User database object. """ + """ Gets the current User database object. + >>> user = client.get_user() + + """ return self._get_single(User, None) def get_organization(self): - """ Gets the Organization DB object of the current user. """ + """ Gets the Organization DB object of the current user. + >>> organization = client.get_organization() + + """ return self._get_single(Organization, None) def _get_all(self, db_object_type, where): @@ -361,6 +369,7 @@ def _get_all(self, db_object_type, where): def get_projects(self, where=None): """ Fetches all the projects the user has access to. + >>> projects = client.get_projects(where=(Project.name == "") & (Project.description == "")) Args: where (Comparison, LogicalOperation or None): The `where` clause @@ -371,7 +380,8 @@ def get_projects(self, where=None): return self._get_all(Project, where) def get_datasets(self, where=None): - """ Fetches all the datasets the user has access to. + """ Fetches one or more datasets. + >>> datasets = client.get_datasets(where=(Dataset.name == "") & (Dataset.description == ">> frontend = client.get_labeling_frontends(where=LabelingFrontend.name == "Editor") Args: where (Comparison, LogicalOperation or None): The `where` clause @@ -422,9 +433,8 @@ def _create(self, db_object_type, data): def create_dataset(self, **kwargs): """ Creates a Dataset object on the server. Attribute values are passed as keyword arguments: - >>> project = client.get_project("uid_of_my_project") - >>> dataset = client.create_dataset(name="MyDataset", - >>> projects=project) + >>> project = client.get_project("") + >>> dataset = client.create_dataset(name="", projects=project) Kwargs: Keyword arguments with new Dataset attribute values. @@ -441,7 +451,7 @@ def create_dataset(self, **kwargs): def create_project(self, **kwargs): """ Creates a Project object on the server. Attribute values are passed as keyword arguments: - >>> project = client.create_project(name="MyProject") + >>> project = client.create_project(name="", description="") Kwargs: Keyword arguments with new Project attribute values.