Edit project

Change the project public description using Toloka-Kit.

Steps to follow

1. Import Toloka-Kit

Connect the Toloka-Kit library to your script.

import toloka.client as toloka

2. Instantiate TolokaClient

Replace the sample API key with your own one.

toloka_client = toloka.
TolokaClient
('PlaceYourRealApiKey_Here', 'PRODUCTION');

3. Get project

Find out the ID of the project which you want to modify. Then create a local copy of the project object calling the get_project() method.

project = toloka_client.
get_project
('118252')
Important

All the code manipulations at steps 3–4 occur in your device memory. The data will only be sent to the server after calling the update_project() method at step 5.

4. Set project new name

Specify a new public name that the Tolokers will see. You can choose to change some other project data. Refer to the Project class to see what other attributes it has.

project.public_name = "Elephant color (advanced)"

5. Modify project on platform

This actually updates the project data in Toloka.

updated_project = toloka_client.
update_project
(project.id, project)

6. Display modifications

The update_project() request will return the Project class object. You can use its attributes to print the information you need.

print(updated_project.public_name)

You should get an output with the updated project name which looks like this.

Elephant color (advanced)

Complete code: Edit project

import toloka.client as toloka
toloka_client = toloka.TolokaClient('PlaceYourRealApiKey_Here', 'PRODUCTION')
project = toloka_client.get_project('118252')
project.public_name = "Elephant color (advanced)"
updated_project = toloka_client.update_project(project.id, project)
print(updated_project.public_name)
List of classes and methods used in this recipe

See also

Last updated: February 7, 2023

Toloka-Kit
OverviewGetting API keyQuick start
Recipes
Reference
toloka.client
toloka.async_client
toloka.autoquality [autoquality]
toloka.metrics
toloka.streaming