annofabcli


Nameannofabcli JSON
Version 1.83.1 PyPI version JSON
download
home_pagehttps://github.com/kurusugawa-computer/annofab-cli
SummaryUtility Command Line Interface for AnnoFab
upload_time2024-03-21 07:04:34
maintainerNone
docs_urlNone
authoryuji38kwmt
requires_python<4.0,>=3.8
licenseMIT
keywords annofab cli
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            # 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`が実行ファイルになります。


## Dockerを利用する場合

```
$ git clone https://github.com/kurusugawa-computer/annofab-cli.git
$ cd annofab-cli
$ chmod u+x docker-build.sh
$ ./docker-build.sh

$ docker run -it annofab-cli --help

# Annofabの認証情報を標準入力から指定する
$ docker run -it annofab-cli project diff prj1 prj2
Enter Annofab User ID: XXXXXX
Enter Annofab Password: 

# Annofabの認証情報を環境変数で指定する
$ docker run -it -e ANNOFAB_USER_ID=XXXX -e ANNOFAB_PASSWORD=YYYYY annofab-cli project diff prj1 prj2
```


## 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/18/7a/4ccc9b598da374dcad03d900e33ace2028c194b250a2c8af8f42e5b2e7f3/annofabcli-1.83.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## Docker\u3092\u5229\u7528\u3059\u308b\u5834\u5408\n\n```\n$ git clone https://github.com/kurusugawa-computer/annofab-cli.git\n$ cd annofab-cli\n$ chmod u+x docker-build.sh\n$ ./docker-build.sh\n\n$ docker run -it annofab-cli --help\n\n# Annofab\u306e\u8a8d\u8a3c\u60c5\u5831\u3092\u6a19\u6e96\u5165\u529b\u304b\u3089\u6307\u5b9a\u3059\u308b\n$ docker run -it annofab-cli project diff prj1 prj2\nEnter Annofab User ID: XXXXXX\nEnter Annofab Password: \n\n# Annofab\u306e\u8a8d\u8a3c\u60c5\u5831\u3092\u74b0\u5883\u5909\u6570\u3067\u6307\u5b9a\u3059\u308b\n$ docker run -it -e ANNOFAB_USER_ID=XXXX -e ANNOFAB_PASSWORD=YYYYY annofab-cli project diff prj1 prj2\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.83.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": "9c526a9fcafca4fe02291d7985d732246a693e186465eae35b294d9165b21d8e",
                "md5": "33d98c4729415322404090ce9f9466cd",
                "sha256": "e98aec723b14772058d9a137030ecd6faa48fcfaedd730aac2367ba70616359c"
            },
            "downloads": -1,
            "filename": "annofabcli-1.83.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "33d98c4729415322404090ce9f9466cd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 426642,
            "upload_time": "2024-03-21T07:04:29",
            "upload_time_iso_8601": "2024-03-21T07:04:29.312884Z",
            "url": "https://files.pythonhosted.org/packages/9c/52/6a9fcafca4fe02291d7985d732246a693e186465eae35b294d9165b21d8e/annofabcli-1.83.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "187a4ccc9b598da374dcad03d900e33ace2028c194b250a2c8af8f42e5b2e7f3",
                "md5": "7cc7afb69be9317ba75b8853f8319b2a",
                "sha256": "47cae9bd5b22ab09429623740705ced16e90605d0afa7ab90ea7129f443bea56"
            },
            "downloads": -1,
            "filename": "annofabcli-1.83.1.tar.gz",
            "has_sig": false,
            "md5_digest": "7cc7afb69be9317ba75b8853f8319b2a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 252824,
            "upload_time": "2024-03-21T07:04:34",
            "upload_time_iso_8601": "2024-03-21T07:04:34.673980Z",
            "url": "https://files.pythonhosted.org/packages/18/7a/4ccc9b598da374dcad03d900e33ace2028c194b250a2c8af8f42e5b2e7f3/annofabcli-1.83.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-21 07:04:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kurusugawa-computer",
    "github_project": "annofab-cli",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": true,
    "lcname": "annofabcli"
}
        
Elapsed time: 0.20673s