Fetch your Projects including their connected Datasets and images


The Project object in our Python API Wrapper is a representation of the Projects you already know from This object includes all the data that belongs to your Project, such as connected Datasets and Images. Projects can be accessed through the Client object introduced in the Getting Started page.

Fetching Projects from DataGym

Before we look at the Project object in our Python API Wrapper, you first have to learn how to get the data from There are multiple ways to get your Projects from DataGym's backend.

Get all Projects

projects = client.get_projects()

get_projects returns all Projects in a list.

Get a Project by its name

dummy_project = client.get_project_by_name(project_name="Dummy_Project")

get_project_by_name returns a specific Project by its unique name

The Project object

Project Attributes

The Project object of the Python API is modeled after DataGym's Projects and, therefore, inherits the same attributes you already know from your Projects.

>>>> print(dummy_project)
<Project {
    'id': 'b1f53633-f3aa-4f9a-9195-a9a651f739df', 
    'name': 'Dummy_Project', 
    'short_description': 'A project that helps to track cars from an arial drone',
    'timestamp': '1583828520411', 
    'label_config_id': 'cdc426e1-0a0d-4f94-9173-4d1dcca10f04', 
    'label_iteration_id': '50ad280c-50ef-408d-8d56-b2661aa54324', 
    'owner': '3360f10f-a5ab-48a6-966c-cdba2d63116a', 
    'datasets': <List[Dataset] with 1 element>

As you can see, a Project object also contains a list of its connected Datasets, which are represented as Dataset objects.

Project helper methods

A Project can hold an arbitrary number of Datasets which also can hold an arbitrary number of images. To simplify the access to these objects, the Project object provides a variety of helper methods.

Get a Dataset by its name

dataset = project.get_dataset_by_name(dataset_name="<DATASET_NAME>")

get_dataset_by_name returns a single Dataset or None if no Dataset with the given name was found.

Get all Images from a Project

list_of_images = project.get_images()

get_images returns a list of all Images from all Datasets connected to the Project.

Get Images by name

In some cases you might only be interested in a specific set of images. The get_images_by_name method can reduce the effort of searching for these images with your own scripts. The method takes an image name and returns the image(s) with this exact name within your Project.

images = project.get_images_by_name(image_name="satellite_img_01.jpg")

get_images_by_name returns a list of Images that match the search term

You can also use regular expressions to start a broader search and return all images that fit into a specific naming pattern. For example, let's get all satellite images from your project by searching for the regular expression "satellite.*":

images = project.get_images_by_name(image_name="satellite.*", regex=True)
    <Image {
        'id': '<ID_2>', 
        'image_name': 'satellite_img_01.jpg', 
        'image_type': 'SHAREABLE_LINK', 
        'timestamp': 1583831745119
    <Image {
        'id': '<ID_2>', 
        'image_name': 'satellite_img_02.jpg', 
        'image_type': 'SHAREABLE_LINK', 
        'timestamp': 1583831714382

Last updated