@@ -82,7 +82,7 @@ service = build_from_netrc()
82
82
## ` service.api ` のサンプルコード
83
83
84
84
* ` service.api ` には、Web APIに対応するメソッドが定義されています。
85
- * メソッド名は、[ AnnoFab Web APIのOpenAPI specification] ( https://annofab.com/docs/api/swagger.yaml ) に記載されている` operationId ` をスネークケースに変換したものです 。
85
+ * メソッド名は、[ AnnoFab Web APIのOpenAPI specification] ( https://annofab.com/docs/api/swagger.yaml ) に記載されている` operationId ` を、スネークケースに変換したものです 。
86
86
* 各メソッドの戻り値の型は` Tupple[Content, Response] ` です。
87
87
Responseは[ requestsモジュールのReponseオブジェクト] ( https://2.python-requests.org/en/master/api/#requests.Response ) です。
88
88
ContentはReponseの中身です。
@@ -101,7 +101,7 @@ url = response.headers['Location']
101
101
102
102
## ` service.wrapper ` のサンプルコード
103
103
104
- ` service.wrapper ` は、APIを組み合わせたメソッドが定義されています 。
104
+ ` service.wrapper ` には、 ` server.api ` を組み合わせたメソッドが定義されています 。
105
105
106
106
107
107
``` python
@@ -126,36 +126,36 @@ service.wrapper.copy_project_members(src_project_id, dest_project_id)
126
126
service.wrapper.copy_annotation_specs(src_project_id, dest_project_id)
127
127
```
128
128
129
- ## アノテーションzipのパース
130
- ダウンロードしたアノテーションzipをJSONファイルごとにパース(遅延読み込み)します 。
131
- zipファイルを展開したディレクトリもパースが可能です 。
129
+ ## アノテーションzipの読み込み
130
+ ダウンロードしたアノテーションzipを、JSONファイルごとに読み込みます 。
131
+ zipファイルを展開したディレクトリも読み込み可能です 。
132
132
133
133
``` python
134
134
import zipfile
135
135
from pathlib import Path
136
136
from annofabapi.parser import lazy_parse_simple_annotation_dir, lazy_parse_simple_annotation_zip, SimpleAnnotationZipParser, SimpleAnnotationDirParser
137
137
138
138
139
- # Simpleアノテーションzipのパース
139
+ # Simpleアノテーションzipの読み込み
140
140
iter_parser = lazy_parse_simple_annotation_zip(Path(" simple-annotation.zip" ))
141
141
for parser in iter_parser:
142
142
simple_annotation = parser.parse()
143
143
print (simple_annotation)
144
144
145
- # Simpleアノテーションzipを展開したディレクトリのパース
145
+ # Simpleアノテーションzipを展開したディレクトリの読み込み
146
146
iter_parser = lazy_parse_simple_annotation_dir(Path(" simple-annotation-dir" ))
147
147
for parser in iter_parser:
148
148
simple_annotation = parser.parse()
149
149
print (simple_annotation)
150
150
151
151
152
- # Simpleアノテーションzip内の1個のJSONファイルをパース
152
+ # Simpleアノテーションzip内の1個のJSONファイルを読み込み
153
153
with zipfile.ZipFile(' simple-annotation.zip' , ' r' ) as zip_file:
154
154
parser = SimpleAnnotationZipParser(zip_file, " task_id/input_data_name.json" )
155
155
simple_annotation = parser.parse()
156
156
print (simple_annotation)
157
157
158
- # Simpleアノテーションzip内を展開したディレクトリ内の1個のJSONファイルをパース
158
+ # Simpleアノテーションzip内を展開したディレクトリ内の1個のJSONファイルを読み込み
159
159
parser = SimpleAnnotationDirParser(Path(" task_id/input_data_name.json" ))
160
160
simple_annotation = p.parse()
161
161
print (simple_annotation)
0 commit comments