Edit skill

Modify an existing skill.

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 skill

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

skill = toloka_client.
get_skill
('11294')
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_skill() method at step 5.

4. Set skill new private comment

Specify a new private comment for the skill. You can choose to change some other skill data. Refer to the Skill class to see what other attributes it has.

skill.private_comment = 'Got at least 5 right responses on control tasks with C++ or Python'

5. Modify skill on platform

This actually updates the project data in Toloka.

updated_skill = toloka_client.
update_skill
(skill.id, skill)

6. Display modifications

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

print(updated_skill.id, updated_skill.private_comment)

You should get an output with the updated skill private comment which looks like this.

12648 Got at least 5 right responses on control tasks with C++ or Python

Complete code: Edit skill

import toloka.client as toloka
toloka_client = toloka.TolokaClient('PlaceYourRealApiKey_Here', 'PRODUCTION')
skill = toloka_client.get_skill('11294')
skill.private_comment = 'Got at least 5 right responses on control tasks with C++ or Python'
updated_skill = toloka_client.update_skill(skill.id, skill)
print(updated_skill.id, updated_skill.private_comment)
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