kaggle 1.7.4.2__py3-none-any.whl → 1.7.4.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.
- kaggle/api/kaggle_api.py +92 -79
- kaggle/api/kaggle_api_extended.py +907 -876
- kaggle/configuration.py +3 -3
- kaggle/models/dataset_column.py +58 -49
- kaggle/models/dataset_new_request.py +47 -31
- kaggle/models/dataset_new_version_request.py +56 -31
- kaggle/models/dataset_update_settings_request.py +58 -32
- kaggle/models/kernel_push_request.py +86 -51
- kaggle/models/model_instance_new_version_request.py +20 -12
- kaggle/models/model_instance_update_request.py +68 -37
- kaggle/models/model_new_instance_request.py +85 -47
- kaggle/models/model_new_request.py +26 -19
- kaggle/models/model_update_request.py +34 -23
- kaggle/models/start_blob_upload_request.py +60 -49
- kaggle/models/start_blob_upload_response.py +27 -22
- kaggle/models/upload_file.py +33 -31
- {kaggle-1.7.4.2.dist-info → kaggle-1.7.4.5.dist-info}/METADATA +1 -1
- {kaggle-1.7.4.2.dist-info → kaggle-1.7.4.5.dist-info}/RECORD +40 -31
- kagglesdk/__init__.py +1 -1
- kagglesdk/datasets/types/dataset_api_service.py +16 -0
- kagglesdk/kaggle_client.py +12 -0
- kagglesdk/kaggle_env.py +9 -11
- kagglesdk/kaggle_http_client.py +91 -56
- kagglesdk/kaggle_object.py +97 -42
- kagglesdk/kernels/types/kernels_api_service.py +24 -0
- kagglesdk/models/services/model_api_service.py +7 -6
- kagglesdk/models/types/model_api_service.py +31 -15
- kagglesdk/security/__init__.py +0 -0
- kagglesdk/security/services/__init__.py +0 -0
- kagglesdk/security/services/oauth_service.py +32 -0
- kagglesdk/security/types/__init__.py +0 -0
- kagglesdk/security/types/authentication.py +171 -0
- kagglesdk/security/types/oauth_service.py +394 -0
- kagglesdk/test/test_client.py +4 -6
- kagglesdk/users/services/__init__.py +0 -0
- kagglesdk/users/services/account_service.py +19 -0
- kagglesdk/users/types/account_service.py +204 -0
- {kaggle-1.7.4.2.dist-info → kaggle-1.7.4.5.dist-info}/WHEEL +0 -0
- {kaggle-1.7.4.2.dist-info → kaggle-1.7.4.5.dist-info}/entry_points.txt +0 -0
- {kaggle-1.7.4.2.dist-info → kaggle-1.7.4.5.dist-info}/licenses/LICENSE.txt +0 -0
kaggle/api/kaggle_api.py
CHANGED
|
@@ -33,7 +33,7 @@ class KaggleApi(object):
|
|
|
33
33
|
self.api_client = api_client
|
|
34
34
|
|
|
35
35
|
def competition_download_leaderboard(self, id): # noqa: E501
|
|
36
|
-
"""Download competition leaderboard # noqa: E501
|
|
36
|
+
"""Download competition leaderboard # noqa: E501.
|
|
37
37
|
|
|
38
38
|
:param str id: Competition name (required)
|
|
39
39
|
:return: Result
|
|
@@ -41,7 +41,7 @@ class KaggleApi(object):
|
|
|
41
41
|
return self.api_client.competition_leaderboard_download(id, None)
|
|
42
42
|
|
|
43
43
|
def competition_view_leaderboard(self, id): # noqa: E501
|
|
44
|
-
"""
|
|
44
|
+
"""View competition leaderboard # noqa: E501.
|
|
45
45
|
|
|
46
46
|
:param str id: Competition name (required)
|
|
47
47
|
:return: Result
|
|
@@ -49,7 +49,7 @@ class KaggleApi(object):
|
|
|
49
49
|
return self.api_client.competition_leaderboard_view(id)
|
|
50
50
|
|
|
51
51
|
def competitions_data_download_file(self, id, file_name): # noqa: E501
|
|
52
|
-
"""Download competition data file # noqa: E501
|
|
52
|
+
"""Download competition data file # noqa: E501.
|
|
53
53
|
|
|
54
54
|
:param str id: Competition name (required)
|
|
55
55
|
:param str file_name: Competition name (required)
|
|
@@ -58,7 +58,7 @@ class KaggleApi(object):
|
|
|
58
58
|
return self.api_client.competition_download_file(id, file_name)
|
|
59
59
|
|
|
60
60
|
def competitions_data_download_files(self, id): # noqa: E501
|
|
61
|
-
"""Download all competition data files # noqa: E501
|
|
61
|
+
"""Download all competition data files # noqa: E501.
|
|
62
62
|
|
|
63
63
|
:param str id: Competition name (required)
|
|
64
64
|
:return: Result
|
|
@@ -66,7 +66,7 @@ class KaggleApi(object):
|
|
|
66
66
|
return self.api_client.competition_download_files(id)
|
|
67
67
|
|
|
68
68
|
def competitions_data_list_files(self, id): # noqa: E501
|
|
69
|
-
"""List competition data files # noqa: E501
|
|
69
|
+
"""List competition data files # noqa: E501.
|
|
70
70
|
|
|
71
71
|
:param str id: Competition name (required)
|
|
72
72
|
:return: Result
|
|
@@ -79,22 +79,20 @@ class KaggleApi(object):
|
|
|
79
79
|
sort_by=None,
|
|
80
80
|
page=1,
|
|
81
81
|
search=None): # noqa: E501
|
|
82
|
-
"""List competitions # noqa: E501
|
|
82
|
+
"""List competitions # noqa: E501.
|
|
83
83
|
|
|
84
84
|
:param str group: Filter competitions by a particular group
|
|
85
85
|
:param str category: Filter competitions by a particular category
|
|
86
86
|
:param str sort_by: Sort the results
|
|
87
87
|
:param int page: Page number
|
|
88
88
|
:param str search: Search terms
|
|
89
|
-
:return:
|
|
90
|
-
If the method is called asynchronously,
|
|
91
|
-
returns the request thread.
|
|
89
|
+
:return: ApiListCompetitionsResponse
|
|
92
90
|
"""
|
|
93
91
|
return self.api_client.competitions_list(group, category, sort_by, page,
|
|
94
92
|
search)
|
|
95
93
|
|
|
96
94
|
def competitions_submissions_list(self, id, page=0): # noqa: E501
|
|
97
|
-
"""List competition submissions # noqa: E501
|
|
95
|
+
"""List competition submissions # noqa: E501.
|
|
98
96
|
|
|
99
97
|
:param str id: Competition name (required)
|
|
100
98
|
:param int page: Page number
|
|
@@ -104,10 +102,12 @@ class KaggleApi(object):
|
|
|
104
102
|
|
|
105
103
|
def competitions_submissions_submit(self, blob_file_tokens,
|
|
106
104
|
submission_description, id): # noqa: E501
|
|
107
|
-
"""Submit to competition # noqa: E501
|
|
105
|
+
"""Submit to competition # noqa: E501.
|
|
108
106
|
|
|
109
|
-
:param str blob_file_tokens: Token identifying location of uploaded
|
|
110
|
-
|
|
107
|
+
:param str blob_file_tokens: Token identifying location of uploaded
|
|
108
|
+
submission file (required)
|
|
109
|
+
:param str submission_description: Description of competition
|
|
110
|
+
submission (required)
|
|
111
111
|
:param str id: Competition name (required)
|
|
112
112
|
:return: Result
|
|
113
113
|
"""
|
|
@@ -117,12 +117,15 @@ class KaggleApi(object):
|
|
|
117
117
|
|
|
118
118
|
def competitions_submissions_upload(self, file, guid, content_length,
|
|
119
119
|
last_modified_date_utc): # noqa: E501
|
|
120
|
-
"""Upload competition submission file # noqa: E501
|
|
120
|
+
"""Upload competition submission file # noqa: E501.
|
|
121
121
|
|
|
122
122
|
:param file file: Competition submission file (required)
|
|
123
|
-
:param str guid: Location where submission should be uploaded
|
|
124
|
-
|
|
125
|
-
:param int
|
|
123
|
+
:param str guid: Location where submission should be uploaded
|
|
124
|
+
(required)
|
|
125
|
+
:param int content_length: Content length of file in bytes
|
|
126
|
+
(required)
|
|
127
|
+
:param int last_modified_date_utc: Last modified date of file in
|
|
128
|
+
seconds since epoch in UTC (required)
|
|
126
129
|
:return: Result
|
|
127
130
|
"""
|
|
128
131
|
print("competitions_submissions_upload() not implemented")
|
|
@@ -133,11 +136,14 @@ class KaggleApi(object):
|
|
|
133
136
|
|
|
134
137
|
def competitions_submissions_url(self, id, content_length,
|
|
135
138
|
last_modified_date_utc): # noqa: E501
|
|
136
|
-
"""Generate competition submission URL # noqa: E501
|
|
137
|
-
|
|
138
|
-
:param str id: Competition name, as it appears in the competition's
|
|
139
|
-
|
|
140
|
-
:param int
|
|
139
|
+
"""Generate competition submission URL # noqa: E501.
|
|
140
|
+
|
|
141
|
+
:param str id: Competition name, as it appears in the competition's
|
|
142
|
+
URL (required)
|
|
143
|
+
:param int content_length: Content length of file in bytes
|
|
144
|
+
(required)
|
|
145
|
+
:param int last_modified_date_utc: Last modified date of file in
|
|
146
|
+
seconds since epoch in UTC (required)
|
|
141
147
|
:param str file_name: Competition submission file name
|
|
142
148
|
:return: Result
|
|
143
149
|
"""
|
|
@@ -146,7 +152,8 @@ class KaggleApi(object):
|
|
|
146
152
|
raise NotImplementedError()
|
|
147
153
|
|
|
148
154
|
def create_inbox_file(self, create_inbox_file_request): # noqa: E501
|
|
149
|
-
"""Creates (aka \"drops\") a new file into the inbox. # noqa:
|
|
155
|
+
"""Creates (aka \"drops\") a new file into the inbox. # noqa:
|
|
156
|
+
E501.
|
|
150
157
|
|
|
151
158
|
:param CreateInboxFileRequest create_inbox_file_request: (required)
|
|
152
159
|
:return: Result
|
|
@@ -156,9 +163,10 @@ class KaggleApi(object):
|
|
|
156
163
|
raise NotImplementedError()
|
|
157
164
|
|
|
158
165
|
def datasets_create_new(self, request): # noqa: E501
|
|
159
|
-
"""Create a new dataset # noqa: E501
|
|
166
|
+
"""Create a new dataset # noqa: E501.
|
|
160
167
|
|
|
161
|
-
:param DatasetNewRequest request: Information for creating a new
|
|
168
|
+
:param DatasetNewRequest request: Information for creating a new
|
|
169
|
+
dataset (required)
|
|
162
170
|
:return: Result
|
|
163
171
|
"""
|
|
164
172
|
print("datasets_create_new() not implemented")
|
|
@@ -167,13 +175,12 @@ class KaggleApi(object):
|
|
|
167
175
|
|
|
168
176
|
def datasets_create_version_by_id(self, id, dataset_new_version_request,
|
|
169
177
|
**kwargs): # noqa: E501
|
|
170
|
-
"""Create a new dataset version by id # noqa: E501
|
|
178
|
+
"""Create a new dataset version by id # noqa: E501.
|
|
171
179
|
|
|
172
180
|
:param int id: Dataset ID (required)
|
|
173
|
-
:param DatasetNewVersionRequest dataset_new_version_request:
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
returns the request thread.
|
|
181
|
+
:param DatasetNewVersionRequest dataset_new_version_request:
|
|
182
|
+
Information for creating a new dataset version (required)
|
|
183
|
+
:return: throws NotImplementedError
|
|
177
184
|
"""
|
|
178
185
|
print("datasets_create_version_by_id() not implemented")
|
|
179
186
|
print("use kaggle_api_extended.KaggleApi.dataset_create_version() instead")
|
|
@@ -183,7 +190,7 @@ class KaggleApi(object):
|
|
|
183
190
|
owner_slug,
|
|
184
191
|
dataset_slug,
|
|
185
192
|
dataset_version_number=None): # noqa: E501
|
|
186
|
-
"""Download dataset file # noqa: E501
|
|
193
|
+
"""Download dataset file # noqa: E501.
|
|
187
194
|
|
|
188
195
|
:param str owner_slug: Dataset owner (required)
|
|
189
196
|
:param str dataset_slug: Dataset name (required)
|
|
@@ -200,15 +207,13 @@ class KaggleApi(object):
|
|
|
200
207
|
dataset_slug,
|
|
201
208
|
file_name,
|
|
202
209
|
dataset_version_number=None): # noqa: E501
|
|
203
|
-
"""Download dataset file # noqa: E501
|
|
210
|
+
"""Download dataset file # noqa: E501.
|
|
204
211
|
|
|
205
212
|
:param str owner_slug: Dataset owner (required)
|
|
206
213
|
:param str dataset_slug: Dataset name (required)
|
|
207
214
|
:param str file_name: File name (required)
|
|
208
215
|
:param str dataset_version_number: Dataset version number
|
|
209
|
-
:return:
|
|
210
|
-
If the method is called asynchronously,
|
|
211
|
-
returns the request thread.
|
|
216
|
+
:return: True if the file was downloaded successfully, False otherwise
|
|
212
217
|
"""
|
|
213
218
|
dataset = f'{owner_slug}/{dataset_slug}'
|
|
214
219
|
if dataset_version_number is not None:
|
|
@@ -227,11 +232,12 @@ class KaggleApi(object):
|
|
|
227
232
|
page=1,
|
|
228
233
|
max_size=None,
|
|
229
234
|
min_size=None): # noqa: E501
|
|
230
|
-
"""List datasets # noqa: E501
|
|
235
|
+
"""List datasets # noqa: E501.
|
|
231
236
|
|
|
232
237
|
:param str group: Display datasets by a particular group
|
|
233
238
|
:param str sort_by: Sort the results
|
|
234
|
-
:param str size: (DEPRECATED). Please use --max-size and --min-size
|
|
239
|
+
:param str size: (DEPRECATED). Please use --max-size and --min-size
|
|
240
|
+
to filter dataset sizes.
|
|
235
241
|
:param str filetype: Display datasets of a specific file type
|
|
236
242
|
:param str license: Display datasets with a specific license
|
|
237
243
|
:param str tagids: A comma separated list of tags to filter by
|
|
@@ -240,9 +246,7 @@ class KaggleApi(object):
|
|
|
240
246
|
:param int page: Page number
|
|
241
247
|
:param int max_size: Max Dataset Size (bytes)
|
|
242
248
|
:param int min_size: Max Dataset Size (bytes)
|
|
243
|
-
:return:
|
|
244
|
-
If the method is called asynchronously,
|
|
245
|
-
returns the request thread.
|
|
249
|
+
:return: List of ApiDatasetFile.
|
|
246
250
|
"""
|
|
247
251
|
return self.api_client.dataset_list(
|
|
248
252
|
sort_by=sort_by,
|
|
@@ -258,7 +262,7 @@ class KaggleApi(object):
|
|
|
258
262
|
min_size=min_size)
|
|
259
263
|
|
|
260
264
|
def datasets_status(self, owner_slug, dataset_slug, **kwargs): # noqa: E501
|
|
261
|
-
"""Get dataset creation status # noqa: E501
|
|
265
|
+
"""Get dataset creation status # noqa: E501.
|
|
262
266
|
|
|
263
267
|
:param str owner_slug: Dataset owner (required)
|
|
264
268
|
:param str dataset_slug: Dataset name (required)
|
|
@@ -267,19 +271,17 @@ class KaggleApi(object):
|
|
|
267
271
|
return self.api_client.dataset_status(f'{owner_slug}/{dataset_slug})')
|
|
268
272
|
|
|
269
273
|
def delete_model(self, owner_slug, model_slug): # noqa: E501
|
|
270
|
-
"""Delete a model # noqa: E501
|
|
274
|
+
"""Delete a model # noqa: E501.
|
|
271
275
|
|
|
272
276
|
:param str owner_slug: Model owner (required)
|
|
273
277
|
:param str model_slug: Model name (required)
|
|
274
|
-
:return:
|
|
275
|
-
If the method is called asynchronously,
|
|
276
|
-
returns the request thread.
|
|
278
|
+
:return: ApiDeleteModelResponse
|
|
277
279
|
"""
|
|
278
280
|
return self.api_client.model_delete(f'{owner_slug}/{model_slug})')
|
|
279
281
|
|
|
280
282
|
def delete_model_instance(self, owner_slug, model_slug, framework,
|
|
281
283
|
instance_slug): # noqa: E501
|
|
282
|
-
"""Delete a model instance # noqa: E501
|
|
284
|
+
"""Delete a model instance # noqa: E501.
|
|
283
285
|
|
|
284
286
|
:param str owner_slug: Model owner (required)
|
|
285
287
|
:param str model_slug: Model name (required)
|
|
@@ -293,7 +295,7 @@ class KaggleApi(object):
|
|
|
293
295
|
def delete_model_instance_version(self, owner_slug, model_slug, framework,
|
|
294
296
|
instance_slug,
|
|
295
297
|
version_number): # noqa: E501
|
|
296
|
-
"""Delete a model instance version # noqa: E501
|
|
298
|
+
"""Delete a model instance version # noqa: E501.
|
|
297
299
|
|
|
298
300
|
:param str owner_slug: Model owner (required)
|
|
299
301
|
:param str model_slug: Model name (required)
|
|
@@ -307,7 +309,7 @@ class KaggleApi(object):
|
|
|
307
309
|
yes=True)
|
|
308
310
|
|
|
309
311
|
def get_model(self, owner_slug, model_slug): # noqa: E501
|
|
310
|
-
"""Get a model # noqa: E501
|
|
312
|
+
"""Get a model # noqa: E501.
|
|
311
313
|
|
|
312
314
|
:param str owner_slug: Model owner (required)
|
|
313
315
|
:param str model_slug: Model name (required)
|
|
@@ -317,7 +319,7 @@ class KaggleApi(object):
|
|
|
317
319
|
|
|
318
320
|
def get_model_instance(self, owner_slug, model_slug, framework,
|
|
319
321
|
instance_slug): # noqa: E501
|
|
320
|
-
"""Get a model instance # noqa: E501
|
|
322
|
+
"""Get a model instance # noqa: E501.
|
|
321
323
|
|
|
322
324
|
:param str owner_slug: Model owner (required)
|
|
323
325
|
:param str model_slug: Model name (required)
|
|
@@ -329,7 +331,7 @@ class KaggleApi(object):
|
|
|
329
331
|
f'{owner_slug}/{model_slug}/{framework}/{instance_slug}')
|
|
330
332
|
|
|
331
333
|
def kernel_output(self, user_name, kernel_slug): # noqa: E501
|
|
332
|
-
"""Download the latest output from a kernel # noqa: E501
|
|
334
|
+
"""Download the latest output from a kernel # noqa: E501.
|
|
333
335
|
|
|
334
336
|
:param str user_name: Kernel owner (required)
|
|
335
337
|
:param str kernel_slug: Kernel name (required)
|
|
@@ -339,7 +341,7 @@ class KaggleApi(object):
|
|
|
339
341
|
f'{user_name}/{kernel_slug}', path=None, force=True)
|
|
340
342
|
|
|
341
343
|
def kernel_pull(self, user_name, kernel_slug): # noqa: E501
|
|
342
|
-
"""Pull the latest code from a kernel # noqa: E501
|
|
344
|
+
"""Pull the latest code from a kernel # noqa: E501.
|
|
343
345
|
|
|
344
346
|
:param str user_name: Kernel owner (required)
|
|
345
347
|
:param str kernel_slug: Kernel name (required)
|
|
@@ -348,9 +350,11 @@ class KaggleApi(object):
|
|
|
348
350
|
return self.api_client.kernels_pull(f'{user_name}/{kernel_slug}', path=None)
|
|
349
351
|
|
|
350
352
|
def kernel_push(self, kernel_push_request): # noqa: E501
|
|
351
|
-
"""Push a new kernel version. Can be used to create a new kernel and
|
|
353
|
+
"""Push a new kernel version. Can be used to create a new kernel and
|
|
354
|
+
update an existing one. # noqa: E501.
|
|
352
355
|
|
|
353
|
-
:param KernelPushRequest kernel_push_request: Information for
|
|
356
|
+
:param KernelPushRequest kernel_push_request: Information for
|
|
357
|
+
pushing a new kernel version (required)
|
|
354
358
|
:return: Result
|
|
355
359
|
"""
|
|
356
360
|
with tempfile.TemporaryDirectory() as tmpdir:
|
|
@@ -375,7 +379,7 @@ class KaggleApi(object):
|
|
|
375
379
|
return self.api_client.kernels_push(tmpdir)
|
|
376
380
|
|
|
377
381
|
def kernel_status(self, user_name, kernel_slug): # noqa: E501
|
|
378
|
-
"""Get the status of the latest kernel version # noqa: E501
|
|
382
|
+
"""Get the status of the latest kernel version # noqa: E501.
|
|
379
383
|
|
|
380
384
|
:param str user_name: Kernel owner (required)
|
|
381
385
|
:param str kernel_slug: Kernel name (required)
|
|
@@ -396,7 +400,7 @@ class KaggleApi(object):
|
|
|
396
400
|
kernel_type=None,
|
|
397
401
|
output_type=None,
|
|
398
402
|
sort_by=None): # noqa: E501
|
|
399
|
-
"""List kernels # noqa: E501
|
|
403
|
+
"""List kernels # noqa: E501.
|
|
400
404
|
|
|
401
405
|
:param int page: Page number
|
|
402
406
|
:param int page_size: Page size
|
|
@@ -406,10 +410,13 @@ class KaggleApi(object):
|
|
|
406
410
|
:param str language: Display kernels in a specific language
|
|
407
411
|
:param str kernel_type: Display kernels of a specific type
|
|
408
412
|
:param str output_type: Display kernels with a specific output type
|
|
409
|
-
:param str sort_by: Sort the results. 'relevance' only works if
|
|
413
|
+
:param str sort_by: Sort the results. 'relevance' only works if
|
|
414
|
+
there is a search query
|
|
410
415
|
:param str dataset: Display kernels using the specified dataset
|
|
411
|
-
:param str competition: Display kernels using the specified
|
|
412
|
-
|
|
416
|
+
:param str competition: Display kernels using the specified
|
|
417
|
+
competition
|
|
418
|
+
:param str parent_kernel: Display kernels that have forked the
|
|
419
|
+
specified kernel
|
|
413
420
|
:return: Result
|
|
414
421
|
"""
|
|
415
422
|
return self.api_client.kernels_list(
|
|
@@ -427,7 +434,7 @@ class KaggleApi(object):
|
|
|
427
434
|
sort_by=sort_by)
|
|
428
435
|
|
|
429
436
|
def metadata_get(self, owner_slug, dataset_slug): # noqa: E501
|
|
430
|
-
"""Get the metadata for a dataset # noqa: E501
|
|
437
|
+
"""Get the metadata for a dataset # noqa: E501.
|
|
431
438
|
|
|
432
439
|
:param str owner_slug: Dataset owner (required)
|
|
433
440
|
:param str dataset_slug: Dataset name (required)
|
|
@@ -438,11 +445,12 @@ class KaggleApi(object):
|
|
|
438
445
|
|
|
439
446
|
def metadata_post(self, owner_slug, dataset_slug, settings,
|
|
440
447
|
request): # noqa: E501
|
|
441
|
-
"""Update the metadata for a dataset # noqa: E501
|
|
448
|
+
"""Update the metadata for a dataset # noqa: E501.
|
|
442
449
|
|
|
443
450
|
:param str owner_slug: Dataset owner (required)
|
|
444
451
|
:param str dataset_slug: Dataset name (required)
|
|
445
|
-
:param DatasetUpdateSettingsRequest settings: Dataset metadata to
|
|
452
|
+
:param DatasetUpdateSettingsRequest settings: Dataset metadata to
|
|
453
|
+
update (required)
|
|
446
454
|
:return: Result
|
|
447
455
|
"""
|
|
448
456
|
with tempfile.TemporaryDirectory() as tmpdir:
|
|
@@ -458,7 +466,7 @@ class KaggleApi(object):
|
|
|
458
466
|
def model_instance_versions_download(self, owner_slug, model_slug, framework,
|
|
459
467
|
instance_slug,
|
|
460
468
|
version_number): # noqa: E501
|
|
461
|
-
"""Download model instance version files # noqa: E501
|
|
469
|
+
"""Download model instance version files # noqa: E501.
|
|
462
470
|
|
|
463
471
|
:param str owner_slug: Model owner (required)
|
|
464
472
|
:param str model_slug: Model name (required)
|
|
@@ -472,11 +480,12 @@ class KaggleApi(object):
|
|
|
472
480
|
|
|
473
481
|
def models_create_instance(self, owner_slug, model_slug,
|
|
474
482
|
model_new_instance_request): # noqa: E501
|
|
475
|
-
"""Create a new model instance # noqa: E501
|
|
483
|
+
"""Create a new model instance # noqa: E501.
|
|
476
484
|
|
|
477
485
|
:param str owner_slug: Model owner (required)
|
|
478
486
|
:param str model_slug: Model slug (required)
|
|
479
|
-
:param ModelNewInstanceRequest model_new_instance_request:
|
|
487
|
+
:param ModelNewInstanceRequest model_new_instance_request:
|
|
488
|
+
Information for creating a new model instance (required)
|
|
480
489
|
:return: Result
|
|
481
490
|
"""
|
|
482
491
|
print("models_create_instance() not implemented")
|
|
@@ -486,13 +495,15 @@ class KaggleApi(object):
|
|
|
486
495
|
def models_create_instance_version(
|
|
487
496
|
self, owner_slug, model_slug, framework, instance_slug,
|
|
488
497
|
model_instance_new_version_request): # noqa: E501
|
|
489
|
-
"""Create a new model instance version # noqa: E501
|
|
498
|
+
"""Create a new model instance version # noqa: E501.
|
|
490
499
|
|
|
491
500
|
:param str owner_slug: Model owner (required)
|
|
492
501
|
:param str model_slug: Model slug (required)
|
|
493
502
|
:param str framework: Model instance framework (required)
|
|
494
503
|
:param str instance_slug: Model instance slug (required)
|
|
495
|
-
:param ModelInstanceNewVersionRequest
|
|
504
|
+
:param ModelInstanceNewVersionRequest
|
|
505
|
+
model_instance_new_version_request: Information for creating a
|
|
506
|
+
new model instance version (required)
|
|
496
507
|
:return: Result
|
|
497
508
|
"""
|
|
498
509
|
print("models_create_instance_version() not implemented")
|
|
@@ -502,9 +513,10 @@ class KaggleApi(object):
|
|
|
502
513
|
raise NotImplementedError()
|
|
503
514
|
|
|
504
515
|
def models_create_new(self, model_new_request): # noqa: E501
|
|
505
|
-
"""Create a new model # noqa: E501
|
|
516
|
+
"""Create a new model # noqa: E501.
|
|
506
517
|
|
|
507
|
-
:param ModelNewRequest model_new_request: Information for creating a
|
|
518
|
+
:param ModelNewRequest model_new_request: Information for creating a
|
|
519
|
+
new model (required)
|
|
508
520
|
:return: Result
|
|
509
521
|
"""
|
|
510
522
|
with tempfile.TemporaryDirectory() as tmpdir:
|
|
@@ -527,14 +539,15 @@ class KaggleApi(object):
|
|
|
527
539
|
search=None,
|
|
528
540
|
owner=None,
|
|
529
541
|
page_size=20,
|
|
530
|
-
page_token=None):
|
|
531
|
-
"""
|
|
542
|
+
page_token=None):
|
|
543
|
+
"""List models
|
|
544
|
+
|
|
532
545
|
:param str search: Search terms
|
|
533
546
|
:param str sort_by: Sort the results
|
|
534
547
|
:param str owner: Display models by a specific user or organization
|
|
535
548
|
:param int page_size: Page size
|
|
536
549
|
:param str page_token: Page token for pagination
|
|
537
|
-
:return:
|
|
550
|
+
:return: list of models
|
|
538
551
|
"""
|
|
539
552
|
return self.api_client.model_list(
|
|
540
553
|
sort_by=sort_by,
|
|
@@ -549,11 +562,12 @@ class KaggleApi(object):
|
|
|
549
562
|
model_slug,
|
|
550
563
|
model_update_request,
|
|
551
564
|
): # noqa: E501
|
|
552
|
-
"""Update a model # noqa: E501
|
|
565
|
+
"""Update a model # noqa: E501.
|
|
553
566
|
|
|
554
567
|
:param str owner_slug: Model owner (required)
|
|
555
568
|
:param str model_slug: Model name (required)
|
|
556
|
-
:param ModelUpdateRequest model_update_request: Information for
|
|
569
|
+
:param ModelUpdateRequest model_update_request: Information for
|
|
570
|
+
updating a model (required)
|
|
557
571
|
:return: Result
|
|
558
572
|
"""
|
|
559
573
|
with tempfile.TemporaryDirectory() as tmpdir:
|
|
@@ -575,13 +589,14 @@ class KaggleApi(object):
|
|
|
575
589
|
def update_model_instance(self, owner_slug, model_slug, framework,
|
|
576
590
|
instance_slug,
|
|
577
591
|
model_instance_update_request): # noqa: E501
|
|
578
|
-
"""Update a model # noqa: E501
|
|
592
|
+
"""Update a model # noqa: E501.
|
|
579
593
|
|
|
580
594
|
:param str owner_slug: Model owner (required)
|
|
581
595
|
:param str model_slug: Model name (required)
|
|
582
596
|
:param str framework: Model instance framework (required)
|
|
583
597
|
:param str instance_slug: Model instance slug (required)
|
|
584
|
-
:param ModelInstanceUpdateRequest model_instance_update_request:
|
|
598
|
+
:param ModelInstanceUpdateRequest model_instance_update_request:
|
|
599
|
+
Information for updating a model instance (required)
|
|
585
600
|
:return: Result
|
|
586
601
|
"""
|
|
587
602
|
with tempfile.TemporaryDirectory() as tmpdir:
|
|
@@ -604,10 +619,8 @@ class KaggleApi(object):
|
|
|
604
619
|
return self.api_client.model_instance_update(tmpdir)
|
|
605
620
|
|
|
606
621
|
def upload_file(self, start_blob_upload_request): # noqa: E501
|
|
607
|
-
"""Start uploading a file # noqa: E501
|
|
608
|
-
|
|
609
|
-
:return: StartBlobUploadResponse
|
|
610
|
-
"""
|
|
622
|
+
"""Start uploading a file # noqa: E501 :param StartBlobUploadRequest
|
|
623
|
+
start_blob_upload_request: (required) :return: StartBlobUploadResponse."""
|
|
611
624
|
print("upload_file() not implemented")
|
|
612
625
|
print("it should not be needed after converting your code")
|
|
613
626
|
print("to use kaggle_api_extended.KaggleApi.<high-level-fn>() instead")
|