Metadata-Version: 2.1
Name: sber-tagme-crowd-sdk
Version: 4.10.2.post2
Summary: Crowdsourcing clients and automatization tools. Select extras to install modules, e.g. `pip install crowd-sdk[cv,db,aggregation,cloud,full]`. Read README.md for more information.
Home-page: https://tagme.sberdevices.ru/docs/sdk/python-sdk.html
Author: Sergey Gorelov
Author-email: tagme_help@sberbank.ru
License: UNKNOWN
Project-URL: Documentation, https://tagme.sberdevices.ru/docs/sdk/python-sdk.html
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development
Classifier: Typing :: Typed
Description-Content-Type: text/markdown
Requires-Dist: aiohttp (>=3.9.2)
Requires-Dist: aiofiles (>=0.8)
Requires-Dist: aioprometheus (==20.0.*)
Requires-Dist: aioresponses (>=0.7)
Requires-Dist: dacite (>=1.6)
Requires-Dist: pyyaml (>=6.0)
Requires-Dist: PyJWT (==2.8.0)
Requires-Dist: requests (!=2.30.0,>=2.27)
Requires-Dist: tqdm (>=4.62)
Requires-Dist: click (>=8.0)
Requires-Dist: pandas (>=1.1.5)
Requires-Dist: nest-asyncio (>=1.5.4)
Requires-Dist: python-Levenshtein (>=0.20.9)
Requires-Dist: sentry-sdk (>=1.18.0)
Requires-Dist: typing-extensions
Requires-Dist: pytz
Provides-Extra: aggregation
Requires-Dist: sacremoses (==0.0.53) ; extra == 'aggregation'
Requires-Dist: tokenizers (==0.14.1) ; extra == 'aggregation'
Requires-Dist: scipy (==1.10.1) ; extra == 'aggregation'
Requires-Dist: numpy (==1.24.3) ; extra == 'aggregation'
Requires-Dist: safetensors (==0.3.1) ; extra == 'aggregation'
Requires-Dist: crowd-kit (==1.0.0) ; extra == 'aggregation'
Provides-Extra: cloud
Requires-Dist: boto3 (<=1.24,>=1.09) ; extra == 'cloud'
Requires-Dist: botocore (<=1.27.59,>=1.12.253) ; extra == 'cloud'
Requires-Dist: pycryptodomex (==3.15.0) ; extra == 'cloud'
Requires-Dist: pycryptodome (==3.16.0) ; extra == 'cloud'
Provides-Extra: cv
Requires-Dist: Pillow (>=9.1.0) ; extra == 'cv'
Requires-Dist: MarkupSafe (<=2.1.1,>=2.0.1) ; extra == 'cv'
Requires-Dist: pymupdf (==1.19.2) ; extra == 'cv'
Provides-Extra: db
Requires-Dist: psycopg2-binary (==2.9.1) ; extra == 'db'
Provides-Extra: dev
Requires-Dist: black (==22.6.0) ; extra == 'dev'
Requires-Dist: isort (==5.10.1) ; extra == 'dev'
Requires-Dist: mypy (==0.931) ; extra == 'dev'
Requires-Dist: types-dataclasses (==0.6.4) ; extra == 'dev'
Requires-Dist: allure-pytest (==2.9.45) ; extra == 'dev'
Requires-Dist: pytest (==6.2.5) ; extra == 'dev'
Requires-Dist: pytest-asyncio (>=0.16) ; extra == 'dev'
Requires-Dist: pytest-aiohttp (==0.3.0) ; extra == 'dev'
Requires-Dist: pytest-skip-slow (==0.0.5) ; extra == 'dev'
Requires-Dist: pytest-timeout (==1.4.2) ; extra == 'dev'
Requires-Dist: flaky (==3.7.0) ; extra == 'dev'
Requires-Dist: setuptools (==59.6.0) ; extra == 'dev'
Requires-Dist: pylint (==2.12.2) ; (python_version < "3.11") and extra == 'dev'
Requires-Dist: pylint (==2.17.7) ; (python_version >= "3.11") and extra == 'dev'
Provides-Extra: fixed
Requires-Dist: aiohttp (~=3.9.2) ; extra == 'fixed'
Requires-Dist: aiofiles (~=0.8) ; extra == 'fixed'
Requires-Dist: aioresponses (~=0.7) ; extra == 'fixed'
Requires-Dist: dacite (~=1.6) ; extra == 'fixed'
Requires-Dist: pyyaml (~=6.0) ; extra == 'fixed'
Requires-Dist: requests (!=2.30.0,~=2.27) ; extra == 'fixed'
Requires-Dist: tqdm (~=4.62) ; extra == 'fixed'
Requires-Dist: click (>=8.0) ; extra == 'fixed'
Requires-Dist: pandas (==1.1.5) ; extra == 'fixed'
Requires-Dist: nest-asyncio (==1.5.4) ; extra == 'fixed'
Requires-Dist: python-Levenshtein (~=0.20.9) ; extra == 'fixed'
Requires-Dist: sentry-sdk (~=1.18.0) ; extra == 'fixed'
Requires-Dist: numpy (==1.24.3) ; extra == 'fixed'
Requires-Dist: pyarrow (==17.0.0) ; extra == 'fixed'
Provides-Extra: full
Requires-Dist: boto3 (<=1.24,>=1.09) ; extra == 'full'
Requires-Dist: botocore (<=1.27.59,>=1.12.253) ; extra == 'full'
Requires-Dist: pycryptodomex (==3.15.0) ; extra == 'full'
Requires-Dist: pycryptodome (==3.16.0) ; extra == 'full'
Requires-Dist: psycopg2-binary (==2.9.1) ; extra == 'full'
Requires-Dist: sacremoses (==0.0.53) ; extra == 'full'
Requires-Dist: tokenizers (==0.14.1) ; extra == 'full'
Requires-Dist: scipy (==1.10.1) ; extra == 'full'
Requires-Dist: numpy (==1.24.3) ; extra == 'full'
Requires-Dist: safetensors (==0.3.1) ; extra == 'full'
Requires-Dist: crowd-kit (==1.0.0) ; extra == 'full'
Requires-Dist: Pillow (>=9.1.0) ; extra == 'full'
Requires-Dist: MarkupSafe (<=2.1.1,>=2.0.1) ; extra == 'full'
Requires-Dist: pymupdf (==1.19.2) ; extra == 'full'
Requires-Dist: black (==22.6.0) ; extra == 'full'
Requires-Dist: isort (==5.10.1) ; extra == 'full'
Requires-Dist: mypy (==0.931) ; extra == 'full'
Requires-Dist: types-dataclasses (==0.6.4) ; extra == 'full'
Requires-Dist: allure-pytest (==2.9.45) ; extra == 'full'
Requires-Dist: pytest (==6.2.5) ; extra == 'full'
Requires-Dist: pytest-asyncio (>=0.16) ; extra == 'full'
Requires-Dist: pytest-aiohttp (==0.3.0) ; extra == 'full'
Requires-Dist: pytest-skip-slow (==0.0.5) ; extra == 'full'
Requires-Dist: pytest-timeout (==1.4.2) ; extra == 'full'
Requires-Dist: flaky (==3.7.0) ; extra == 'full'
Requires-Dist: setuptools (==59.6.0) ; extra == 'full'
Requires-Dist: pylint (==2.12.2) ; (python_version < "3.11") and extra == 'full'
Requires-Dist: pylint (==2.17.7) ; (python_version >= "3.11") and extra == 'full'
Provides-Extra: mcp
Requires-Dist: mcp ; extra == 'mcp'

