annotation_specs list_attribute#
Description#
アノテーション仕様の属性情報を出力します。
Examples#
$ annofabcli annotation_specs list_attribute --project_id prj1 --output out.csv
過去のアノテーション仕様を出力する方法は、 過去のアノテーション仕様を指定する を参照してください。
出力結果#
CSV出力#
$ annofabcli annotation_specs list_attribute --project_id prj1 --format csv --output out.csv
attribute_id |
attribute_name_en |
attribute_name_ja |
attribute_name_vi |
type |
default |
read_only |
choice_count |
restriction_count |
reference_label_count |
label_ids |
label_name_ens |
keybind |
keybind_text |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0f739b17-c22b-4f4a-a791-d142eb0bcd41 |
truncation |
truncation |
truncation |
flag |
False |
False |
0 |
0 |
2 |
["3bcd28ef-a4f1-42f0-b3d4-3bb74f52d8de", "70d7fd3a-ff17-438c-8e57-187088ed79b1"] |
["car", "truck"] |
{"alt": false, "code": "Digit1", "ctrl": true, "shift": false} |
Ctrl+Digit1 |
a0f7c8ed-38dc-41e6-a18c-29a36d3e28f2 |
direction |
車の向き |
direction |
select |
f98a9545-5864-4e5b-a945-d327001a0179 |
False |
6 |
1 |
2 |
["3bcd28ef-a4f1-42f0-b3d4-3bb74f52d8de", "70d7fd3a-ff17-438c-8e57-187088ed79b1"] |
["car", "truck"] |
CSV形式では、属性の種類は type 列に出力されます。 label_ids 、 label_name_ens 、 keybind はJSON文字列です。
choices はCSV形式では出力されません。
JSON出力#
$ annofabcli annotation_specs list_attribute --project_id prj1 --format pretty_json --output out.json
[
{
"attribute_id": "0f739b17-c22b-4f4a-a791-d142eb0bcd41",
"attribute_name_en": "truncation",
"attribute_name_ja": "truncation",
"attribute_name_vi": "truncation",
"attribute_type": "flag",
"default": false,
"read_only": false,
"choice_count": 0,
"restriction_count": 0,
"reference_label_count": 2,
"label_ids": [
"3bcd28ef-a4f1-42f0-b3d4-3bb74f52d8de",
"70d7fd3a-ff17-438c-8e57-187088ed79b1"
],
"label_name_ens": [
"car",
"truck"
],
"keybind": {
"alt": false,
"code": "Digit1",
"ctrl": true,
"shift": false
},
"keybind_text": "Ctrl+Digit1",
"choices": []
},
{
"attribute_id": "a0f7c8ed-38dc-41e6-a18c-29a36d3e28f2",
"attribute_name_en": "direction",
"attribute_name_ja": "車の向き",
"attribute_name_vi": "direction",
"attribute_type": "select",
"default": "f98a9545-5864-4e5b-a945-d327001a0179",
"read_only": false,
"choice_count": 6,
"restriction_count": 1,
"reference_label_count": 2,
"label_ids": [
"3bcd28ef-a4f1-42f0-b3d4-3bb74f52d8de",
"70d7fd3a-ff17-438c-8e57-187088ed79b1"
],
"label_name_ens": [
"car",
"truck"
],
"keybind": null,
"keybind_text": null,
"choices": [
{
"choice_id": "f98a9545-5864-4e5b-a945-d327001a0179",
"choice_name_en": "front",
"choice_name_ja": "正面",
"choice_name_vi": null,
"is_default": true,
"keybind": {
"alt": false,
"code": "Digit2",
"ctrl": true,
"shift": false
},
"keybind_text": "Ctrl+Digit2"
},
{
"choice_id": "fb3f0d9c-c994-4b7b-b820-95f7d17fb59b",
"choice_name_en": "side",
"choice_name_ja": "側面",
"choice_name_vi": null,
"is_default": false,
"keybind": null,
"keybind_text": null
}
]
}
]
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: トラッキングIDlink: アノテーションリンク
default: 属性の初期値。属性の種類がラジオボタンまたはドロップダウンの場合は、初期値として選択されている項目のchoice_idです。read_only: 読み込み専用の属性か否か。choice_count: 選択肢の個数。ドロップダウン属性またはラジオボタン属性以外では0個です。restriction_count: 制約の個数。reference_label_count: 参照されているラベルの個数label_ids: 参照しているラベルのID一覧。label_name_ens: 参照しているラベルの英語名一覧。keybind: キーボードショートカットのJSONオブジェクトkeybind_text: キーボードショートカットの表示文字列。キーボードショートカットが未設定の場合はnullです。choices: 選択肢情報の配列。属性の種類がラジオボタンまたはドロップダウン以外の場合は空配列です。JSON形式またはpretty_json形式で出力した場合のみ含まれます。各要素のキーは以下の通りです。choice_id: 選択肢ID。choice_name_en: 選択肢名(英語)。choice_name_ja: 選択肢名(日本語)。choice_name_vi: 選択肢名(ベトナム語)。is_default: 初期値として設定されているか否か。keybind: 選択肢に設定されたキーボードショートカットのJSONオブジェクト。keybind_text: 選択肢に設定されたキーボードショートカットの表示文字列。キーボードショートカットが未設定の場合はnullです。
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_file ANNOTATION_SPECS_JSON_FILE)
[--history_id HISTORY_ID | --before BEFORE | --updated_datetime UPDATED_DATETIME]
[-f {csv,json,pretty_json}]
[-o OUTPUT]
Named Arguments#
- -p, --project_id
対象のプロジェクトのproject_idを指定します。APIで取得したアノテーション仕様情報を元に出力します。
- --annotation_specs_json_file
指定したアノテーション仕様のJSONファイルを指定します。JSONファイルに記載された情報を元に出力します。ただしアノテーション仕様の
format_versionは3である必要があります。- --history_id
参照するアノテーション仕様のhistory_id。指定しない場合は最新のアノテーション仕様を参照します。
- --before
参照するアノテーション仕様が最新よりいくつ前かを指定します。たとえば
1は最新より1個前を表します。- --updated_datetime
参照するアノテーション仕様の更新日時をISO 8601形式で指定します。日、分、秒、小数秒の精度で検索し、1件に特定できる必要があります。 タイムゾーンを省略した場合はJSTとして扱います。
- -f, --format
Possible choices: csv, json, pretty_json
出力フォーマット
Default:
'csv'- -o, --output
出力先のファイルパスを指定します。未指定の場合は、標準出力に出力されます。
common options (after the subcommand)#
- --yes
処理中に現れる問い合わせに対して、常に
yesと回答します。- --endpoint_url
Annofab WebAPIのエンドポイントを指定します。
- --annofab_user_id
Annofabにログインする際のユーザーID
- --annofab_password
Annofabにログインする際のパスワード
- --annofab_pat
Annofabにログインする際のパーソナルアクセストークン
- --logdir
ログファイルを保存するディレクトリを指定します。
Default:
.log- --disable_log
ログを無効にします。
- --debug
HTTPリクエストの内容やレスポンスのステータスコードなど、デバッグ用のログが出力されます。