Close pool

Close an opened pool in Toloka.

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. Close pool

Find out the ID of the pool you want to close. Then call the close_pool() method.

closed_pool = toloka_client.
close_pool
('1443858')

4. Print pool ID and status

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

print(closed_pool.id, closed_pool.status)

You should get an output with the pool ID and the updated status which looks like this.

1443858 Status.CLOSED

Complete code: Close pool

import toloka.client as toloka
toloka_client = toloka.TolokaClient('PlaceYourRealApiKey_Here', 'PRODUCTION')
closed_pool = toloka_client.close_pool('1443858')
print(closed_pool.id, closed_pool.status)
List of classes and methods used in this recipe

See also

[*close_pool]: close_pool() method

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