annofabcli 1.114.3__py3-none-any.whl → 1.114.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- annofabcli/annotation/list_annotation.py +4 -4
- annofabcli/annotation/list_annotation_count.py +4 -4
- annofabcli/annotation_specs/export_annotation_specs.py +4 -4
- annofabcli/annotation_specs/get_annotation_specs_with_attribute_id_replaced.py +4 -4
- annofabcli/annotation_specs/get_annotation_specs_with_choice_id_replaced.py +4 -4
- annofabcli/annotation_specs/get_annotation_specs_with_label_id_replaced.py +4 -4
- annofabcli/annotation_specs/list_annotation_specs_attribute.py +7 -7
- annofabcli/annotation_specs/list_annotation_specs_choice.py +9 -9
- annofabcli/annotation_specs/list_annotation_specs_history.py +2 -2
- annofabcli/annotation_specs/list_annotation_specs_label.py +8 -8
- annofabcli/annotation_specs/list_annotation_specs_label_attribute.py +7 -7
- annofabcli/annotation_specs/list_label_color.py +2 -2
- annofabcli/annotation_zip/list_annotation_3d_bounding_box.py +8 -8
- annofabcli/annotation_zip/list_annotation_bounding_box_2d.py +8 -8
- annofabcli/annotation_zip/list_polygon_annotation.py +8 -8
- annofabcli/annotation_zip/list_polyline_annotation.py +8 -8
- annofabcli/annotation_zip/list_range_annotation.py +8 -8
- annofabcli/annotation_zip/list_single_point_annotation.py +8 -8
- annofabcli/annotation_zip/validate_annotation.py +2 -2
- annofabcli/comment/list_all_comment.py +8 -8
- annofabcli/comment/list_comment.py +8 -8
- annofabcli/common/cli.py +3 -3
- annofabcli/common/enums.py +1 -1
- annofabcli/common/pandas.py +4 -3
- annofabcli/common/utils.py +10 -10
- annofabcli/common/visualize.py +3 -3
- annofabcli/filesystem/mask_user_info.py +3 -2
- annofabcli/input_data/list_all_input_data.py +11 -22
- annofabcli/input_data/list_all_input_data_merged_task.py +7 -7
- annofabcli/input_data/list_input_data.py +67 -18
- annofabcli/instruction/list_instruction_history.py +2 -2
- annofabcli/job/list_job.py +2 -2
- annofabcli/job/list_last_job.py +2 -2
- annofabcli/my_account/get_my_account.py +4 -4
- annofabcli/organization/list_organization.py +5 -5
- annofabcli/organization_member/list_organization_member.py +4 -4
- annofabcli/project/list_project.py +9 -9
- annofabcli/project_member/list_users.py +4 -4
- annofabcli/statistics/list_annotation_area.py +8 -8
- annofabcli/statistics/list_annotation_attribute.py +8 -8
- annofabcli/statistics/list_annotation_attribute_filled_count.py +11 -11
- annofabcli/statistics/list_annotation_count.py +529 -166
- annofabcli/statistics/list_annotation_duration.py +8 -8
- annofabcli/statistics/list_video_duration.py +6 -6
- annofabcli/statistics/summarize_task_count_by_task_id_group.py +2 -2
- annofabcli/statistics/summarize_task_count_by_user.py +2 -2
- annofabcli/statistics/visualization/dataframe/project_performance.py +2 -1
- annofabcli/statistics/visualization/dataframe/task.py +25 -6
- annofabcli/supplementary/list_supplementary_data.py +2 -2
- annofabcli/task/list_all_tasks.py +8 -18
- annofabcli/task/list_all_tasks_added_task_history.py +6 -6
- annofabcli/task/list_tasks.py +73 -37
- annofabcli/task/list_tasks_added_task_history.py +25 -16
- annofabcli/task_history/list_all_task_history.py +6 -6
- annofabcli/task_history/list_task_history.py +6 -6
- annofabcli/task_history_event/list_all_task_history_event.py +6 -6
- annofabcli/task_history_event/list_worktime.py +6 -6
- {annofabcli-1.114.3.dist-info → annofabcli-1.114.5.dist-info}/METADATA +2 -2
- {annofabcli-1.114.3.dist-info → annofabcli-1.114.5.dist-info}/RECORD +62 -62
- {annofabcli-1.114.3.dist-info → annofabcli-1.114.5.dist-info}/WHEEL +0 -0
- {annofabcli-1.114.3.dist-info → annofabcli-1.114.5.dist-info}/entry_points.txt +0 -0
- {annofabcli-1.114.3.dist-info → annofabcli-1.114.5.dist-info}/licenses/LICENSE +0 -0
|
@@ -3,7 +3,7 @@ import logging
|
|
|
3
3
|
|
|
4
4
|
import annofabcli.common.cli
|
|
5
5
|
from annofabcli.common.cli import ArgumentParser, CommandLine, build_annofabapi_resource_and_login
|
|
6
|
-
from annofabcli.common.enums import
|
|
6
|
+
from annofabcli.common.enums import OutputFormat
|
|
7
7
|
from annofabcli.common.facade import AnnofabApiFacade
|
|
8
8
|
|
|
9
9
|
logger = logging.getLogger(__name__)
|
|
@@ -27,11 +27,11 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
27
27
|
|
|
28
28
|
argument_parser.add_format(
|
|
29
29
|
choices=[
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
OutputFormat.CSV,
|
|
31
|
+
OutputFormat.JSON,
|
|
32
|
+
OutputFormat.PRETTY_JSON,
|
|
33
33
|
],
|
|
34
|
-
default=
|
|
34
|
+
default=OutputFormat.CSV,
|
|
35
35
|
)
|
|
36
36
|
argument_parser.add_output()
|
|
37
37
|
|
|
@@ -7,7 +7,7 @@ import requests
|
|
|
7
7
|
|
|
8
8
|
import annofabcli.common.cli
|
|
9
9
|
from annofabcli.common.cli import ArgumentParser, CommandLine, build_annofabapi_resource_and_login
|
|
10
|
-
from annofabcli.common.enums import
|
|
10
|
+
from annofabcli.common.enums import OutputFormat
|
|
11
11
|
from annofabcli.common.facade import AnnofabApiFacade
|
|
12
12
|
from annofabcli.common.utils import get_columns_with_priority
|
|
13
13
|
|
|
@@ -52,7 +52,7 @@ class ListOrganizationMember(CommandLine):
|
|
|
52
52
|
logger.warning(f"組織'{organization_name}'のメンバー一覧を取得できませんでした。", exc_info=True)
|
|
53
53
|
continue
|
|
54
54
|
|
|
55
|
-
if args.format ==
|
|
55
|
+
if args.format == OutputFormat.CSV.value:
|
|
56
56
|
df = pandas.DataFrame(organization_member_list)
|
|
57
57
|
columns = get_columns_with_priority(df, prior_columns=self.PRIOR_COLUMNS)
|
|
58
58
|
self.print_csv(df[columns])
|
|
@@ -79,8 +79,8 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
79
79
|
)
|
|
80
80
|
|
|
81
81
|
argument_parser.add_format(
|
|
82
|
-
choices=[
|
|
83
|
-
default=
|
|
82
|
+
choices=[OutputFormat.CSV, OutputFormat.JSON, OutputFormat.PRETTY_JSON, OutputFormat.USER_ID_LIST],
|
|
83
|
+
default=OutputFormat.CSV,
|
|
84
84
|
)
|
|
85
85
|
argument_parser.add_output()
|
|
86
86
|
|
|
@@ -15,7 +15,7 @@ from annofabcli.common.cli import (
|
|
|
15
15
|
CommandLine,
|
|
16
16
|
build_annofabapi_resource_and_login,
|
|
17
17
|
)
|
|
18
|
-
from annofabcli.common.enums import
|
|
18
|
+
from annofabcli.common.enums import OutputFormat
|
|
19
19
|
from annofabcli.common.facade import AnnofabApiFacade
|
|
20
20
|
from annofabcli.common.utils import get_columns_with_priority
|
|
21
21
|
|
|
@@ -186,10 +186,10 @@ class ListProject(CommandLine):
|
|
|
186
186
|
|
|
187
187
|
logger.info(f"プロジェクト一覧の件数: {len(project_list)}")
|
|
188
188
|
|
|
189
|
-
if args.format ==
|
|
189
|
+
if args.format == OutputFormat.MINIMAL_CSV.value:
|
|
190
190
|
df = create_minimal_dataframe(project_list)
|
|
191
191
|
self.print_csv(df)
|
|
192
|
-
elif args.format ==
|
|
192
|
+
elif args.format == OutputFormat.CSV.value:
|
|
193
193
|
df = pandas.DataFrame(project_list)
|
|
194
194
|
columns = get_columns_with_priority(df, prior_columns=self.PRIOR_COLUMNS)
|
|
195
195
|
self.print_csv(df[columns])
|
|
@@ -241,13 +241,13 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
241
241
|
|
|
242
242
|
argument_parser.add_format(
|
|
243
243
|
choices=[
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
244
|
+
OutputFormat.CSV,
|
|
245
|
+
OutputFormat.MINIMAL_CSV,
|
|
246
|
+
OutputFormat.JSON,
|
|
247
|
+
OutputFormat.PRETTY_JSON,
|
|
248
|
+
OutputFormat.PROJECT_ID_LIST,
|
|
249
249
|
],
|
|
250
|
-
default=
|
|
250
|
+
default=OutputFormat.CSV,
|
|
251
251
|
)
|
|
252
252
|
argument_parser.add_output()
|
|
253
253
|
|
|
@@ -7,7 +7,7 @@ from annofabapi.models import ProjectMember
|
|
|
7
7
|
|
|
8
8
|
import annofabcli.common.cli
|
|
9
9
|
from annofabcli.common.cli import ArgumentParser, CommandLine, build_annofabapi_resource_and_login
|
|
10
|
-
from annofabcli.common.enums import
|
|
10
|
+
from annofabcli.common.enums import OutputFormat
|
|
11
11
|
from annofabcli.common.facade import AnnofabApiFacade
|
|
12
12
|
from annofabcli.common.utils import get_columns_with_priority
|
|
13
13
|
from annofabcli.common.visualize import AddProps
|
|
@@ -75,7 +75,7 @@ class ListUser(CommandLine):
|
|
|
75
75
|
)
|
|
76
76
|
|
|
77
77
|
logger.info(f"プロジェクトメンバ一覧の件数: {len(project_members)}")
|
|
78
|
-
if args.format ==
|
|
78
|
+
if args.format == OutputFormat.CSV.value:
|
|
79
79
|
df = pandas.DataFrame(project_members)
|
|
80
80
|
columns = get_columns_with_priority(df, prior_columns=self.PRIOR_COLUMNS)
|
|
81
81
|
self.print_csv(df[columns])
|
|
@@ -104,8 +104,8 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
104
104
|
parser.add_argument("--include_inactive", action="store_true", help="脱退しているメンバも出力します。")
|
|
105
105
|
|
|
106
106
|
argument_parser.add_format(
|
|
107
|
-
choices=[
|
|
108
|
-
default=
|
|
107
|
+
choices=[OutputFormat.CSV, OutputFormat.JSON, OutputFormat.PRETTY_JSON, OutputFormat.USER_ID_LIST],
|
|
108
|
+
default=OutputFormat.CSV,
|
|
109
109
|
)
|
|
110
110
|
argument_parser.add_output()
|
|
111
111
|
|
|
@@ -30,7 +30,7 @@ from annofabcli.common.cli import (
|
|
|
30
30
|
build_annofabapi_resource_and_login,
|
|
31
31
|
)
|
|
32
32
|
from annofabcli.common.download import DownloadingFile
|
|
33
|
-
from annofabcli.common.enums import
|
|
33
|
+
from annofabcli.common.enums import OutputFormat
|
|
34
34
|
from annofabcli.common.facade import (
|
|
35
35
|
AnnofabApiFacade,
|
|
36
36
|
TaskQuery,
|
|
@@ -189,7 +189,7 @@ def create_df(
|
|
|
189
189
|
def print_annotation_area(
|
|
190
190
|
annotation_path: Path,
|
|
191
191
|
output_file: Path,
|
|
192
|
-
output_format:
|
|
192
|
+
output_format: OutputFormat,
|
|
193
193
|
*,
|
|
194
194
|
target_task_ids: Collection[str] | None = None,
|
|
195
195
|
task_query: TaskQuery | None = None,
|
|
@@ -202,12 +202,12 @@ def print_annotation_area(
|
|
|
202
202
|
|
|
203
203
|
logger.info(f"{len(annotation_area_list)} 件のタスクに含まれる塗りつぶし、矩形、ポリゴンアノテーションの面積情報を出力します。")
|
|
204
204
|
|
|
205
|
-
if output_format ==
|
|
205
|
+
if output_format == OutputFormat.CSV:
|
|
206
206
|
df = create_df(annotation_area_list)
|
|
207
207
|
print_csv(df, output_file)
|
|
208
208
|
|
|
209
|
-
elif output_format in [
|
|
210
|
-
json_is_pretty = output_format ==
|
|
209
|
+
elif output_format in [OutputFormat.PRETTY_JSON, OutputFormat.JSON]:
|
|
210
|
+
json_is_pretty = output_format == OutputFormat.PRETTY_JSON
|
|
211
211
|
print_json(
|
|
212
212
|
[e.to_dict(encode_json=True) for e in annotation_area_list],
|
|
213
213
|
is_pretty=json_is_pretty,
|
|
@@ -249,7 +249,7 @@ class ListAnnotationArea(CommandLine):
|
|
|
249
249
|
task_query = TaskQuery.from_dict(annofabcli.common.cli.get_json_from_args(args.task_query)) if args.task_query is not None else None
|
|
250
250
|
|
|
251
251
|
output_file: Path = args.output
|
|
252
|
-
output_format =
|
|
252
|
+
output_format = OutputFormat(args.format)
|
|
253
253
|
|
|
254
254
|
downloading_obj = DownloadingFile(self.service)
|
|
255
255
|
|
|
@@ -298,8 +298,8 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
298
298
|
group.add_argument("-p", "--project_id", type=str, help="project_id。``--annotation`` が未指定のときは必須です。\n")
|
|
299
299
|
|
|
300
300
|
argument_parser.add_format(
|
|
301
|
-
choices=[
|
|
302
|
-
default=
|
|
301
|
+
choices=[OutputFormat.CSV, OutputFormat.JSON, OutputFormat.PRETTY_JSON],
|
|
302
|
+
default=OutputFormat.CSV,
|
|
303
303
|
)
|
|
304
304
|
|
|
305
305
|
argument_parser.add_output()
|
|
@@ -27,7 +27,7 @@ from annofabcli.common.cli import (
|
|
|
27
27
|
build_annofabapi_resource_and_login,
|
|
28
28
|
)
|
|
29
29
|
from annofabcli.common.download import DownloadingFile
|
|
30
|
-
from annofabcli.common.enums import
|
|
30
|
+
from annofabcli.common.enums import OutputFormat
|
|
31
31
|
from annofabcli.common.facade import (
|
|
32
32
|
AnnofabApiFacade,
|
|
33
33
|
TaskQuery,
|
|
@@ -164,14 +164,14 @@ def print_annotation_attribute_list_as_csv(annotation_attribute_list: list, outp
|
|
|
164
164
|
def print_annotation_attribute_list(
|
|
165
165
|
annotation_attribute_list: list[AnnotationAttribute],
|
|
166
166
|
output_file: Path,
|
|
167
|
-
output_format: Literal[
|
|
167
|
+
output_format: Literal[OutputFormat.CSV, OutputFormat.JSON, OutputFormat.PRETTY_JSON],
|
|
168
168
|
) -> None:
|
|
169
169
|
tmp_annotation_attribute_list = [e.model_dump() for e in annotation_attribute_list]
|
|
170
|
-
if output_format ==
|
|
170
|
+
if output_format == OutputFormat.CSV:
|
|
171
171
|
print_annotation_attribute_list_as_csv(tmp_annotation_attribute_list, output_file)
|
|
172
|
-
elif output_format ==
|
|
172
|
+
elif output_format == OutputFormat.JSON:
|
|
173
173
|
print_json(tmp_annotation_attribute_list, output=output_file, is_pretty=False)
|
|
174
|
-
elif output_format ==
|
|
174
|
+
elif output_format == OutputFormat.PRETTY_JSON:
|
|
175
175
|
print_json(tmp_annotation_attribute_list, output=output_file, is_pretty=True)
|
|
176
176
|
else:
|
|
177
177
|
raise assert_noreturn(output_format)
|
|
@@ -207,7 +207,7 @@ class ListAnnotationAttribute(CommandLine):
|
|
|
207
207
|
task_query = TaskQuery.from_dict(annofabcli.common.cli.get_json_from_args(args.task_query)) if args.task_query is not None else None
|
|
208
208
|
|
|
209
209
|
output_file: Path = args.output
|
|
210
|
-
output_format =
|
|
210
|
+
output_format = OutputFormat(args.format)
|
|
211
211
|
|
|
212
212
|
downloading_obj = DownloadingFile(self.service)
|
|
213
213
|
|
|
@@ -254,8 +254,8 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
254
254
|
annotation_group.add_argument("-p", "--project_id", type=str, help="対象プロジェクトの project_id")
|
|
255
255
|
|
|
256
256
|
argument_parser.add_format(
|
|
257
|
-
choices=[
|
|
258
|
-
default=
|
|
257
|
+
choices=[OutputFormat.CSV, OutputFormat.JSON, OutputFormat.PRETTY_JSON],
|
|
258
|
+
default=OutputFormat.CSV,
|
|
259
259
|
)
|
|
260
260
|
|
|
261
261
|
argument_parser.add_output()
|
|
@@ -36,7 +36,7 @@ from annofabcli.common.cli import (
|
|
|
36
36
|
build_annofabapi_resource_and_login,
|
|
37
37
|
)
|
|
38
38
|
from annofabcli.common.download import DownloadingFile
|
|
39
|
-
from annofabcli.common.enums import
|
|
39
|
+
from annofabcli.common.enums import OutputFormat
|
|
40
40
|
from annofabcli.common.facade import (
|
|
41
41
|
AnnofabApiFacade,
|
|
42
42
|
TaskQuery,
|
|
@@ -480,7 +480,7 @@ class ListAnnotationAttributeFilledCountMain:
|
|
|
480
480
|
annotation_path: Path,
|
|
481
481
|
output_file: Path,
|
|
482
482
|
group_by: GroupBy,
|
|
483
|
-
output_format:
|
|
483
|
+
output_format: OutputFormat,
|
|
484
484
|
*,
|
|
485
485
|
project_id: str | None = None,
|
|
486
486
|
include_flag_attribute: bool = False,
|
|
@@ -505,11 +505,11 @@ class ListAnnotationAttributeFilledCountMain:
|
|
|
505
505
|
|
|
506
506
|
if group_by == GroupBy.INPUT_DATA_ID:
|
|
507
507
|
logger.info(f"{len(annotation_count_list_by_input_data)} 件の入力データに含まれるアノテーション数の情報を出力します。")
|
|
508
|
-
if output_format ==
|
|
508
|
+
if output_format == OutputFormat.CSV:
|
|
509
509
|
self.print_annotation_count_csv_by_input_data(annotation_count_list_by_input_data, output_file=output_file, attribute_names=target_attribute_names)
|
|
510
510
|
|
|
511
|
-
elif output_format in [
|
|
512
|
-
json_is_pretty = output_format ==
|
|
511
|
+
elif output_format in [OutputFormat.PRETTY_JSON, OutputFormat.JSON]:
|
|
512
|
+
json_is_pretty = output_format == OutputFormat.PRETTY_JSON
|
|
513
513
|
|
|
514
514
|
print_json(
|
|
515
515
|
[e.to_dict(encode_json=True) for e in annotation_count_list_by_input_data],
|
|
@@ -519,11 +519,11 @@ class ListAnnotationAttributeFilledCountMain:
|
|
|
519
519
|
elif group_by == GroupBy.TASK_ID:
|
|
520
520
|
annotation_count_list_by_task = convert_annotation_count_list_by_input_data_to_by_task(annotation_count_list_by_input_data)
|
|
521
521
|
logger.info(f"{len(annotation_count_list_by_task)} 件のタスクに含まれるアノテーション数の情報を出力します。")
|
|
522
|
-
if output_format ==
|
|
522
|
+
if output_format == OutputFormat.CSV:
|
|
523
523
|
self.print_annotation_count_csv_by_task(annotation_count_list_by_task, output_file=output_file, attribute_names=target_attribute_names)
|
|
524
524
|
|
|
525
|
-
elif output_format in [
|
|
526
|
-
json_is_pretty = output_format ==
|
|
525
|
+
elif output_format in [OutputFormat.PRETTY_JSON, OutputFormat.JSON]:
|
|
526
|
+
json_is_pretty = output_format == OutputFormat.PRETTY_JSON
|
|
527
527
|
|
|
528
528
|
print_json(
|
|
529
529
|
[e.to_dict(encode_json=True) for e in annotation_count_list_by_task],
|
|
@@ -565,7 +565,7 @@ class ListAnnotationAttributeFilledCount(CommandLine):
|
|
|
565
565
|
|
|
566
566
|
group_by = GroupBy(args.group_by)
|
|
567
567
|
output_file: Path = args.output
|
|
568
|
-
output_format =
|
|
568
|
+
output_format = OutputFormat(args.format)
|
|
569
569
|
main_obj = ListAnnotationAttributeFilledCountMain(self.service)
|
|
570
570
|
|
|
571
571
|
downloading_obj = DownloadingFile(self.service)
|
|
@@ -668,8 +668,8 @@ def parse_args(parser: argparse.ArgumentParser) -> None:
|
|
|
668
668
|
)
|
|
669
669
|
|
|
670
670
|
argument_parser.add_format(
|
|
671
|
-
choices=[
|
|
672
|
-
default=
|
|
671
|
+
choices=[OutputFormat.CSV, OutputFormat.JSON, OutputFormat.PRETTY_JSON],
|
|
672
|
+
default=OutputFormat.CSV,
|
|
673
673
|
)
|
|
674
674
|
|
|
675
675
|
argument_parser.add_output()
|