Skip to content

Commit 0538e8e

Browse files
authored
Merge pull request #79 from kurusugawa-computer/feature/annofav-v0.65.0
Feature/annofav v0.65.0
2 parents 29d50ea + 90ea65d commit 0538e8e

File tree

8 files changed

+15
-294
lines changed

8 files changed

+15
-294
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ language: python
33
python:
44
- "3.6"
55
- "3.7"
6+
- "3.8"
67
install:
78
- pip install . flake8 mypy pylint pytest
89
script:

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,13 @@ for parser in iter_parser:
154154

155155
# Simpleアノテーションzip内の1個のJSONファイルを読み込み
156156
with zipfile.ZipFile('simple-annotation.zip', 'r') as zip_file:
157-
parser = SimpleAnnotationZipParser(zip_file, "task_id/input_data_name.json")
157+
parser = SimpleAnnotationZipParser(zip_file, "task01/12345678-abcd-1234-abcd-1234abcd5678.json")
158158
simple_annotation = parser.parse()
159159
print(simple_annotation)
160160

161161
# Simpleアノテーションzip内を展開したディレクトリ内の1個のJSONファイルを読み込み
162-
parser = SimpleAnnotationDirParser(Path("task_id/input_data_name.json"))
163-
simple_annotation = p.parse()
162+
parser = SimpleAnnotationDirParser(Path("task01/12345678-abcd-1234-abcd-1234abcd5678.json"))
163+
simple_annotation = parser.parse()
164164
print(simple_annotation)
165165

