Get list of projects

Get all the projects with a certain status created after a specified date.

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. Print project IDs, titles, and creation dates

Iterate through all the projects with the ACTIVE status created after October 1, 2022, calling the get_projects() method.

from datetime import datetime

for project in toloka_client.
get_projects
(

status='ACTIVE',

created_gte=datetime(2022, 10, 1)):

print(project.id, project.public_name, project.created.date())

You should get an output with the project IDs, titles, and creation dates which looks like this.

119232 Image classification 2022-11-11
120798 Cat or Dog? 2022-11-22
123923 Product Search Relevance 2022-12-12
124269 Verify a business in your city 2022-12-14
126881 Elephant color 2022-12-29

Complete code: Get list of projects

from datetime import datetime
import toloka.client as toloka
toloka_client = toloka.TolokaClient('PlaceYourRealApiKey_Here', 'PRODUCTION')
for project in toloka_client.get_projects(
status='ACTIVE',
created_gte=datetime(2022, 10, 1)):
print(project.id, project.public_name, project.created.date())
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