# <a name="main"></a> Crowd-SDK Python

[TagMe](https://tagme.sberdevices.ru/) • [API Documentation](https://tagme.sberdevices.ru/docs/sdk/rest-api.html) • [Docs](https://tagme.sberdevices.ru/docs/customer/index.html)
SDK для Python — это набор компонент для разработки пайплайнов обработки данных и взаимодействия с сервисами разметки.

Requirements
--------------
- Python 3.6 для базовой версии (без telegram и без aggregation)
- Python 3.8 для полной версии `pip install crowd-sdk[full]`
- Нужно зарегистрироваться как заказчик в TagMe или Toloka. ([TagMe](https://confluence.sberbank.ru/pages/viewpage.action?pageId=5034259260)).
- Для того, чтобы создавать и запускать задания вам необходим бюджет или выделенные разметчики. ([TagMe список ответственных в блоках](https://confluence.sberbank.ru/pages/viewpage.action?pageId=5368189653)).

### Обновляем инструменты управления пакетами
```
pip install --upgrade pip setuptools wheel
```

Get started TagMe
--------------
```shell
pip install crowd-sdk
```

###
<details>
  <summary>Клиент TagMe, как и cli скрипты конфигурируются через config файл

По умолчанию SDK ищет файл по такому пути: ~/.crowd.cfg</summary>

Если вы хотите работать с несколькими стендами платформы, с множеством аккаунтов/организаций, то можно сделать несколько конфигов и запускать скрипты указывая конфиги через `-c, --config` либо задавая env `CROWD_CONFIG=`

```shell
cat ~/.crowd.cfg
# TagMe credentials, stand manage endpoint url
tagme:
 stand: cloud_prom
 user: <user login>
 password: <user password>
```

Значения url + auth_url стоят в приоритете, но если их не указывать, то можно воспользоваться переменной stand.
Возможные значения stand:
* 'cloud_prom'


Вместо указания стенда можно указывать напрямую url + auth_url в текущей сети. Например для описанных стендов это будет:

```shell
cloud_prom
 url: "https://tagme.sberdevices.ru"
 auth_url: "https://tagme.sberdevices.ru"
```

</details>

# Использование клиента TagMe

Пример создания проекта:

```python
from crowd_sdk.tagme import ProjectConfig, TagmeClientAdvanced

client = TagmeClientAdvanced()
test_pools = ['test pool id', ...]
config = ProjectConfig(
    css='.* {}',
    html='<div>Test interface</div>',
    javascript='alert("test");',
    example={'filename': ''},
    instruction='Тестовая инструкция',
    project_name='py.test example project',

    pools=test_pools,
    overlap=1,
    data_dir='./data',
    task_name='Задача',
    description='Описание задачи',
)
project_id, task = await client.create_project_and_task(config)
```

Выгрузка датасета из проекта с помощью cli утилиты:
```shell
download-task-results --destination task_result.json --task-id "2745350b-d003-4c55-8567-816505d6140d"
```

## [Больше примеров работы с кодом](examples/0.tagme_getting_started/README.md)
  - Создание проекта
  - Загрузка данных
  - Выбор исполнителей
  - Скачивание результатов
  - Агрегация

## [Примеры работы с консольными утилитами](crowd_sdk/tagme/cli/README.md)
  - Скачать результаты разметки по id задания в указанный путь
  - Сделать расширенный отчет по результатам разметки (с именами исполнителей)
  - Скачать исходные данные для разметки по id задания в указанную папку
  - Склонировать проект с задачами и перенести туда еще не размеченные задания, напишет ссылку на новый проект
  - Загрузить данные из папки в задачу

Contributing
-------
[Будем рады любой помощи.](CONTRIBUTING.md)


