annotation_specs list_attribute#

Description#

アノテーション仕様の属性情報を出力します。

Examples#

$ annofabcli annotation_specs list_attribute --project_id prj1 --output out.csv

出力結果#

JSON出力#

$ annofabcli annotation_specs list_attribute --project_id prj1  --format pretty_json --output out.json
out.json#
[
{
    "attribute_id": "0f739b17-c22b-4f4a-a791-d142eb0bcd41",
    "attribute_name_en": "truncation",
    "attribute_name_ja": "truncation",
    "attribute_name_vi": "truncation",
    "type": "flag",
    "default": false,
    "read_only": false,
    "choice_count": 0,
    "restriction_count": 0,
    "reference_label_count": 2,
    "keybind": "Ctrl+Digit1"
},
{
    "attribute_id": "a0f7c8ed-38dc-41e6-a18c-29a36d3e28f2",
    "attribute_name_en": "direction",
    "attribute_name_ja": "車の向き",
    "attribute_name_vi": "direction",
    "type": "select",
    "default": "f98a9545-5864-4e5b-a945-d327001a0179",
    "read_only": false,
    "choice_count": 6,
    "restriction_count": 1,
    "reference_label_count": 2,
    "keybind": ""
}
]
  • attribute_id : 属性ID。WebAPIの additional_data_definition_id または definition_id に対応しています。

  • attribute_name_en : 属性名(英語)。

  • attribute_name_ja : 属性名(日本語)。

  • attribute_name_vi : 属性名(ベトナム語)。

  • attribute_type : 属性の種類。WebAPIの AdditionalDataDefinitionType に対応しています。 type の値は以下のいずれかです。

    • flag : チェックボックス

    • integer : 整数

    • text : 自由記述(1行)

    • comment : 自由記述(複数行)

    • choice : ラジオボタン(排他選択)

    • select : ドロップダウン(排他選択)

    • tracking : トラッキングID

    • link : アノテーションリンク

  • default : 属性の初期値。属性の種類がラジオボタンまたはドロップダウンの場合は、初期値として選択されている項目の choice_id です。

  • read_only : 読み込み専用の属性か否か。

  • choice_count : 選択肢の個数。ドロップダウン属性またはラジオボタン属性以外では0個です。

  • restriction_count : 制約の個数。

  • reference_label_count : 参照されているラベルの個数

  • keybind : キーボードショートカット

Usage Details#

アノテーション仕様の属性情報を出力します。

usage: annofabcli annotation_specs list_attribute [-h] [--yes]
                                                  [--endpoint_url ENDPOINT_URL]
                                                  [--annofab_user_id ANNOFAB_USER_ID]
                                                  [--annofab_password ANNOFAB_PASSWORD]
                                                  [--annofab_pat ANNOFAB_PAT]
                                                  [--logdir LOGDIR]
                                                  [--disable_log] [--debug]
                                                  (-p PROJECT_ID | --annotation_specs_json ANNOTATION_SPECS_JSON)
                                                  [--history_id HISTORY_ID | --before BEFORE]
                                                  [-f {csv,json,pretty_json}]
                                                  [-o OUTPUT]

Named Arguments#

-p, --project_id

対象のプロジェクトのproject_idを指定します。APIで取得したアノテーション仕様情報を元に出力します。

--annotation_specs_json

指定したアノテーション仕様のJSONファイルを指定します。JSONファイルに記載された情報を元に出力します。ただしアノテーション仕様の format_version3 である必要があります。

--history_id

出力したいアノテーション仕様のhistory_idを指定してください。 history_idは annotation_specs list_history コマンドで確認できます。 指定しない場合は、最新のアノテーション仕様が出力されます。

--before

出力したい過去のアノテーション仕様が、最新よりいくつ前のアノテーション仕様であるかを指定してください。 たとえば 1 を指定した場合、最新より1個前のアノテーション仕様を出力します。 指定しない場合は、最新のアノテーション仕様が出力されます。

-f, --format

Possible choices: csv, json, pretty_json

出力フォーマット

Default: 'csv'

-o, --output

出力先のファイルパスを指定します。未指定の場合は、標準出力に出力されます。

global optional arguments#

--yes

処理中に現れる問い合わせに対して、常に yes と回答します。

--endpoint_url

Annofab WebAPIのエンドポイントを指定します。

Default: 'https://annofab.com'

--annofab_user_id

Annofabにログインする際のユーザーID

--annofab_password

Annofabにログインする際のパスワード

--annofab_pat

Annofabにログインする際のパーソナルアクセストークン

--logdir

ログファイルを保存するディレクトリを指定します。

Default: .log

--disable_log

ログを無効にします。

--debug

HTTPリクエストの内容やレスポンスのステータスコードなど、デバッグ用のログが出力されます。