Python SDK Reference
Here we will describe every method of the picsellia package

Installation

The first thing you need to do is to download our python package from PyPI, you can install it with pip
1
pip install picsellia
Copied!

Dependencies

Here is the several packages that will be installed along the picsellia package, they are used to perform mathematical operations, array or image manipulations and HTTP requests
  • numpy>=1.18.5
  • Pillow>=7.2.0
  • requests>=2.24.0
  • scipy>=1.4.1

Client

To connect your code to Picsell.ia, you must initialize our client.
1
from picsellia.client import Client
2
​
3
api_token = '4d388e237d10b8a19a93517ffbe7ea32ee7f4787'
4
​
5
clt = Client(api_token)
Copied!
You will be greeted by this nice message (Pierre-Nicolas is my name, you should see your username here, unless you are named Pierre-Nicolas too πŸ‘€ ) :
1
Hi Pierre-Nicolas, welcome back.
Copied!

Datalake

You need to instantiate a Datalake object in order to interact with your pictures or datasets.

__init__

If you need to interact with your datalake, you must initialize the Datalake class. It is a subclass of the Client.
1
from picsellia.client import Client
2
​
3
datalake = Client.Datalake(
4
api_token=None,
5
organization=None
6
)
Copied!

Arguments:

  • api_token (string) Your personal API token (Find it in your profile page πŸ”₯)
  • organization (string, optional) the name of the organization you want to work with (None default to your organization)

Returns:

None

upload

This upload method allows you to upload your Dataset, (images and annotations or annotations only).
1
datalake.upload(
2
name: str=None,
3
version: str=None,
4
imgdir: str=None, -> "path/to/imgdir"
5
ann_path: str=None, -> "path/to/annotations"
6
ann_format: str=None, -> "COCO", "PASCAL-VOC", "PICSELLIA"
7
tags: List[str]=[],
8
nb_jobs: int=5,
9
rectangle: bool=False):
Copied!
Arguments
  • name (string, required) Name of the dataset to be created or fetched if you want to upload only annotations
  • version (string, optionnal) Version of the dataset to be fetched, if None we will fetch the latest created with this name.
  • imgdir (string, optionnal) Path to the directory of the pictures to upload, leave blank if you just want to upload the annotations.
  • ann_path (string, required) Path to the annotations files, it can be a directory or a file.
  • ann_format (string, required) you can upload COCO format, PASCAL-VOC or PICSELLIA
  • tags (list, optionnal) List of tags to add to the uploaded images, if None tags will be the upload date.
  • nb_jobs (int, optionnal) Number of process to use to upload, put nb_jobs=-1 if you want to use all available processes.
  • rectangle (bool, optionnal) set to True if you want to force to upload bbox annotations when both polygons and bbox are available in your annotation files.

Picture

The picture object allow you to interact with your assets only.

__init__

If you need to interact with your experiments, you must initialize the Picture class. It is a subclass of the Datalake.
1
from picsellia.client import Client
2
​
3
picture = Client.Datalake.Picture(
4
api_token=None,
5
organization=None
6
)
Copied!

Arguments:

  • api_token (string) Your personal API token (Find it in your profile page πŸ”₯)
  • organization (string, optional) the name of the organization you want to work with (None default to your organization)
​

upload

To upload assets to your lake
1
picture.upload(filepath=None, tags=[], source='sdk')
Copied!

Arguments:

  • filtepath (string or list) Either one filepath pointing to the asset to upload or a list of path.
  • tags (list, optional) the list of tags to attach to the upload assets
  • source (string, optional) Specify the source of the upload, default is "sdk"

list

1
picture.list()
Copied!

Returns:

