project list#

Description#

プロジェクト一覧を出力します。

Examples#

基本的な使い方#

--organization に出力対象のプロジェクトが所属する組織名を指定してください。

以下のコマンドは、組織"org1"配下で、自分が所属しているすべてのプロジェクトを出力します。

$ annofabcli project list --organization org1

プロジェクトのタイトルやステータスなどで絞り込み#

--project_query を指定すると、プロジェクトのタイトルやステータスなどで絞り込めます。 --project_query に渡す値は、https://annofab.com/docs/api/#operation/getProjectsOfOrganization のクエリパラメータとほとんど同じです。 さらに追加で、user_id , except_user_id キーも指定できます。

以下のコマンドは、組織"org1"配下で、プロジェクト名に"test"を含むプロジェクト一覧を出力します。

$ annofabcli project list --organization org1 --project_query '{"title":"test"}'

組織"org1"配下で、プロジェクトのステータスが「進行中」のプロジェクト一覧を出力します。

$ annofabcli project list --organization org1 --project_query '{"status": "active"}'

組織"org1"配下で、ユーザ"user1"がプロジェクトメンバとして参加しているプロジェクトの一覧を出力します。

$ annofabcli project list --organization org1 --project_query '{"user_id": "user1"}'

組織"org1"配下で、動画プロジェクトの一覧を出力します。

$ annofabcli project list --organization org1 --project_query '{"input_data_type": "movie"}'

所属していないプロジェクトも出力する#

--include_not_joined_project を指定すると、所属していないプロジェクトも出力します。 指定しない場合は、所属しているプロジェクトのみ出力します( --project_query '{"user_id":"my_user_id"}' と結果は同じ)。

$ annofabcli project list --organization org1 --include_not_joined_project

project_idで絞り込み#

project_idが prj1 , prj2 であるプロジェクトの一覧を出力します。

$ annofabcli project list --project_id prj1 prj2

出力結果#

CSV出力#

$ annofabcli project list --organization org1 --format csv --output out.csv
out.csv#

organization_id

organization_name

project_id

title

overview

project_status

input_data_type

created_datetime

updated_datetime

summary

configuration

org1

test-organization-name1

prj1

test-project-title1

active

image

2019-04-19T16:29:41.06+09:00

2020-12-30T12:56:36.043+09:00

{'last_tasks_updated_datetime': '2020-12-30T22:57:35.97+09:00'}

{…}

org2

test-organization-name2

prj2

test-project-title2

active

image

2019-04-19T16:29:41.06+09:00

2020-12-30T12:56:36.043+09:00

{'last_tasks_updated_datetime': '2020-12-30T22:57:35.97+09:00'}

{…}

最小限の列のみ出力する場合は、--format minimal_csv を指定してください。

$ annofabcli project list --organization org1 --format minimal_csv --output out_minimal.csv
out_minimal.csv#

project_id

title

organization_name

project_status

input_data_type

last_tasks_updated_datetime

created_datetime

prj1

prj1

org1

suspended

image

2019-08-21T09:39:55.239+09:00

2019-07-31T18:52:44.26+09:00

prj2

prj2

org1

active

image

2019-08-21T09:39:55.239+09:00

2019-07-31T18:52:44.26+09:00

JSON出力#

$ annofabcli project list --organization org1 --format pretty_json --output out.json
out.json#
[
  {
    "project_id": "prj1",
    "organization_id": "org1",
    "title": "test-project",
    "overview": "",
    "project_status": "suspended",
    "input_data_type": "image",
    "created_datetime": "2020-03-30T13:15:01.903+09:00",
    "updated_datetime": "2020-12-17T13:49:37.564+09:00",
    "configuration": {
      "number_of_inspections": 1,
      "assignee_rule_of_resubmitted_task": "no_assignee",
      "task_assignment_type": "random",
      "max_tasks_per_member": 30,
      "max_tasks_per_member_including_hold": 30,
      "private_storage_aws_iam_role_arn": null,
      "plugin_id": null,
      "custom_task_assignment_plugin_id": null,
      "custom_specs_plugin_id": null,
      "input_data_set_id_list": null,
      "input_data_max_long_side_length": null,
      "sampling_inspection_rate": 50,
      "sampling_acceptance_rate": 0,
      "editor_version": "stable"
    },
    "summary": {
      "last_tasks_updated_datetime": "2020-11-11T18:06:58.642+09:00"
    },
    "organization_name": "test-organization"
  }
]

project_idの一覧を出力#

$ annofabcli project list --organization org1 --format project_id_list --output out.txt
out.txt#
prj1
prj2
...

Usage Details#

プロジェクト一覧を出力します。

usage: annofabcli project list [-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 [PROJECT_ID ...] | -org ORGANIZATION)
                               [-pq PROJECT_QUERY]
                               [--include_not_joined_project]
                               [-f {csv,minimal_csv,json,pretty_json,project_id_list}]
                               [-o OUTPUT]

Named Arguments#

-p, --project_id

対象プロジェクトのproject_idを指定します。 file:// を先頭に付けると、project_idの一覧が記載されたファイルを指定できます。

-org, --organization

対象の組織名を指定してください。

-pq, --project_query

プロジェクトの検索クエリをJSON形式で指定します。'--organization'を指定したときのみ有効なオプションです。指定しない場合は、組織配下のすべてのプロジェクトを取得します。 file:// を先頭に付けると、JSON形式のファイルを指定できます。クエリのフォーマットは、[getProjectsOfOrganization API](https://annofab.com/docs/api/#operation/getProjectsOfOrganization)のクエリパラメータと同じです。さらに追加で、user_id , except_user_id キーも指定できます。ただし page , limit キーは指定できません。

--include_not_joined_project

'--organization'を指定したときのみ有効なオプションです。指定した場合は、所属していないプロジェクトも出力します。指定しない場合は、自分が所属しているプロジェクトのみ出力します( --project_query '{"user_id":"my_user_id"}' が指定されている状態と同じ)

-f, --format

Possible choices: csv, minimal_csv, json, pretty_json, project_id_list

出力フォーマットを指定します。

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リクエストの内容やレスポンスのステータスコードなど、デバッグ用のログが出力されます。