# annofab-cli
[Annofab](https://annofab.com/)のCLI(Command Line Interface)ツールです。
「タスクの一括差し戻し」や、「タスク一覧出力」など、Annofabの画面で実施するには時間がかかる操作を、コマンドとして提供しています。
[![Build Status](https://app.travis-ci.com/kurusugawa-computer/annofab-cli.svg?branch=main)](https://app.travis-ci.com/kurusugawa-computer/annofab-cli)
[![PyPI version](https://badge.fury.io/py/annofabcli.svg)](https://badge.fury.io/py/annofabcli)
[![Python Versions](https://img.shields.io/pypi/pyversions/annofabcli.svg)](https://pypi.org/project/annofabcli/)
[![Documentation Status](https://readthedocs.org/projects/annofab-cli/badge/?version=latest)](https://annofab-cli.readthedocs.io/ja/latest/?badge=latest)
* [Annofab](https://annofab.com/)
* [annofab-cliのドキュメント](https://annofab-cli.readthedocs.io/ja/latest/)
* [開発用ドキュメント](https://github.com/kurusugawa-computer/annofab-cli/blob/main/README_for_developer.md)
# 注意
* 作者または著作権者は、ソフトウェアに関してなんら責任を負いません。
* 予告なく互換性のない変更がある可能性をご了承ください。
* Annofabプロジェクトに大きな変更を及ぼすコマンドも存在します。間違えて実行してしまわないよう、注意してご利用ください。
## 廃止予定
### 2022-11-01 以降
* JMESPathを指定できる `--query`を削除します。使いどころがあまりないのと、`jq`コマンドでも対応できるためです。
* `--wait_options`を削除します。使いどころがあまりないためです。
# Requirements
* Python 3.8+
# Install
```
$ pip install annofabcli
```
https://pypi.org/project/annofabcli/
## Windows用の実行ファイルを利用する場合
[GitHubのリリースページ](https://github.com/kurusugawa-computer/annofab-cli/releases)から`annofabcli-vX.X.X-windows.zip`をダウンロードしてください。
zipの中にある`annofabcli.exe`が実行ファイルになります。
## Annofabの認証情報の設定
https://annofab-cli.readthedocs.io/ja/latest/user_guide/configurations.html 参照
# 使い方
https://annofab-cli.readthedocs.io/ja/latest/user_guide/index.html 参照
# コマンド一覧
https://annofab-cli.readthedocs.io/ja/latest/command_reference/index.html
# よくある使い方
### 受入完了状態のタスクを差し戻す
"car"ラベルの"occluded"属性のアノテーションルールに間違いがあったため、以下の条件を満たすタスクを一括で差し戻します。
* "car"ラベルの"occluded"チェックボックスがONのアノテーションが、タスクに1つ以上存在する。
前提条件
* プロジェクトのオーナが、annofabcliコマンドを実行する
```
# 受入完了のタスクのtask_id一覧を、acceptance_complete_task_id.txtに出力する。
$ annofabcli task list --project_id prj1 --task_query '{"status": "complete","phase":"acceptance"}' \
--format task_id_list --output acceptance_complete_task_id.txt
# 受入完了タスクの中で、 "car"ラベルの"occluded"チェックボックスがONのアノテーションの個数を出力する。
$ annofabcli annotation list_count --project_id prj1 --task_id file://task.txt --output annotation_count.csv \
--annotation_query '{"label_name_en": "car", "attributes":[{"additional_data_definition_name_en": "occluded", "flag": true}]}'
# annotation_count.csvを表計算ソフトで開き、アノテーションの個数が1個以上のタスクのtask_id一覧を、task_id.txtに保存する。
# task_id.txtに記載されたタスクを差し戻す。検査コメントは「carラベルのoccluded属性を見直してください」。
# 差し戻したタスクには、最後のannotation phaseを担当したユーザを割り当てる(画面と同じ動き)。
$ annofabcli task reject --project_id prj1 --task_id file://tasks.txt --cancel_acceptance \
--comment "carラベルのoccluded属性を見直してください"
```
# 補足
# Windowsでannofabcliを使う場合
WindowsのコマンドプロンプトやPowerShellでannofabcliを使う場合、JSON文字列内の二重引用をエスケープする必要があります。
```
> annofabcli task list --project_id prj1 --task_query '{"\status\": \"complete\"}'
```
Raw data
{
"_id": null,
"home_page": "https://github.com/kurusugawa-computer/annofab-cli",
"name": "annofabcli",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": "annofab, cli",
"author": "yuji38kwmt",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/8b/b4/ca4d787fa925d92788ef011700b7b60eb0f08aa5c5651dbe1e6365ca7e43/annofabcli-1.92.1.tar.gz",
"platform": null,
"description": "# annofab-cli\n[Annofab](https://annofab.com/)\u306eCLI(Command Line Interface)\u30c4\u30fc\u30eb\u3067\u3059\u3002\n\u300c\u30bf\u30b9\u30af\u306e\u4e00\u62ec\u5dee\u3057\u623b\u3057\u300d\u3084\u3001\u300c\u30bf\u30b9\u30af\u4e00\u89a7\u51fa\u529b\u300d\u306a\u3069\u3001Annofab\u306e\u753b\u9762\u3067\u5b9f\u65bd\u3059\u308b\u306b\u306f\u6642\u9593\u304c\u304b\u304b\u308b\u64cd\u4f5c\u3092\u3001\u30b3\u30de\u30f3\u30c9\u3068\u3057\u3066\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002\n\n[![Build Status](https://app.travis-ci.com/kurusugawa-computer/annofab-cli.svg?branch=main)](https://app.travis-ci.com/kurusugawa-computer/annofab-cli)\n[![PyPI version](https://badge.fury.io/py/annofabcli.svg)](https://badge.fury.io/py/annofabcli)\n[![Python Versions](https://img.shields.io/pypi/pyversions/annofabcli.svg)](https://pypi.org/project/annofabcli/)\n[![Documentation Status](https://readthedocs.org/projects/annofab-cli/badge/?version=latest)](https://annofab-cli.readthedocs.io/ja/latest/?badge=latest)\n\n\n* [Annofab](https://annofab.com/)\n* [annofab-cli\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8](https://annofab-cli.readthedocs.io/ja/latest/)\n* [\u958b\u767a\u7528\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8](https://github.com/kurusugawa-computer/annofab-cli/blob/main/README_for_developer.md)\n\n\n\n# \u6ce8\u610f\n* \u4f5c\u8005\u307e\u305f\u306f\u8457\u4f5c\u6a29\u8005\u306f\u3001\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306b\u95a2\u3057\u3066\u306a\u3093\u3089\u8cac\u4efb\u3092\u8ca0\u3044\u307e\u305b\u3093\u3002\n* \u4e88\u544a\u306a\u304f\u4e92\u63db\u6027\u306e\u306a\u3044\u5909\u66f4\u304c\u3042\u308b\u53ef\u80fd\u6027\u3092\u3054\u4e86\u627f\u304f\u3060\u3055\u3044\u3002\n* Annofab\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u5927\u304d\u306a\u5909\u66f4\u3092\u53ca\u307c\u3059\u30b3\u30de\u30f3\u30c9\u3082\u5b58\u5728\u3057\u307e\u3059\u3002\u9593\u9055\u3048\u3066\u5b9f\u884c\u3057\u3066\u3057\u307e\u308f\u306a\u3044\u3088\u3046\u3001\u6ce8\u610f\u3057\u3066\u3054\u5229\u7528\u304f\u3060\u3055\u3044\u3002\n\n\n## \u5ec3\u6b62\u4e88\u5b9a\n\n\n### 2022-11-01 \u4ee5\u964d\n* JMESPath\u3092\u6307\u5b9a\u3067\u304d\u308b `--query`\u3092\u524a\u9664\u3057\u307e\u3059\u3002\u4f7f\u3044\u3069\u3053\u308d\u304c\u3042\u307e\u308a\u306a\u3044\u306e\u3068\u3001`jq`\u30b3\u30de\u30f3\u30c9\u3067\u3082\u5bfe\u5fdc\u3067\u304d\u308b\u305f\u3081\u3067\u3059\u3002\n* `--wait_options`\u3092\u524a\u9664\u3057\u307e\u3059\u3002\u4f7f\u3044\u3069\u3053\u308d\u304c\u3042\u307e\u308a\u306a\u3044\u305f\u3081\u3067\u3059\u3002\n\n# Requirements\n* Python 3.8+\n\n# Install\n\n```\n$ pip install annofabcli\n```\n\nhttps://pypi.org/project/annofabcli/\n\n## Windows\u7528\u306e\u5b9f\u884c\u30d5\u30a1\u30a4\u30eb\u3092\u5229\u7528\u3059\u308b\u5834\u5408\n[GitHub\u306e\u30ea\u30ea\u30fc\u30b9\u30da\u30fc\u30b8](https://github.com/kurusugawa-computer/annofab-cli/releases)\u304b\u3089`annofabcli-vX.X.X-windows.zip`\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u304f\u3060\u3055\u3044\u3002\nzip\u306e\u4e2d\u306b\u3042\u308b`annofabcli.exe`\u304c\u5b9f\u884c\u30d5\u30a1\u30a4\u30eb\u306b\u306a\u308a\u307e\u3059\u3002\n\n\n\n## Annofab\u306e\u8a8d\u8a3c\u60c5\u5831\u306e\u8a2d\u5b9a\nhttps://annofab-cli.readthedocs.io/ja/latest/user_guide/configurations.html \u53c2\u7167\n\n# \u4f7f\u3044\u65b9\nhttps://annofab-cli.readthedocs.io/ja/latest/user_guide/index.html \u53c2\u7167\n\n# \u30b3\u30de\u30f3\u30c9\u4e00\u89a7\nhttps://annofab-cli.readthedocs.io/ja/latest/command_reference/index.html\n\n\n# \u3088\u304f\u3042\u308b\u4f7f\u3044\u65b9\n\n### \u53d7\u5165\u5b8c\u4e86\u72b6\u614b\u306e\u30bf\u30b9\u30af\u3092\u5dee\u3057\u623b\u3059\n\"car\"\u30e9\u30d9\u30eb\u306e\"occluded\"\u5c5e\u6027\u306e\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u30eb\u30fc\u30eb\u306b\u9593\u9055\u3044\u304c\u3042\u3063\u305f\u305f\u3081\u3001\u4ee5\u4e0b\u306e\u6761\u4ef6\u3092\u6e80\u305f\u3059\u30bf\u30b9\u30af\u3092\u4e00\u62ec\u3067\u5dee\u3057\u623b\u3057\u307e\u3059\u3002\n* \"car\"\u30e9\u30d9\u30eb\u306e\"occluded\"\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u304cON\u306e\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u304c\u3001\u30bf\u30b9\u30af\u306b1\u3064\u4ee5\u4e0a\u5b58\u5728\u3059\u308b\u3002\n\n\u524d\u63d0\u6761\u4ef6\n* \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30aa\u30fc\u30ca\u304c\u3001annofabcli\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\n\n\n```\n# \u53d7\u5165\u5b8c\u4e86\u306e\u30bf\u30b9\u30af\u306etask_id\u4e00\u89a7\u3092\u3001acceptance_complete_task_id.txt\u306b\u51fa\u529b\u3059\u308b\u3002\n$ annofabcli task list --project_id prj1 --task_query '{\"status\": \"complete\",\"phase\":\"acceptance\"}' \\\n --format task_id_list --output acceptance_complete_task_id.txt\n\n# \u53d7\u5165\u5b8c\u4e86\u30bf\u30b9\u30af\u306e\u4e2d\u3067\u3001 \"car\"\u30e9\u30d9\u30eb\u306e\"occluded\"\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u304cON\u306e\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306e\u500b\u6570\u3092\u51fa\u529b\u3059\u308b\u3002\n$ annofabcli annotation list_count --project_id prj1 --task_id file://task.txt --output annotation_count.csv \\\n --annotation_query '{\"label_name_en\": \"car\", \"attributes\":[{\"additional_data_definition_name_en\": \"occluded\", \"flag\": true}]}'\n\n# annotation_count.csv\u3092\u8868\u8a08\u7b97\u30bd\u30d5\u30c8\u3067\u958b\u304d\u3001\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306e\u500b\u6570\u304c1\u500b\u4ee5\u4e0a\u306e\u30bf\u30b9\u30af\u306etask_id\u4e00\u89a7\u3092\u3001task_id.txt\u306b\u4fdd\u5b58\u3059\u308b\u3002\n\n# task_id.txt\u306b\u8a18\u8f09\u3055\u308c\u305f\u30bf\u30b9\u30af\u3092\u5dee\u3057\u623b\u3059\u3002\u691c\u67fb\u30b3\u30e1\u30f3\u30c8\u306f\u300ccar\u30e9\u30d9\u30eb\u306eoccluded\u5c5e\u6027\u3092\u898b\u76f4\u3057\u3066\u304f\u3060\u3055\u3044\u300d\u3002\n# \u5dee\u3057\u623b\u3057\u305f\u30bf\u30b9\u30af\u306b\u306f\u3001\u6700\u5f8c\u306eannotation phase\u3092\u62c5\u5f53\u3057\u305f\u30e6\u30fc\u30b6\u3092\u5272\u308a\u5f53\u3066\u308b\uff08\u753b\u9762\u3068\u540c\u3058\u52d5\u304d\uff09\u3002\n$ annofabcli task reject --project_id prj1 --task_id file://tasks.txt --cancel_acceptance \\\n --comment \"car\u30e9\u30d9\u30eb\u306eoccluded\u5c5e\u6027\u3092\u898b\u76f4\u3057\u3066\u304f\u3060\u3055\u3044\"\n\n```\n\n# \u88dc\u8db3\n\n# Windows\u3067annofabcli\u3092\u4f7f\u3046\u5834\u5408\nWindows\u306e\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u3084PowerShell\u3067annofabcli\u3092\u4f7f\u3046\u5834\u5408\u3001JSON\u6587\u5b57\u5217\u5185\u306e\u4e8c\u91cd\u5f15\u7528\u3092\u30a8\u30b9\u30b1\u30fc\u30d7\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\n\n```\n> annofabcli task list --project_id prj1 --task_query '{\"\\status\\\": \\\"complete\\\"}'\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Utility Command Line Interface for AnnoFab",
"version": "1.92.1",
"project_urls": {
"Homepage": "https://github.com/kurusugawa-computer/annofab-cli",
"Repository": "https://github.com/kurusugawa-computer/annofab-cli"
},
"split_keywords": [
"annofab",
" cli"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "31c3604bd75eff9792cac39005727a1958b262acb3dfaebe8155142b87f54845",
"md5": "d6c62fb7ca456d2c03902f8d404deacf",
"sha256": "9bb1be56441f602af086f5c6874112ae9a0d658360c3e4813759f89a5a500c18"
},
"downloads": -1,
"filename": "annofabcli-1.92.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d6c62fb7ca456d2c03902f8d404deacf",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 479332,
"upload_time": "2024-12-24T02:03:07",
"upload_time_iso_8601": "2024-12-24T02:03:07.761235Z",
"url": "https://files.pythonhosted.org/packages/31/c3/604bd75eff9792cac39005727a1958b262acb3dfaebe8155142b87f54845/annofabcli-1.92.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8bb4ca4d787fa925d92788ef011700b7b60eb0f08aa5c5651dbe1e6365ca7e43",
"md5": "aa1f59dfeada36468109d1ff5f3d425f",
"sha256": "35943a1374d1dcc101044895961336163d1d2238e8591a0372757577a75520e2"
},
"downloads": -1,
"filename": "annofabcli-1.92.1.tar.gz",
"has_sig": false,
"md5_digest": "aa1f59dfeada36468109d1ff5f3d425f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 284018,
"upload_time": "2024-12-24T02:03:11",
"upload_time_iso_8601": "2024-12-24T02:03:11.655461Z",
"url": "https://files.pythonhosted.org/packages/8b/b4/ca4d787fa925d92788ef011700b7b60eb0f08aa5c5651dbe1e6365ca7e43/annofabcli-1.92.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-24 02:03:11",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kurusugawa-computer",
"github_project": "annofab-cli",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "annofabcli"
}