A list containing the pictures objects for your datalake.
1
{'pictures': [{'picture_id': '25d76bee-a6d3-43d7-8620-6ff18f7a5557',
2
'internal_key': '15288614-bedb-4cab-97c1-23684cf9c761.jpg',
3
'external_url': 'GE_121.jpg',
4
'creation_date': '2021-02-07',
5
'height': 310,
6
'width': 322,
7
'tag': []},
8
{'picture_id': 'd1cf0d96-5c05-4fb4-aa4a-5e90f3c748da',
9
'internal_key': 'ed6e12e3-0db3-461f-bcd9-54d48509680b.jpg',
10
'external_url': 'GE_55.jpg',
11
'creation_date': '2021-02-07',
12
'height': 2908,
13
'width': 4800,
14
'tag': []},
15
{'picture_id': '716e45a8-09f6-4ec5-9dd1-29c313ae2cdf',
16
'internal_key': 'a9597e66-584d-4568-b1cc-31b951154edd.jpg',
17
'external_url': 'GE_309.jpg',
18
'creation_date': '2021-02-07',
19
'height': 208,
20
'width': 254,
21
'tag': []},
22
{'picture_id': '88d2b82d-2a38-4c30-912b-79474a617072',
23
'internal_key': 'c83493f7-ce61-4a0b-8166-54698d071792.jpg',
24
'external_url': 'Test85.jpg',
25
'creation_date': '2021-02-07',
26
'height': 663,
27
'width': 710,
28
'tag': []},
29
{'picture_id': 'd9d4684f-a2d1-4431-93e7-dce352aff471',
30
'internal_key': 'b7a8bb6b-d3f2-46d5-9599-dfb9b4d2f1cd.jpg',
31
'external_url': 'GE_466.jpg',
32
'creation_date': '2021-02-07',
33
'height': 462,
34
'width': 520,
35
'tag': []},
36
}
Copied!

fetch

Fetch images with corresponding tags
​
1
pictures.fetch(
2
quantity=1,
3
tags=["drone", "coco"],
4
)
Copied!

Parameters:

  • quantity (float, optional) the percentage of assets to fetch ( 1 meaning 100%)
  • tags (list, required) a list of tags used to search in your Datalake
​

Returns:

The list of all the fetched assets
1
[{'picture_id': '8b536f4c-c95b-4f5f-afbe-a9f31242a235',
2
'internal_key': '51ee5ee9-5176-4e98-b173-0687ed6c7b2f.jpg',
3
'external_url': '9999966_00000_d_0000055.jpg',
4
'creation_date': '2021-02-07',
5
'height': 1050,
6
'width': 1400,
7
'tag': ['drone', 'coco', 'vizdrone']},
8
{'picture_id': '426ce7bd-7535-4fe5-80cd-c41e07f84c99',
9
'internal_key': '7f4f1b60-d1bb-4458-b3bb-5f3d01a8f7eb.jpg',
10
'external_url': '9999955_00000_d_0000312.jpg',
11
'creation_date': '2021-02-07',
12
'height': 788,
13
'width': 1400,
14
'tag': ['drone', 'coco', 'vizdrone']},
15
{'picture_id': '320e69fc-964a-478e-b689-05351213578e',
16
'internal_key': '5aa4036e-8050-4fef-9c3c-af9ba46db511.jpg',
17
'external_url': '9999955_00000_d_0000043.jpg',
18
'creation_date': '2021-02-07',
19
'height': 788,
20
'width': 1400,
21
'tag': ['drone', 'coco', 'vizdrone']},
22
{'picture_id': 'bed1ddab-7cf1-460b-99a8-c4125612caa3',
23
'internal_key': 'f73fedbf-d87e-4483-859a-77a3f8e38702.jpg',
24
'external_url': '9999982_00000_d_0000167.jpg',
25
'creation_date': '2021-02-07',
26
'height': 1050,
27
'width': 1400,
28
'tag': ['drone', 'coco', 'vizdrone']},
29
{'picture_id': '0bc695d1-03bb-48ea-bd89-5bef5bf02c23',
30
'internal_key': '98ac39c5-a157-4a5e-bafc-a8399b90f230.jpg',
31
'external_url': '9999974_00000_d_0000049.jpg',
32
'creation_date': '2021-02-07',
33
'height': 1078,
34
'width': 1916,
35
'tag': ['drone', 'coco', 'vizdrone']},
36
]
Copied!

status

Once, you have fetched pictures, you can call status method to visualize the number of assets fetched
1
pictures.status()
Copied!

Return:

1
Number of Assets selected : 1472
Copied!

delete

Delete the list of pictures
1
pictures.delete(
2
pictures=None
3
)
Copied!

Arguments:

  • pictures (list, optional) The list of pictures to delete from your lake, if none will delete the latest fetched pictures.
​

Returns:

None

add_tags

Add tags to selected pictures
1
pictures.add_tags(
2
pictures=[],
3
tags=["tag_to_add"]
4
)
Copied!

Arguments:

  • pictures (list, optional) The list of pictures to selected from your lake, if none will add tags to the last fetched pictures.
  • tags (list, required) The list of tags to add to the selected pictures

Returns:

None

remove_tags

Remove tags from selected pictures
1
pictures.remove_tags(
2
pictures=[],
3
tags=["tag_to_add"]
4
)
Copied!

Arguments:

  • pictures (list, optional) The list of pictures to selected from your lake, if none will remove tags from the last fetched pictures.
  • tags (list, required) The list of tags to delete from the selected pictures

Returns:

None

Dataset

The dataset object allow you to interact with your dataset ( annotations, labels, question and answers ).

__init__

If you need to interact with your experiments, you must initialize the Dataset class. It is a subclass of the Datalake.
1
from picsellia.client import Client
2
​
3
dataset = Client.Datalake.Dataset(
4
api_token=None,
5
organization=None
6
)
Copied!

Arguments:

  • api_token (string) Your personal API token (Find it in your profile page πŸ”₯)
  • organization (string, optional) the name of the organization you want to work with (None default to your organization)
​

list

1
dataset.list()
Copied!

Returns:

A list containing the dataset objects for your account.
1
-------------
2
Dataset Name: GoogleEarthShip
3
Dataset Version: first
4
Nb Assets: 793
5
-------------
6
-------------
7
Dataset Name: VizDrone2017
8
Dataset Version: first
9
Nb Assets: 6470
10
-------------
11
-------------
12
Dataset Name: FaceMaskDetection
13
Dataset Version: first
14
Nb Assets: 6024
15
-------------
16
-------------
17
Dataset Name: TrashDataset
18
Dataset Version: first
19
Nb Assets: 1435
20
-------------
Copied!

fetch

Fetch dataset with its name and version
1
dataset.fetch(
2
name="myDataset",
3
version="latest",
4
)
Copied!

Parameters:

  • name (string, optional) the name of the dataset to fetch
  • version (string, optional) the version of the dataset to fetch, if None, the client will fetch latest

Returns:

A Dataset object relative to the fetched dataset
1
dataset = dataset.fetch(name="myDataset",version="latest")
2
print(dataset)
3
{
4
"dataset_id": "9061846f-597a-47d6-9711-7f75671841a2",
5
"dataset_name": "myDataset",
6
"version": "latest",
7
"size": 128,
8
"description": "None",
9
"private": true
10
}
Copied!

create

Create a a new dataset and attach pictures to it, to do so you first need to fetch pictures​
1
dataset.create(
2
name="myDataset",
3
description='',
4
private=True,
5
pictures=[]
6
)
Copied!
​

Parameters:

  • name (string, optional) the name ot the dataset to create
  • description (string, optional) the description of the dataset to create
  • private (bool, optional) If True, your dataset will be accessible to anyone
  • pictures (list, required) The list of pictures to attach to your dataset

Return:

the id of the created dataset

new_version

Create a a new dataset and attach pictures to it, to do so you first need to fetch pictures​
1
dataset.new_version(
2
name="myDataset",
3
version='newVersion',
4
from_version='latest',
5
pictures=[]
6
)
Copied!
​

Parameters:

  • name (string, optional) the name of the dataset
  • version (string, optional) the version name of the dataset to create
  • from_version (string, optional)The origin version for your new version, if None we'll create a new version from the latest version
  • pictures (list, required) The list of pictures to attach to your version

Return:

None

create_labels

Sets up the labels (tools for drawing bounding-boxes, polygons...) for your dataset.
1
dataset.create_labels(
2
name=None,
3
ann_type=None
4
)
Copied!

Arguments:

  • name (str, required) name of the label want to set up (e.g. car, bird, plane...)
  • ann_type (str, required) type of shape that will be used for annotations :
    • 'rectangle': bounding-boxes for object-detection
    • 'polygon': polygons for segmentation

Returns:

None

list_pictures

Get the list of all the images in the fetched dataset
1
dataset.list_pictures(
2
dataset_id=None
3
)
Copied!

Arguments:

  • dataset_id (str, optional) id of the dataset (if not fetched)

Returns:

list of Picture objects

add_data

Add the fetch pictures to a dataset
1
dataset.add_data(
2
name="myDataset",
3
version='myVersion',
4
pictures=[]
5
)
Copied!
If you fetched a dataset before, you won't have to specify the name and version of the dataset

Parameters:

  • name (string, optional) the name of the dataset
  • version (string, optional) the version name of the dataset to fetch if None, we'll take latest
  • pictures (list, required) The list of pictures to attach to add

Return:

None

delete

Delete the a dataset
1
dataset.delete(
2
name="myDataset",
3
version='myVersion',
4
)
Copied!

Arguments:

  • name (string, optional) the name of the dataset to delete
  • version (string, optional) the version name of the dataset to delete if None, we'll take latest
​

Returns:

None

download

Download all the images from a dataset in a folder
1
dataset.download(
2
dataset=None,
3
folder_name=None
4
)
Copied!

Arguments:

  • dataset (str, required) the name of the dataset you want to download written <dataset_name>/<version>
  • folder_name (str, optional) the name of the folder you want to download the pictures in, defaults to dataset_name/version if None

Returns:

None

add_annotation

Create an annotation for a picture in a dataset (or add objects to existing annotation)
1
dataset.add_annotation(
2
picture_external_url=None
3
dataset_id=None,
4
data={},
5
image_qa={}
6
)
Copied!

Arguments:

  • picture_external_url (str, required) the name of the target image
  • dataset_id (str, optional) leave None if you already fetched a dataset
  • data (dict, required) annotation data
  • image_qa (dict, optional) Q&A data for image

Formats:

  • classification
1
data = [
2
{
3
"type": "classification",
4
"label": "car"
5
}
6
]
7
dataset.add_annotation("awsm_pic.jpg", True, data=data)
Copied!
  • detection
1
data = [
2
{
3
"type": "rectangle",
4
"label": "car",
5
"rectangle": {
6
"top": 16,
7
"left": 10,
8
"width": 50,
9
"height": 60
10
}
11
}
12
]
13
dataset.add_annotation("awsm_pic.jpg", True, data=data)
Copied!
  • segmentation
1
data = [{
2
"type": "polygon",
3
"label" : "rose",
4
"polygon": {
5
"geometry": [
6
{
7
"x": 12,
8
"y": 15
9
},
10
{
11
"x": 178,
12
"y": 151
13
},
14
{
15
"x": 122,
16
"y": 196
17
},
18
{
19
"x": 112,
20
"y": 10
21
},
22
23
]
24
}
25
}
26
]
27
dataset.add_annotation("awsm_pic.jpg", True, data=data)
Copied!
  • Q&A
1
data = [
2
{
3
"type": "polygon",
4
"label" : "rose",
5
"polygon": {
6
"geometry": [
7
{
8
"x": 12,
9
"y": 15
10
},
11
{
12
"x": 178,
13
"y": 151
14
},
15
{
16
"x": 122,
17
"y": 196
18
},
19
{
20
"x": 112,
21
"y": 10
22
},
23
24
],
25
26
},
27
"qa": [{
28
"type": "text",
29
"question": "What color ?",
30
"answer": "red"
31
32
},
33
{
34
"type": "mc",
35
"question": "What color ?",
36
"answer": ["red"],
37
"choices": ["red", "yellow", "blue"]
38
},
39
{
40
"type": "select",
41
"question": "Is it raining ?",
42
"answer": "yes",
43
"choices": ["yes", "no"]
44
},
45
{
46
"type": "range",
47
"question": "size ?",
48
"answer": 68,
49
"max": 100,
50
"min": 0
51
}]
52
}
53
]
54
​
55
image_qa = [
56
{
57
"type": "text",
58
"question": "How much is the image rotated ?",
59
"answer": "approx. 32 deg."
60
},
61
{
62
"type": "mc",
63
"question": "image attribute",
64
"answer": ["high contrast"],
65
"choices": ["high contrast", "saturated"]
66
},
67
{
68
"type": "select",
69
"question": "image color",
70
"answer": "blue",
71
"choices": ["red", "blue", "green"]
72
},
73
{
74
"type": "range",
75
"question": "brigthness",
76
"answer": 36,
77
"max": 100,
78
"min": 0
79
},
80
]
81
ds.add_annotation("awsm_pic.jpg", True, data=data, image_qa=image_qa)
Copied!

Network

Networks are trained architectures that you can either deploy for inference (if available), use to start new experiments and share within your Organization's models.

The Network object

1
{'organization': {'name': 'picsell'},
2
'model_id': 'b76ececa-274d-48de-b39e-70cf73941aba',
3
'serving_id': 'b76ececa-274d-48de-b39e-70cf73941aba',
4
'tag': ['efficientdet', 'd2', 'COCO', 'base'],
5
'private': False,
6
'network_name': 'efficientdet-d2',
7
'description': 'This is a real game changer',
8
'model_object_name': '',
9
'checkpoint_object_name': '',
10
'origin_checkpoint_objects': {},
11
'type': 'detection',
12
'files': {'config': 'b76ececa-274d-48de-b39e-70cf73941aba/pipeline.config',
13
'model-latest': 'b76ececa-274d-48de-b39e-70cf73941aba/0/saved_model.zip',
14
'checkpoint-data-latest': 'b76ececa-274d-48de-b39e-70cf73941aba/ckpt-0.data-00000-of-00001',
15
'checkpoint-index-latest': 'b76ececa-274d-48de-b39e-70cf73941aba/ckpt-0.index'},
16
'thumb_object_name': 'b76ececa-274d-48de-b39e-70cf73941aba/effdet.png',
17
'framework': 'tensorflow2'
18
}
Copied!

Attributes

  • model_id (string) Unique identifier of your model
  • owner (hash, user_object) The creator of the model
  • network_name (string) The name of your model
  • description (string) A short description of what your model does
  • type (string) The type of application for your model, if you want to perform pre-annotation on Picsellia it has to be one of the following (but you can set your own type otherwise):
    • 'detection'
    • 'segmentation'
    • 'classification'
  • organization (hash, organization object) The organization under which your model is stored
  • private (boolean) Tells if your model is available for everyone in the public HUB or not
  • framework (string) The framework used for training
    • 'tensorflow1'
    • 'tensorflow2'
    • 'pytorch'
  • tag (list) List of tags to identify and sort your models
  • files (dict) Dictionary containing the list of files of your model
  • labels (dict) Dictionary of the labelmap of your model
  • base_parameters (dict) Dictionary of the base parameters allowing anyone to reproduce the training or iterate with already existing parameters
  • readme_text (str) A markdown text containing more information about your model

__init__

If you want to interact with your models, you have to initialize the Network class. It is a subclass of the Client.
1
from picsellia.client import Client
2
​
3
network = Client.Network(
4
api_token=None,
5
organization=None,
6
)
Copied!

Arguments:

  • api_token (string) Your personal API token
  • organization (string, optional) the name of the organization you want to work with (None default to your organization)

list

List of all the models for an organization
By default it will list the models of your own organization but you can specify the name of another organization where you are part of the team.
1
network.list()
Copied!

Returns:

A list containing the models of the chosen organization.
1
[
2
{'organization': {'name': 'picsell'},
3
'model_id': 'b76ececa-274d-48de-b39e-70cf73941aba',
4
'serving_id': 'b76ececa-274d-48de-b39e-70cf73941aba',
5
'tag': ['efficientdet', 'd2', 'COCO', 'base'],
6
'private': False,
7
'network_name': 'efficientdet-d2',
8
'description': 'This is a real game changer',
9
'model_object_name': '',
10
'checkpoint_object_name': '',
11
'origin_checkpoint_objects': {},
12
'type': 'detection',
13
'files': {'config': 'b76ececa-274d-48de-b39e-70cf73941aba/pipeline.config',
14
'model-latest': 'b76ececa-274d-48de-b39e-70cf73941aba/0/saved_model.zip',
15
'checkpoint-data-latest': 'b76ececa-274d-48de-b39e-70cf73941aba/ckpt-0.data-00000-of-00001',
16
'checkpoint-index-latest': 'b76ececa-274d-48de-b39e-70cf73941aba/ckpt-0.index'},
17
'thumb_object_name': 'b76ececa-274d-48de-b39e-70cf73941aba/effdet.png',
18
'framework': 'tensorflow2'
19
},
20
{'organization': {'name': 'picsell'},
21
'model_id': 'b76ececa-274d-48de-b39e-70cf73941aba',
22
'serving_id': 'b76ececa-274d-48de-b39e-70cf73941aba',
23
'tag': None,
24
'private': True,
25
'network_name': 'vizdrone-test',
26
'description': 'This is a real game changer',
27
'model_object_name': '',
28
'checkpoint_object_name': '',
29
'origin_checkpoint_objects': {},
30
'type': 'detection',
31
'files': {'config': 'b76ececa-274d-48de-b39e-70cf73941aba/pipeline.config',
32
'model-latest': 'b76ececa-274d-48de-b39e-70cf73941aba/0/saved_model.zip',
33
'checkpoint-data-latest': 'b76ececa-274d-48de-b39e-70cf73941aba/ckpt-101.data-00000-of-00001',
34
'checkpoint-index-latest': 'b76ececa-274d-48de-b39e-70cf73941aba/ckpt-101.index'},
35
'thumb_object_name': '',
36
'framework': ''
37
}
38
]
Copied!

get

This method allows you to retrieve a particular model in order to update it or store some files.
1
network.get(identifier=None)
Copied!

Arguments:

  • identifier (string) Either the name or the id of the model you want to retrieve

Returns:

The Network object

create

This methods allows you to create a new Network from the SDK
1
network.create(
2
name=None,
3
type=None
4
)
Copied!

Attributes:

  • name (str, required) The name of your Network
  • type (str, required) the type of your Network, it is the task it performs such as :
    • 'detection', for object detection
    • 'segmentation', for object segmentation
    • 'classification', for image classification

Returns:

Network object

update

This methods allows you to update the properties of a Network from your Organization
You must get or create a network before calling the update method.
1
network.update(**kwargs)
Copied!

Arguments:

  • **kwargs (required) can be any property from the Network object described in the Network Object.
For example, if you want to update the description of your Network, you code will look like this :
1
network.update(description="A brand new description for your Network")
Copied!
You can update as many properties as you want in one single time.

store

This method allows you to upload a file and save it under your model so you can use it later such as checkpoint files or config files.
1
network.store(name="", path=None, zip=False)
Copied!

Arguments:

  • name (string,) the name of the file, please check this page to know about the Picsellia namespace
  • path (string, optional) the path to the file you want to upload
  • zip (boolean, optional) set to True if you want to zip your file or a folder to an archive before upload

update_thumb

This method allows you to set the image of your choice as the thumbnail displayed on the platform like below.
1
network.update_thumb(path=None)
Copied!

Arguments:

  • path (string) the path to the image file

labels

This methods allows you to set the labelmap of your model.
1
network.labels(labels=None)
Copied!

Arguments:

  • labels (dict) Dictionary containing your labelmap (index starts at 1 not 0)
Here is the COCO labelmap as example :
1
labels = {
2
"1": "person",
3
"2": "bicycle",
4
"3": "car",
5
"4": "motorcycle",
6
"5": "airplane",
7
...
8
"86": "vase",
9
"87": "scissors",
10
"88": "teddy bear",
11
"89": "hair drier",
12
"90": "toothbrush"
13
}
Copied!

Returns:

None

Projects

The Project object

1
{
2
"organization": {
3
"name": "pierre-nicolas"
4
},
5
"project_name": "test-logging",
6
"description": "No description",
7
"project_id": "3d039f84-7224-4442-b499-652f2f77f1a1",
8
"project_manager": {
9
"username": "pierre-nicolas"
10
},
11
"contributors": [
12
{
13
"user": {
14
"username": "pierre-nicolas"
15
},
16
"is_active": True,
17
"creation_date": "2021-01-18T12:08:51.573406Z"
18
}
19
],
20
"datasets": [
21
{
22
"dataset_name": "paginate",
23
"description": "",
24
"private": True
25
}
26
],
27
"type": "classification",
28
"creation_date": "2021-06-16"
29
}
Copied!

Attributes:

  • organization (hash) The parent organization of the project
  • project_name (string) The name of the project
  • description (string) A brief description of the project
  • project_id (UUID) The unique ID of the project
  • project_manager (hash) The user that created the project
  • contributors (hash) The list of worker objects for contributors of this project
  • datasets (hash) Short dataset objects for datasets attached to the project
  • type (string) Type of the project, you can set it arbitrarily
  • creation_date (string) Date of creation of this project

__init__

If you want to interact with your projects, you must initialize the Project class for our client.
1
from picsellia.client import Client
2
​
3
clt = Client.Project(
4
api_token=None,
5
host="https://app.picsellia.com/sdk/",
6
project_token=None,
7
)
Copied!

Arguments:

  • api_token (string) Your personal API Token
  • host (string) The URL of Picsellia platform, you shouldn't have to change it
  • project_token (string) The token of the project you want work with (you can also let None and use get() or create() methods later)

Returns:

None

list

This method allows you to list every project in your organization.
1
project_list = clt.list()
Copied!
1
Project Name: scans-file
2
Description: No description
3
Contributors: [{'user': {'username': 'pierre-nicolas'}, 'is_active': True, 'creation_date': '2021-01-18T12:08:51.573406Z'}]
4
Datasets: [{'dataset_name': 'public', 'description': None, 'private': True}, {'dataset_name': 'paginate', 'description': '', 'private': True}]
5
-------------
6
Project Name: scan-file2
7
Description: This is a real game changer
8
Contributors: [{'user': {'username': 'pierre-nicolas'}, 'is_active': True, 'creation_date': '2021-01-18T12:08:51.573406Z'}]
9
Datasets: []
10
-------------
11
Project Name: test-logging
12
Description: No description
13
Contributors: [{'user': {'username': 'pierre-nicolas'}, 'is_active': True, 'creation_date': '2021-01-18T12:08:51.573406Z'}]
14
Datasets: [{'dataset_name': 'tttt', 'description': 'None', 'private': True}, {'dataset_name': 'paginate', 'description': '', 'private': True}]
15
-------------
16
Project Name: long-projet
17
Description: No description
18
Contributors: [{'user': {'username': 'pierre-nicolas'}, 'is_active': True, 'creation_date': '2021-01-18T12:08:51.573406Z'}]
19
Datasets: [{'dataset_name': 'confusion', 'description': None, 'private': True}]
20
-------------
21
​
22
... 10 more...
23
​
24
Project Name: Benchmark-sdk
25
Description: No description
26
Contributors: [{'user': {'username': 'pierre-nicolas'}, 'is_active': True, 'creation_date': '2021-01-18T12:08:51.573406Z'}]
27
Datasets: [{'dataset_name': 'cloned', 'description': 'None', 'private': True}]
28
-------------
Copied!
The project list is also stored in the project_list attribute in the Project object you instantiated so you can access it as shown below πŸ‘‡
1
clt.project_list
Copied!
1
[{'contributors': [{'creation_date': '2021-01-18T12:08:51.573406Z',
2
'is_active': True,
3
'user': {'username': 'pierre-nicolas'}}],
4
'creation_date': '2021-04-20',
5
'datasets': [{'dataset_name': 'public',
6
'description': None,
7
'private': True},
8
{'dataset_name': 'paginate', 'description':