166166
```

annofabapi/__version__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.20.0'
1+
__version__ = '0.20.1'

annofabapi/generated_api.py

+1-76
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ def create_temp_path(self, project_id: str, header_params: Optional[Dict[str, An
611611
authorizations: AllProjectMember
612612
613613
614-
「複数の入力データを圧縮したZIPファイル」や「4MBを超える画像」などをAnnoFabに一時的に保存するための、URLと登録用データパスを発行します。 このAPIと他のAPIを以下に示すように使うことで、ZIPファイルなどをAFにアップロードできます。 1. 本APIを実行して、URLを取得する。 * `curl -X POST -H 'Content-Type: CONTENT_TYPE_HERE' 'https://annofab.com/api/v1/projects/(プロジェクトID)/create-temp-path` 2. 1で取得したURLに、一時保存したいファイルをPUTする。 * `curl -X PUT -H \"Content-Type: CONTENT_TYPE_HERE' --data-binary @/hoge.zip 'https://発行されたURL'` 3. 1で取得した登録用データパスを [入力データ登録API](#operation/putInputData)のリクエストボディ `input_data_path` に指定する。 * `curl -X PUT -H 'Content-Type: text/json\" -d '{\"input_data_name\":\"...\", \"input_data_path\":\"(登録用データパス)\" }' '/projects/{project_id}/inputs/{input_data_id}'` ここで、1と2で `CONTENT_TYPE_HERE` は必ず一致しなければいけません。 ZIPファイルの場合は `application/zip` 、画像ファイルの場合は `image/png` など、適切な Content-Type を指定します。 登録するファイルはどのような内容であれ、アップロードから24時間経過すると削除されます。 したがって、ZIP圧縮した入力データを登録する場合は、URL発行から24時間以内に完了してください。
614+
「複数の入力データを圧縮したZIPファイル」や「4MBを超える画像」などをAnnoFabに一時的に保存するための、URLと登録用データパスを発行します。 このAPIと他のAPIを以下に示すように使うことで、ZIPファイルなどをAFにアップロードできます。 1. 本APIを実行して、URLを取得する。 * `curl -X POST -H 'Content-Type: CONTENT_TYPE_HERE' 'https://annofab.com/api/v1/projects/{project_id}/create-temp-path'` 2. 1で取得したURLに、一時保存したいファイルをPUTする。 * `curl -X PUT -H 'Content-Type: CONTENT_TYPE_HERE' --data-binary @/hoge.zip 'https://(発行されたURL)'` 3. 1で取得した登録用データパスを [入力データ登録API](#operation/putInputData)のリクエストボディ `input_data_path` に指定する。 * `curl -X PUT -H 'Content-Type: text/json' -d '{\"input_data_name\":\"(表示名)\", \"input_data_path\":\"(登録用データパス)\" }' 'https://annofab.com/api/v1/projects/{project_id}/inputs/{input_data_id}'` ここで、1と2で `CONTENT_TYPE_HERE` は必ず一致しなければいけません。 ZIPファイルの場合は `application/zip` 、画像ファイルの場合は `image/png` など、適切な Content-Type を指定します。 登録するファイルはどのような内容であれ、アップロードから24時間経過すると削除されます。 したがって、ZIP圧縮した入力データを登録する場合は、URL発行から24時間以内に完了してください。
615615
616616
Args:
617617
project_id (str): プロジェクトID (required)
@@ -2094,58 +2094,6 @@ def delete_task(self, project_id: str, task_id: str, **kwargs) -> Tuple[Any, req
20942094
keyword_params: Dict[str, Any] = {}
20952095
return self._request_wrapper(http_method, url_path, **keyword_params)
20962096

2097-
def get_histories_with_pro_id_tas_id_tas_his_id(self, project_id: str, task_id: str, task_history_id: str,
2098-
**kwargs) -> Tuple[Any, requests.Response]:
2099-
"""タスク履歴取得
2100-
2101-
.. deprecated:: X
2102-
2103-
authorizations: AllProjectMember
2104-
2105-
2106-
2107-
Args:
2108-
project_id (str): プロジェクトID (required)
2109-
task_id (str): タスクID (required)
2110-
task_history_id (str): タスク履歴ID (required)
2111-
2112-
Returns:
2113-
Tuple[List[TaskHistory], requests.Response]
2114-
2115-
2116-
"""
2117-
warnings.warn("deprecated", DeprecationWarning)
2118-
url_path = f'/projects/{project_id}/tasks/{task_id}/histories/{task_history_id}'
2119-
http_method = 'GET'
2120-
keyword_params: Dict[str, Any] = {}
2121-
return self._request_wrapper(http_method, url_path, **keyword_params)
2122-
2123-
def get_history_events_with_pro_id_tas_id(self, project_id: str, task_id: str,
2124-
**kwargs) -> Tuple[Any, requests.Response]:
2125-
"""タスク履歴イベント取得
2126-
2127-
.. deprecated:: X
2128-
2129-
authorizations: AllProjectMember
2130-
2131-
2132-
作業時間を計算したタスク履歴ではなく、その元となったタスク履歴イベントを一括で取得します。
2133-
2134-
Args:
2135-
project_id (str): プロジェクトID (required)
2136-
task_id (str): タスクID (required)
2137-
2138-
Returns:
2139-
Tuple[List[TaskHistoryEvent], requests.Response]
2140-
2141-
2142-
"""
2143-
warnings.warn("deprecated", DeprecationWarning)
2144-
url_path = f'/projects/{project_id}/tasks/{task_id}/history-events'
2145-
http_method = 'GET'
2146-
keyword_params: Dict[str, Any] = {}
2147-
return self._request_wrapper(http_method, url_path, **keyword_params)
2148-
21492097
def get_task(self, project_id: str, task_id: str, **kwargs) -> Tuple[Any, requests.Response]:
21502098
"""タスク取得
21512099
@@ -2257,29 +2205,6 @@ def get_tasks(self, project_id: str, query_params: Optional[Dict[str, Any]] = No
22572205
}
22582206
return self._request_wrapper(http_method, url_path, **keyword_params)
22592207

2260-
def get_tasks_inputs_with_pro_id(self, project_id: str, **kwargs) -> Tuple[Any, requests.Response]:
2261-
"""【非推奨】タスク-入力データ一括取得
2262-
2263-
.. deprecated:: X
2264-
2265-
authorizations: AllProjectMember
2266-
2267-
2268-
2269-
Args:
2270-
project_id (str): プロジェクトID (required)
2271-
2272-
Returns:
2273-
Tuple[TasksInputs, requests.Response]
2274-
2275-
2276-
"""
2277-
warnings.warn("deprecated", DeprecationWarning)
2278-
url_path = f'/projects/{project_id}/tasks-inputs'
2279-
http_method = 'GET'
2280-
keyword_params: Dict[str, Any] = {}
2281-
return self._request_wrapper(http_method, url_path, **keyword_params)
2282-
22832208
def initiate_tasks_generation(self, project_id: str, request_body: Optional[Any] = None,
22842209
**kwargs) -> Tuple[Any, requests.Response]:
22852210
"""タスク一括作成

annofabapi/models.py

+1-31
Original file line numberDiff line numberDiff line change
@@ -2711,7 +2711,7 @@ class ProjectStatus(Enum):
27112711
27122712
* overview: str
27132713
2714-
* status: str
2714+
* status: ProjectStatus
27152715
27162716
* input_data_type: InputDataType
27172717
@@ -3187,36 +3187,6 @@ class TaskStatus(Enum):
31873187
* inputs: List[InputDataSummary]
31883188
31893189
3190-
"""
3191-
3192-
TasksInputs = Dict[str, Any]
3193-
"""
3194-
3195-
3196-
Kyes of Dict
3197-
3198-
* project_id: str
3199-
プロジェクトID。[値の制約についてはこちら。](#section/API-Convention/APIID)
3200-
* tasks: List[TasksInputsTask]
3201-
3202-
3203-
"""
3204-
3205-
TasksInputsTask = Dict[str, Any]
3206-
"""
3207-
3208-
3209-
Kyes of Dict
3210-
3211-
* task_id: str
3212-
タスクID。[値の制約についてはこちら。](#section/API-Convention/APIID)
3213-
* phase: TaskPhase
3214-
3215-
* status: TaskStatus
3216-
3217-
* input_data_id_list: List[str]
3218-
3219-
32203190
"""
32213191

32223192
Token = Dict[str, Any]

generate/swagger/swagger-api-components.yaml

+1-23
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,7 @@
11691169
overview:
11701170
type: string
11711171
status:
1172-
type: string
1172+
$ref: "#/components/schemas/ProjectStatus"
11731173
input_data_type:
11741174
$ref: "#/components/schemas/InputDataType"
11751175
organization_name:
@@ -1802,28 +1802,6 @@
18021802
type: array
18031803
items:
18041804
$ref: "#/components/schemas/InputDataId"
1805-
TasksInputs:
1806-
type: object
1807-
properties:
1808-
project_id:
1809-
$ref: "#/components/schemas/ProjectId"
1810-
tasks:
1811-
type: array
1812-
items:
1813-
$ref: "#/components/schemas/TasksInputsTask"
1814-
TasksInputsTask:
1815-
type: object
1816-
properties:
1817-
task_id:
1818-
$ref: "#/components/schemas/TaskId"
1819-
phase:
1820-
$ref: "#/components/schemas/TaskPhase"
1821-
status:
1822-
$ref: "#/components/schemas/TaskStatus"
1823-
input_data_id_list:
1824-
type: array
1825-
items:
1826-
$ref: "#/components/schemas/InputDataId"
18271805
TaskGenerateRequest:
18281806
type: object
18291807
properties:

generate/swagger/swagger.v2.yaml

+2-24
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ info:
7575
検査ID | プロジェクト内で一意
7676
WebhookID | プロジェクト内で一意
7777
78-
version: 0.64.1
78+
version: 0.65.0
7979
title: AnnoFab Web API
8080
x-logo:
8181
url: "https://annofab.com/images/logo_landscape.png"
@@ -1737,7 +1737,7 @@ components:
17371737
overview:
17381738
type: string
17391739
status:
1740-
type: string
1740+
$ref: "#/components/schemas/ProjectStatus"
17411741
input_data_type:
17421742
$ref: "#/components/schemas/InputDataType"
17431743
organization_name:
@@ -2370,28 +2370,6 @@ components:
23702370
type: array
23712371
items:
23722372
$ref: "#/components/schemas/InputDataId"
2373-
TasksInputs:
2374-
type: object
2375-
properties:
2376-
project_id:
2377-
$ref: "#/components/schemas/ProjectId"
2378-
tasks:
2379-
type: array
2380-
items:
2381-
$ref: "#/components/schemas/TasksInputsTask"
2382-
TasksInputsTask:
2383-
type: object
2384-
properties:
2385-
task_id:
2386-
$ref: "#/components/schemas/TaskId"
2387-
phase:
2388-
$ref: "#/components/schemas/TaskPhase"
2389-
status:
2390-
$ref: "#/components/schemas/TaskStatus"
2391-
input_data_id_list:
2392-
type: array
2393-
items:
2394-
$ref: "#/components/schemas/InputDataId"
23952373
TaskGenerateRequest:
23962374
type: object
23972375
properties:

0 commit comments

Comments
 (0)