annofabapi.api2 module#

annofabapi.AnnofabApi2 class#

class annofabapi.AnnofabApi2(api: AnnofabApi)[source]#

Web API v2に対応したメソッドが存在するクラス。

Note

開発途上版のため、互換性のない変更がある可能性があります。

Parameters:

api – API v1のインスタンス(一部のAPIは、v1のログインメソッドを利用するため)

cookies: RequestsCookieJar | None = None#

Signed Cookie情報

get_account_daily_statistics_v2(project_id: str, query_params: Dict[str, Any] | None = None, **kwargs) Tuple[Any, Response]#

ユーザー別タスク集計取得 https://annofab.com/docs/api/#operation/getAccountDailyStatisticsV2

authorizations: SignedCookieKeyPairId, SignedCookiePolicy, SignedCookieSignature

指定した期間の [ユーザー別タスク集計データ](/docs/api/#section/ArrayOfProjectAccountStatistics) を取得できるAPI。取得期間は最大3か月です。

Parameters:
  • project_id (str) – プロジェクトID (required)

  • query_params (Dict[str, Any]) – Query Parameters from (str): 取得する統計の区間の開始日 - YYYY-MM-DD (required) to (str): 取得する統計の区間の終了日 - YYYY-MM-DD 。この日は含まれます。 (required)

Returns:

Tuple[List[ProjectAccountStatistics], requests.Response]

get_account_v2(account_id: str, query_params: Dict[str, Any] | None = None, **kwargs) Tuple[Any, Response]#

ユーザーアカウント情報取得 https://annofab.com/docs/api/#operation/getAccountV2

authorizations: SignedCookieKeyPairId, SignedCookiePolicy, SignedCookieSignature

指定したユーザーの組織のアカウント情報を取得します。 本 API は cache クエリパラメータが同じであれば結果がキャッシュされ、以降は高速にレスポンスが返ります。

Parameters:
  • account_id (str) – アカウントID (required)

  • query_params (Dict[str, Any]) – Query Parameters cache (str): CACHE TIMESTAMP

Returns:

Tuple[MyAccount, requests.Response]

get_annotation_specs_v2(project_id: str, query_params: Dict[str, Any] | None = None, **kwargs) Tuple[Any, Response]#

アノテーション仕様取得 https://annofab.com/docs/api/#operation/getAnnotationSpecsV2

authorizations: SignedCookieKeyPairId, SignedCookiePolicy, SignedCookieSignature

指定したプロジェクトのアノテーション仕様を取得します。 本 API は cache クエリパラメータが同じであれば結果がキャッシュされ、以降は高速にレスポンスが返ります。

Parameters:
  • project_id (str) – プロジェクトID (required)

  • query_params (Dict[str, Any]) – Query Parameters cache (str): CACHE TIMESTAMP history_id (str): 過去のアノテーション仕様を取得する場合、[アノテーション仕様履歴取得](#operation/getAnnotationSpecsHistories)APIで取得した history_id の値を指定します。 未指定時は最新のアノテーション仕様を取得します。 v (str): 取得するアノテーション仕様のフォーマットバージョンを指定します。

Returns:

Tuple[AnnotationSpecs, requests.Response]

get_inspection_daily_statistics_v2(project_id: str, query_params: Dict[str, Any] | None = None, **kwargs) Tuple[Any, Response]#

検査コメント集計取得 https://annofab.com/docs/api/#operation/getInspectionDailyStatisticsV2

authorizations: SignedCookieKeyPairId, SignedCookiePolicy, SignedCookieSignature

指定した期間の [検査コメント集計データ](/docs/api/#section/ArrayOfInspectionStatistics) を取得できるAPI。取得期間は最大3か月です。

Parameters:
  • project_id (str) – プロジェクトID (required)

  • query_params (Dict[str, Any]) – Query Parameters from (str): 取得する統計の区間の開始日 - YYYY-MM-DD (required) to (str): 取得する統計の区間の終了日 - YYYY-MM-DD 。この日は含まれます。 (required)

Returns:

Tuple[List[InspectionStatistics], requests.Response]

get_label_statistics_v2(project_id: str, query_params: Dict[str, Any] | None = None, **kwargs) Tuple[Any, Response]#

ラベル別アノテーション数集計取得 https://annofab.com/docs/api/#operation/getLabelStatisticsV2

authorizations: SignedCookieKeyPairId, SignedCookiePolicy, SignedCookieSignature

指定したプロジェクトのラベル別アノテーション数集計をすべて取得します。

Parameters:
  • project_id (str) – プロジェクトID (required)

  • query_params (Dict[str, Any]) – Query Parameters cache (str): CACHE TIMESTAMP

Returns:

Tuple[List[LabelStatistics], requests.Response]

get_organization_by_name_v2(organization_name: str, query_params: Dict[str, Any] | None = None, **kwargs) Tuple[Any, Response]#

組織名で組織情報取得 https://annofab.com/docs/api/#operation/getOrganizationByNameV2

authorizations: SignedCookieKeyPairId, SignedCookiePolicy, SignedCookieSignature

指定された組織を取得します。 本 API は cache クエリパラメータが同じであれば結果がキャッシュされ、以降は高速にレスポンスが返ります。

Parameters:
  • organization_name (str) – 組織名 (required)

  • query_params (Dict[str, Any]) – Query Parameters cache (str): CACHE TIMESTAMP

Returns:

Tuple[Organization, requests.Response]

get_organization_cache_by_name_v2(organization_name: str, **kwargs) Tuple[Any, Response]#

組織名で組織キャッシュレコード取得 https://annofab.com/docs/api/#operation/getOrganizationCacheByNameV2

authorizations: SignedCookieKeyPairId, SignedCookiePolicy, SignedCookieSignature

組織の各リソースのキャッシュタイムスタンプを格納したキャッシュレコードを取得します。 これらタイムスタンプは、各リソースを取得する API の cache クエリパラメータに使用します。

Parameters:

organization_name (str) – 組織名 (required)

Returns:

Tuple[OrganizationCacheRecord, requests.Response]

get_organization_cache_v2(organization_id: str, **kwargs) Tuple[Any, Response]#

組織IDで組織キャッシュレコード取得 https://annofab.com/docs/api/#operation/getOrganizationCacheV2

authorizations: SignedCookieKeyPairId, SignedCookiePolicy, SignedCookieSignature

組織の各リソースのキャッシュタイムスタンプを格納したキャッシュレコードを取得します。 これらタイムスタンプは、各リソースを取得する API の cache クエリパラメータに使用します。

Parameters:

organization_id (str) – 組織ID (required)

Returns:

Tuple[OrganizationCacheRecord, requests.Response]

get_organization_member_v2(organization_id: str, user_id: str, query_params: Dict[str, Any] | None = None, **kwargs) Tuple[Any, Response]#

組織メンバー取得 https://annofab.com/docs/api/#operation/getOrganizationMemberV2

authorizations: SignedCookieKeyPairId, SignedCookiePolicy, SignedCookieSignature

指定したユーザーが指定した組織にどのようなロールで参加しているかを取得します。

Parameters:
  • organization_id (str) – 組織ID (required)

  • user_id (str) – ユーザーID (required)

  • query_params (Dict[str, Any]) – Query Parameters cache (str): CACHE TIMESTAMP

Returns:

Tuple[OrganizationMember, requests.Response]

get_organization_members_v2(organization_id: str, query_params: Dict[str, Any] | None = None, **kwargs) Tuple[Any, Response]#

組織メンバー一括取得 https://annofab.com/docs/api/#operation/getOrganizationMembersV2

authorizations: SignedCookieKeyPairId, SignedCookiePolicy, SignedCookieSignature

脱退したメンバーは含まれません。

Parameters:
  • organization_id (str) – 組織ID (required)

  • query_params (Dict[str, Any]) – Query Parameters cache (str): CACHE TIMESTAMP

Returns:

Tuple[OrganizationMemberList, requests.Response]

get_organization_v2(organization_id: str, query_params: Dict[str, Any] | None = None, **kwargs) Tuple[Any, Response]#

組織IDで組織情報取得 https://annofab.com/docs/api/#operation/getOrganizationV2

authorizations: SignedCookieKeyPairId, SignedCookiePolicy, SignedCookieSignature

指定された組織を取得します。 本 API は cache クエリパラメータが同じであれば結果がキャッシュされ、以降は高速にレスポンスが返ります。

Parameters:
  • organization_id (str) – 組織ID (required)

  • query_params (Dict[str, Any]) – Query Parameters cache (str): CACHE TIMESTAMP

Returns:

Tuple[Organization, requests.Response]

get_phase_daily_statistics_v2(project_id: str, query_params: Dict[str, Any] | None = None, **kwargs) Tuple[Any, Response]#

フェーズ別タスク集計取得 https://annofab.com/docs/api/#operation/getPhaseDailyStatisticsV2

authorizations: SignedCookieKeyPairId, SignedCookiePolicy, SignedCookieSignature

指定した期間の [フェーズ別タスク集計データ](/docs/api/#section/ArrayOfTaskPhaseStatistics) を取得できるAPI。取得期間は最大3か月です。

Parameters:
  • project_id (str) – プロジェクトID (required)

  • query_params (Dict[str, Any]) – Query Parameters from (str): 取得する統計の区間の開始日 - YYYY-MM-DD (required) to (str): 取得する統計の区間の終了日 - YYYY-MM-DD 。この日は含まれます。 (required)

Returns:

Tuple[List[TaskPhaseStatistics], requests.Response]

get_project_cache_v2(project_id: str, **kwargs) Tuple[Any, Response]#

プロジェクトキャッシュレコード取得 https://annofab.com/docs/api/#operation/getProjectCacheV2

authorizations: SignedCookieKeyPairId, SignedCookiePolicy, SignedCookieSignature

プロジェクトの各種リソースのキャッシュタイムスタンプを取得します。 これらタイムスタンプは、各リソースを取得する API の cache クエリパラメータに使用します。

Parameters:

project_id (str) – プロジェクトID (required)

Returns:

Tuple[ProjectCacheRecord, requests.Response]

get_project_member_v2(project_id: str, user_id: str, query_params: Dict[str, Any] | None = None, **kwargs) Tuple[Any, Response]#

プロジェクトメンバー取得 https://annofab.com/docs/api/#operation/getProjectMemberV2

authorizations: SignedCookieKeyPairId, SignedCookiePolicy, SignedCookieSignature

指定したプロジェクトメンバーを取得します。

Parameters:
  • project_id (str) – プロジェクトID (required)

  • user_id (str) – アカウントのユーザーID. RESTクライアントユーザーが指定しやすいように、Cognitoのaccount_idではなくuser_idとしている。 (required)

  • query_params (Dict[str, Any]) – Query Parameters cache (str): CACHE TIMESTAMP

Returns:

Tuple[ProjectMember, requests.Response]

get_project_members_v2(project_id: str, query_params: Dict[str, Any] | None = None, **kwargs) Tuple[Any, Response]#

プロジェクトメンバー検索 https://annofab.com/docs/api/#operation/getProjectMembersV2

authorizations: SignedCookieKeyPairId, SignedCookiePolicy, SignedCookieSignature

指定されたプロジェクトのメンバーを検索します。 パフォーマンスのため、結果はページング形式で返ります。全件取得したい場合は、レスポンスを見て、ページ移動してください。

Parameters:
  • project_id (str) – プロジェクトID (required)

  • query_params (Dict[str, Any]) – Query Parameters include_inactive_member (str): 脱退したプロジェクトメンバーも取得する時に、キーのみ指定します(値は無視されます)。 cache (str): CACHE TIMESTAMP

Returns:

Tuple[ProjectMemberList, requests.Response]

get_project_task_count_v2(organization_id: str, project_id: str, **kwargs) Tuple[Any, Response]#

プロジェクトのタスク件数取得 https://annofab.com/docs/api/#operation/getProjectTaskCountV2

authorizations: SignedCookieKeyPairId, SignedCookiePolicy, SignedCookieSignature

プロジェクトのタスク件数を取得します。

Parameters:
  • organization_id (str) – 組織ID (required)

  • project_id (str) – プロジェクトID (required)

Returns:

Tuple[ProjectTaskCounts, requests.Response]

get_signed_access_v2(query_params: Dict[str, Any]) Tuple[Dict[str, Any], Response][source]#

Signed Cookieを取得して、インスタンスに保持する。

Parameters:

query_params (Dict[str, Any]) – Query Parameters url (str): アクセスするページのURL

Returns:

Tuple[SignedCookie, requests.Response]

get_task_daily_statistics_v2(project_id: str, query_params: Dict[str, Any] | None = None, **kwargs) Tuple[Any, Response]#

タスク集計取得 https://annofab.com/docs/api/#operation/getTaskDailyStatisticsV2

authorizations: SignedCookieKeyPairId, SignedCookiePolicy, SignedCookieSignature

指定した期間の [タスク集計データ](/docs/api/#section/ArrayOfProjectTaskStatisticsHistory) を取得できるAPI。取得期間は最大3か月です。

Parameters:
  • project_id (str) – プロジェクトID (required)

  • query_params (Dict[str, Any]) – Query Parameters from (str): 取得する統計の区間の開始日 - YYYY-MM-DD (required) to (str): 取得する統計の区間の終了日 - YYYY-MM-DD 。この日は含まれます。 (required)

Returns:

Tuple[List[ProjectTaskStatisticsHistory], requests.Response]

get_user_cache_v2(account_id: str, **kwargs) Tuple[Any, Response]#

キャッシュレコード https://annofab.com/docs/api/#operation/getUserCacheV2

authorizations: SignedCookieKeyPairId, SignedCookiePolicy, SignedCookieSignature

ユーザー別の各リソースのキャッシュタイムスタンプを格納したキャッシュレコードを取得します。 これらタイムスタンプは、各リソースを取得する API の cache クエリパラメータに使用します。

Parameters:

account_id (str) – アカウントID (required)

Returns:

Tuple[UserCacheRecord, requests.Response]

get_user_organizations_v2(account_id: str, query_params: Dict[str, Any] | None = None, **kwargs) Tuple[Any, Response]#

個人の所属組織検索 https://annofab.com/docs/api/#operation/getUserOrganizationsV2

authorizations: SignedCookieKeyPairId, SignedCookiePolicy, SignedCookieSignature

指定したユーザーが所属する組織を検索します。 本 API は cache クエリパラメータが同じであれば結果がキャッシュされ、以降は高速にレスポンスが返ります。

Parameters:
  • account_id (str) – アカウントID (required)

  • query_params (Dict[str, Any]) – Query Parameters cache (str): CACHE TIMESTAMP

Returns:

Tuple[MyOrganizationList, requests.Response]

get_user_project_members_v2(account_id: str, query_params: Dict[str, Any] | None = None, **kwargs) Tuple[Any, Response]#

個人のプロジェクトメンバー情報一括取得 https://annofab.com/docs/api/#operation/getUserProjectMembersV2

authorizations: SignedCookieKeyPairId, SignedCookiePolicy, SignedCookieSignature

指定したユーザーが所属する全てのプロジェクトのメンバー情報から、指定したユーザーを示す情報を抽出します。 このAPIが返すメンバー情報は、全て指定したユーザーのものとなり、その数は指定ユーザーが所属しているプロジェクト数となります。 本 API は cache クエリパラメータが同じであれば結果がキャッシュされ、以降は高速にレスポンスが返ります。

Parameters:
  • account_id (str) – アカウントID (required)

  • query_params (Dict[str, Any]) – Query Parameters cache (str): CACHE TIMESTAMP

Returns:

Tuple[List[ProjectMember], requests.Response]

get_user_projects_v2(account_id: str, query_params: Dict[str, Any] | None = None, **kwargs) Tuple[Any, Response]#

自分のプロジェクトメンバー情報検索 https://annofab.com/docs/api/#operation/getUserProjectsV2

authorizations: SignedCookieKeyPairId, SignedCookiePolicy, SignedCookieSignature

指定したユーザーが所属するプロジェクトを検索します。 本 API は cache クエリパラメータが同じであれば結果がキャッシュされ、以降は高速にレスポンスが返ります。

Parameters:
  • account_id (str) – アカウントID (required)

  • query_params (Dict[str, Any]) – Query Parameters page (int): 表示するページ番号 limit (int): 1ページあたりの取得するデータ件数 organization_id (str): 指定した組織に属するプロジェクトに絞り込む。未指定時は全プロジェクト。 title (str): プロジェクトタイトルでの部分一致検索。1文字以上あれば使用します。利便性のため、大文字小文字は区別しません。 status (ProjectStatus): 指定した状態のプロジェクトで絞り込む。未指定時は全プロジェクト。 input_data_type (InputDataType): 指定した入力データ種別でプロジェクトを絞り込む。未指定時は全プロジェクト sort_by (str): date を指定することでプロジェクトの最新のタスク更新時間の順にソートして出力する。 未指定時はプロジェクト名でソートする。 cache (str): CACHE TIMESTAMP

Returns:

Tuple[ProjectContainer, requests.Response]

get_worktime_daily_statistics_by_account_v2(project_id: str, account_id: str, query_params: Dict[str, Any] | None = None, **kwargs) Tuple[Any, Response]#

プロジェクトメンバー単位のフェーズ別タスク集計取得 https://annofab.com/docs/api/#operation/getWorktimeDailyStatisticsByAccountV2

authorizations: SignedCookieKeyPairId, SignedCookiePolicy, SignedCookieSignature

指定したプロジェクトメンバーのタスク作業時間集計データを指定した期間分取得できるAPI。取得期間は最大3か月です。

Parameters:
  • project_id (str) – プロジェクトID (required)

  • account_id (str) – アカウントID (required)

  • query_params (Dict[str, Any]) – Query Parameters from (str): 取得する統計の区間の開始日 - YYYY-MM-DD (required) to (str): 取得する統計の区間の終了日 - YYYY-MM-DD 。この日は含まれます。 (required)

Returns:

Tuple[WorktimeStatisticsByAccount, requests.Response]

get_worktime_daily_statistics_v2(project_id: str, query_params: Dict[str, Any] | None = None, **kwargs) Tuple[Any, Response]#

プロジェクト単位のフェーズ別タスク集計取得 https://annofab.com/docs/api/#operation/getWorktimeDailyStatisticsV2

authorizations: SignedCookieKeyPairId, SignedCookiePolicy, SignedCookieSignature

指定したプロジェクトのタスク作業時間集計データを指定した期間分取得できるAPI。取得期間は最大3か月です。

Parameters:
  • project_id (str) – プロジェクトID (required)

  • query_params (Dict[str, Any]) – Query Parameters from (str): 取得する統計の区間の開始日 - YYYY-MM-DD (required) to (str): 取得する統計の区間の終了日 - YYYY-MM-DD 。この日は含まれます。 (required)

Returns:

Tuple[WorktimeStatisticsByProject, requests.Response]