kaggle 1.7.4.1__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.
Files changed (40) hide show
  1. kaggle/api/kaggle_api.py +92 -79
  2. kaggle/api/kaggle_api_extended.py +909 -878
  3. kaggle/configuration.py +3 -3
  4. kaggle/models/dataset_column.py +58 -49
  5. kaggle/models/dataset_new_request.py +47 -31
  6. kaggle/models/dataset_new_version_request.py +56 -31
  7. kaggle/models/dataset_update_settings_request.py +58 -32
  8. kaggle/models/kernel_push_request.py +86 -51
  9. kaggle/models/model_instance_new_version_request.py +20 -12
  10. kaggle/models/model_instance_update_request.py +68 -37
  11. kaggle/models/model_new_instance_request.py +85 -47
  12. kaggle/models/model_new_request.py +26 -19
  13. kaggle/models/model_update_request.py +34 -23
  14. kaggle/models/start_blob_upload_request.py +60 -49
  15. kaggle/models/start_blob_upload_response.py +27 -22
  16. kaggle/models/upload_file.py +33 -31
  17. {kaggle-1.7.4.1.dist-info → kaggle-1.7.4.5.dist-info}/METADATA +1 -1
  18. {kaggle-1.7.4.1.dist-info → kaggle-1.7.4.5.dist-info}/RECORD +40 -31
  19. kagglesdk/__init__.py +1 -1
  20. kagglesdk/datasets/types/dataset_api_service.py +16 -0
  21. kagglesdk/kaggle_client.py +12 -0
  22. kagglesdk/kaggle_env.py +9 -11
  23. kagglesdk/kaggle_http_client.py +91 -56
  24. kagglesdk/kaggle_object.py +97 -42
  25. kagglesdk/kernels/types/kernels_api_service.py +24 -0
  26. kagglesdk/models/services/model_api_service.py +7 -6
  27. kagglesdk/models/types/model_api_service.py +31 -15
  28. kagglesdk/security/__init__.py +0 -0
  29. kagglesdk/security/services/__init__.py +0 -0
  30. kagglesdk/security/services/oauth_service.py +32 -0
  31. kagglesdk/security/types/__init__.py +0 -0
  32. kagglesdk/security/types/authentication.py +171 -0
  33. kagglesdk/security/types/oauth_service.py +394 -0
  34. kagglesdk/test/test_client.py +4 -6
  35. kagglesdk/users/services/__init__.py +0 -0
  36. kagglesdk/users/services/account_service.py +19 -0
  37. kagglesdk/users/types/account_service.py +204 -0
  38. {kaggle-1.7.4.1.dist-info → kaggle-1.7.4.5.dist-info}/WHEEL +0 -0
  39. {kaggle-1.7.4.1.dist-info → kaggle-1.7.4.5.dist-info}/entry_points.txt +0 -0
  40. {kaggle-1.7.4.1.dist-info → kaggle-1.7.4.5.dist-info}/licenses/LICENSE.txt +0 -0
kaggle/configuration.py CHANGED
@@ -26,7 +26,7 @@ import urllib3
26
26
  class Configuration:
27
27
 
28
28
  def __init__(self):
29
- """Constructor"""
29
+ """Constructor."""
30
30
  # Default Base url
31
31
  self.host = _get_endpoint_from_env() or "https://www.kaggle.com/api/v1"
32
32
 
@@ -100,7 +100,7 @@ class Configuration:
100
100
 
101
101
  @property
102
102
  def debug(self):
103
- """Debug status
103
+ """Debug status.
104
104
 
105
105
  :param value: The debug status, True or False.
106
106
  :type: bool
@@ -109,7 +109,7 @@ class Configuration:
109
109
 
110
110
  @debug.setter
111
111
  def debug(self, value):
112
- """Debug status
112
+ """Debug status.
113
113
 
114
114
  :param value: The debug status, True or False.
115
115
  :type: bool
@@ -74,121 +74,130 @@ class DatasetColumn(object):
74
74
 
75
75
  @property
76
76
  def order(self):
77
- """Gets the order of this DatasetColumn. # noqa: E501
77
+ """Gets the order of this DatasetColumn. # noqa: E501.
78
78
 
79
- The order that the column comes in, 0-based. (The first column is 0, second is 1, etc.) # noqa: E501
79
+ The order that the column comes in, 0-based. (The first column is 0,
80
+ second is 1, etc.) # noqa: E501
80
81
 
81
- :return: The order of this DatasetColumn. # noqa: E501
82
- :rtype: float
83
- """
82
+ :return: The order of this DatasetColumn. # noqa: E501
83
+ :rtype: float
84
+ """
84
85
  return self._order
85
86
 
86
87
  @order.setter
87
88
  def order(self, order):
88
89
  """Sets the order of this DatasetColumn.
89
90
 
90
- The order that the column comes in, 0-based. (The first column is 0, second is 1, etc.) # noqa: E501
91
+ The order that the column comes in, 0-based. (The first column is 0,
92
+ second is 1, etc.) # noqa: E501
91
93
 
92
- :param order: The order of this DatasetColumn. # noqa: E501
93
- :type: float
94
- """
94
+ :param order: The order of this DatasetColumn. # noqa: E501
95
+ :type: float
96
+ """
95
97
 
96
98
  self._order = order
97
99
 
98
100
  @property
99
101
  def name(self):
100
- """Gets the name of this DatasetColumn. # noqa: E501
102
+ """Gets the name of this DatasetColumn. # noqa: E501.
101
103
 
102
- The column name # noqa: E501
104
+ The column name # noqa: E501
103
105
 
104
- :return: The name of this DatasetColumn. # noqa: E501
105
- :rtype: str
106
- """
106
+ :return: The name of this DatasetColumn. # noqa: E501
107
+ :rtype: str
108
+ """
107
109
  return self._name
108
110
 
109
111
  @name.setter
110
112
  def name(self, name):
111
113
  """Sets the name of this DatasetColumn.
112
114
 
113
- The column name # noqa: E501
115
+ The column name # noqa: E501
114
116
 
115
- :param name: The name of this DatasetColumn. # noqa: E501
116
- :type: str
117
- """
117
+ :param name: The name of this DatasetColumn. # noqa: E501
118
+ :type: str
119
+ """
118
120
 
119
121
  self._name = name
120
122
 
121
123
  @property
122
124
  def type(self):
123
- """Gets the type of this DatasetColumn. # noqa: E501
125
+ """Gets the type of this DatasetColumn. # noqa: E501.
124
126
 
125
- The type of all of the fields in the column. Please see the data types on https://github.com/Kaggle/kaggle-api/wiki/Dataset-Metadata # noqa: E501
127
+ The type of all of the fields in the column. Please see the data
128
+ types on
129
+ https://github.com/Kaggle/kaggle-api/wiki/Dataset-Metadata
130
+ # noqa: E501
126
131
 
127
- :return: The type of this DatasetColumn. # noqa: E501
128
- :rtype: str
129
- """
132
+ :return: The type of this DatasetColumn. # noqa: E501
133
+ :rtype: str
134
+ """
130
135
  return self._type
131
136
 
132
137
  @type.setter
133
138
  def type(self, type):
134
139
  """Sets the type of this DatasetColumn.
135
140
 
136
- The type of all of the fields in the column. Please see the data types on https://github.com/Kaggle/kaggle-api/wiki/Dataset-Metadata # noqa: E501
141
+ The type of all of the fields in the column. Please see the data
142
+ types on
143
+ https://github.com/Kaggle/kaggle-api/wiki/Dataset-Metadata
144
+ # noqa: E501
137
145
 
138
- :param type: The type of this DatasetColumn. # noqa: E501
139
- :type: str
140
- """
146
+ :param type: The type of this DatasetColumn. # noqa: E501
147
+ :type: str
148
+ """
141
149
 
142
150
  self._type = type
143
151
 
144
152
  @property
145
153
  def original_type(self):
146
- """Gets the original_type of this DatasetColumn. # noqa: E501
154
+ """Gets the original_type of this DatasetColumn. # noqa: E501.
147
155
 
148
- Used to store the original type of the column, which will be converted to Kaggle's types. For example, an `originalType` of `\"integer\"` would convert to a `type` of `\"numeric\"` # noqa: E501
156
+ Used to store the original type of the column, which will be converted to Kaggle's types. For example, an `originalType` of `\"integer\"` would convert to a `type` of `\"numeric\"` # noqa: E501
149
157
 
150
- :return: The original_type of this DatasetColumn. # noqa: E501
151
- :rtype: str
152
- """
158
+ :return: The original_type of this DatasetColumn. # noqa: E501
159
+ :rtype: str
160
+ """
153
161
  return self._original_type
154
162
 
155
163
  @original_type.setter
156
164
  def original_type(self, original_type):
157
165
  """Sets the original_type of this DatasetColumn.
158
166
 
159
- Used to store the original type of the column, which will be converted to Kaggle's types. For example, an `originalType` of `\"integer\"` would convert to a `type` of `\"numeric\"` # noqa: E501
167
+ Used to store the original type of the column, which will be converted to Kaggle's types. For example, an `originalType` of `\"integer\"` would convert to a `type` of `\"numeric\"` # noqa: E501
160
168
 
161
- :param original_type: The original_type of this DatasetColumn. # noqa: E501
162
- :type: str
163
- """
169
+ :param original_type: The original_type of this DatasetColumn. # noqa: E501
170
+ :type: str
171
+ """
164
172
 
165
173
  self._original_type = original_type
166
174
 
167
175
  @property
168
176
  def description(self):
169
- """Gets the description of this DatasetColumn. # noqa: E501
177
+ """Gets the description of this DatasetColumn. # noqa: E501.
170
178
 
171
- The description of the column # noqa: E501
179
+ The description of the column # noqa: E501
172
180
 
173
- :return: The description of this DatasetColumn. # noqa: E501
174
- :rtype: str
175
- """
181
+ :return: The description of this DatasetColumn. # noqa: E501
182
+ :rtype: str
183
+ """
176
184
  return self._description
177
185
 
178
186
  @description.setter
179
187
  def description(self, description):
180
188
  """Sets the description of this DatasetColumn.
181
189
 
182
- The description of the column # noqa: E501
190
+ The description of the column # noqa: E501
183
191
 
184
- :param description: The description of this DatasetColumn. # noqa: E501
185
- :type: str
186
- """
192
+ :param description: The description of this DatasetColumn. # noqa:
193
+ E501
194
+ :type: str
195
+ """
187
196
 
188
197
  self._description = description
189
198
 
190
199
  def to_dict(self):
191
- """Returns the model properties as a dict"""
200
+ """Returns the model properties as a dict."""
192
201
  result = {}
193
202
 
194
203
  for attr, _ in six.iteritems(self.column_types):
@@ -209,7 +218,7 @@ class DatasetColumn(object):
209
218
  return result
210
219
 
211
220
  def to_str(self):
212
- """Returns the string representation of the model"""
221
+ """Returns the string representation of the model."""
213
222
  return pprint.pformat(self.to_dict())
214
223
 
215
224
  def __repr__(self):
@@ -217,12 +226,12 @@ class DatasetColumn(object):
217
226
  return self.to_str()
218
227
 
219
228
  def __eq__(self, other):
220
- """Returns true if both objects are equal"""
229
+ """Returns true if both objects are equal."""
221
230
  if not isinstance(other, DatasetColumn):
222
231
  return False
223
232
 
224
233
  return self.__dict__ == other.__dict__
225
234
 
226
235
  def __ne__(self, other):
227
- """Returns true if both objects are not equal"""
236
+ """Returns true if both objects are not equal."""
228
237
  return not self == other
@@ -93,7 +93,7 @@ class DatasetNewRequest(object):
93
93
 
94
94
  @property
95
95
  def title(self):
96
- """Gets the title of this DatasetNewRequest. # noqa: E501
96
+ """Gets the title of this DatasetNewRequest. # noqa: E501.
97
97
 
98
98
  The title of the new dataset # noqa: E501
99
99
 
@@ -118,7 +118,7 @@ class DatasetNewRequest(object):
118
118
 
119
119
  @property
120
120
  def slug(self):
121
- """Gets the slug of this DatasetNewRequest. # noqa: E501
121
+ """Gets the slug of this DatasetNewRequest. # noqa: E501.
122
122
 
123
123
  The slug that the dataset should be created with # noqa: E501
124
124
 
@@ -141,7 +141,7 @@ class DatasetNewRequest(object):
141
141
 
142
142
  @property
143
143
  def owner_slug(self):
144
- """Gets the owner_slug of this DatasetNewRequest. # noqa: E501
144
+ """Gets the owner_slug of this DatasetNewRequest. # noqa: E501.
145
145
 
146
146
  The owner's username # noqa: E501
147
147
 
@@ -156,7 +156,8 @@ class DatasetNewRequest(object):
156
156
 
157
157
  The owner's username # noqa: E501
158
158
 
159
- :param owner_slug: The owner_slug of this DatasetNewRequest. # noqa: E501
159
+ :param owner_slug: The owner_slug of this DatasetNewRequest. #
160
+ noqa: E501
160
161
  :type: str
161
162
  """
162
163
 
@@ -164,11 +165,13 @@ class DatasetNewRequest(object):
164
165
 
165
166
  @property
166
167
  def license_name(self):
167
- """Gets the license_name of this DatasetNewRequest. # noqa: E501
168
+ """Gets the license_name of this DatasetNewRequest. # noqa: E501.
168
169
 
169
- The license that should be associated with the dataset # noqa: E501
170
+ The license that should be associated with the dataset # noqa:
171
+ E501
170
172
 
171
- :return: The license_name of this DatasetNewRequest. # noqa: E501
173
+ :return: The license_name of this DatasetNewRequest. # noqa:
174
+ E501
172
175
  :rtype: str
173
176
  """
174
177
  return self._license_name
@@ -177,9 +180,11 @@ class DatasetNewRequest(object):
177
180
  def license_name(self, license_name):
178
181
  """Sets the license_name of this DatasetNewRequest.
179
182
 
180
- The license that should be associated with the dataset # noqa: E501
183
+ The license that should be associated with the dataset # noqa:
184
+ E501
181
185
 
182
- :param license_name: The license_name of this DatasetNewRequest. # noqa: E501
186
+ :param license_name: The license_name of this DatasetNewRequest.
187
+ # noqa: E501
183
188
  :type: str
184
189
  """
185
190
  allowed_values = ["CC0-1.0", "CC-BY-SA-4.0", "GPL-2.0", "ODbL-1.0", "CC-BY-NC-SA-4.0", "unknown", "DbCL-1.0", "CC-BY-SA-3.0", "copyright-authors", "other", "reddit-api", "world-bank", "CC-BY-4.0", "CC-BY-NC-4.0", "PDDL", "CC-BY-3.0", "CC-BY-3.0-IGO", "US-Government-Works", "CC-BY-NC-SA-3.0-IGO", "CDLA-Permissive-1.0", "CDLA-Sharing-1.0", "CC-BY-ND-4.0", "CC-BY-NC-ND-4.0", "ODC-BY-1.0", "LGPL-3.0", "AGPL-3.0", "FDL-1.3", "EU-ODP-Legal-Notice", "apache-2.0", "GPL-3.0"] # noqa: E501
@@ -202,7 +207,7 @@ class DatasetNewRequest(object):
202
207
 
203
208
  @property
204
209
  def subtitle(self):
205
- """Gets the subtitle of this DatasetNewRequest. # noqa: E501
210
+ """Gets the subtitle of this DatasetNewRequest. # noqa: E501.
206
211
 
207
212
  The subtitle to be set on the dataset # noqa: E501
208
213
 
@@ -217,7 +222,8 @@ class DatasetNewRequest(object):
217
222
 
218
223
  The subtitle to be set on the dataset # noqa: E501
219
224
 
220
- :param subtitle: The subtitle of this DatasetNewRequest. # noqa: E501
225
+ :param subtitle: The subtitle of this DatasetNewRequest. #
226
+ noqa: E501
221
227
  :type: str
222
228
  """
223
229
 
@@ -225,11 +231,11 @@ class DatasetNewRequest(object):
225
231
 
226
232
  @property
227
233
  def description(self):
228
- """Gets the description of this DatasetNewRequest. # noqa: E501
234
+ """Gets the description of this DatasetNewRequest. # noqa: E501.
229
235
 
230
236
  The description to be set on the dataset # noqa: E501
231
237
 
232
- :return: The description of this DatasetNewRequest. # noqa: E501
238
+ :return: The description of this DatasetNewRequest. # noqa: E501
233
239
  :rtype: str
234
240
  """
235
241
  return self._description
@@ -240,7 +246,8 @@ class DatasetNewRequest(object):
240
246
 
241
247
  The description to be set on the dataset # noqa: E501
242
248
 
243
- :param description: The description of this DatasetNewRequest. # noqa: E501
249
+ :param description: The description of this DatasetNewRequest. #
250
+ noqa: E501
244
251
  :type: str
245
252
  """
246
253
 
@@ -248,9 +255,10 @@ class DatasetNewRequest(object):
248
255
 
249
256
  @property
250
257
  def files(self):
251
- """Gets the files of this DatasetNewRequest. # noqa: E501
258
+ """Gets the files of this DatasetNewRequest. # noqa: E501.
252
259
 
253
- A list of files that should be associated with the dataset # noqa: E501
260
+ A list of files that should be associated with the dataset #
261
+ noqa: E501
254
262
 
255
263
  :return: The files of this DatasetNewRequest. # noqa: E501
256
264
  :rtype: list[UploadFile]
@@ -261,7 +269,8 @@ class DatasetNewRequest(object):
261
269
  def files(self, files):
262
270
  """Sets the files of this DatasetNewRequest.
263
271
 
264
- A list of files that should be associated with the dataset # noqa: E501
272
+ A list of files that should be associated with the dataset #
273
+ noqa: E501
265
274
 
266
275
  :param files: The files of this DatasetNewRequest. # noqa: E501
267
276
  :type: list[UploadFile]
@@ -273,7 +282,7 @@ class DatasetNewRequest(object):
273
282
 
274
283
  @property
275
284
  def is_private(self):
276
- """Gets the is_private of this DatasetNewRequest. # noqa: E501
285
+ """Gets the is_private of this DatasetNewRequest. # noqa: E501.
277
286
 
278
287
  Whether or not the dataset should be private # noqa: E501
279
288
 
@@ -288,7 +297,8 @@ class DatasetNewRequest(object):
288
297
 
289
298
  Whether or not the dataset should be private # noqa: E501
290
299
 
291
- :param is_private: The is_private of this DatasetNewRequest. # noqa: E501
300
+ :param is_private: The is_private of this DatasetNewRequest. #
301
+ noqa: E501
292
302
  :type: bool
293
303
  """
294
304
 
@@ -296,11 +306,13 @@ class DatasetNewRequest(object):
296
306
 
297
307
  @property
298
308
  def convert_to_csv(self):
299
- """Gets the convert_to_csv of this DatasetNewRequest. # noqa: E501
309
+ """Gets the convert_to_csv of this DatasetNewRequest. # noqa: E501.
300
310
 
301
- Whether or not a tabular dataset should be converted to csv # noqa: E501
311
+ Whether or not a tabular dataset should be converted to csv #
312
+ noqa: E501
302
313
 
303
- :return: The convert_to_csv of this DatasetNewRequest. # noqa: E501
314
+ :return: The convert_to_csv of this DatasetNewRequest. # noqa:
315
+ E501
304
316
  :rtype: bool
305
317
  """
306
318
  return self._convert_to_csv
@@ -309,9 +321,11 @@ class DatasetNewRequest(object):
309
321
  def convert_to_csv(self, convert_to_csv):
310
322
  """Sets the convert_to_csv of this DatasetNewRequest.
311
323
 
312
- Whether or not a tabular dataset should be converted to csv # noqa: E501
324
+ Whether or not a tabular dataset should be converted to csv #
325
+ noqa: E501
313
326
 
314
- :param convert_to_csv: The convert_to_csv of this DatasetNewRequest. # noqa: E501
327
+ :param convert_to_csv: The convert_to_csv of this
328
+ DatasetNewRequest. # noqa: E501
315
329
  :type: bool
316
330
  """
317
331
 
@@ -319,11 +333,12 @@ class DatasetNewRequest(object):
319
333
 
320
334
  @property
321
335
  def category_ids(self):
322
- """Gets the category_ids of this DatasetNewRequest. # noqa: E501
336
+ """Gets the category_ids of this DatasetNewRequest. # noqa: E501.
323
337
 
324
338
  A list of tag IDs to associated with the dataset # noqa: E501
325
339
 
326
- :return: The category_ids of this DatasetNewRequest. # noqa: E501
340
+ :return: The category_ids of this DatasetNewRequest. # noqa:
341
+ E501
327
342
  :rtype: list[str]
328
343
  """
329
344
  return self._category_ids
@@ -334,14 +349,15 @@ class DatasetNewRequest(object):
334
349
 
335
350
  A list of tag IDs to associated with the dataset # noqa: E501
336
351
 
337
- :param category_ids: The category_ids of this DatasetNewRequest. # noqa: E501
352
+ :param category_ids: The category_ids of this DatasetNewRequest.
353
+ # noqa: E501
338
354
  :type: list[str]
339
355
  """
340
356
 
341
357
  self._category_ids = category_ids
342
358
 
343
359
  def to_dict(self):
344
- """Returns the model properties as a dict"""
360
+ """Returns the model properties as a dict."""
345
361
  result = {}
346
362
 
347
363
  for attr, _ in six.iteritems(self.project_types):
@@ -365,7 +381,7 @@ class DatasetNewRequest(object):
365
381
  return result
366
382
 
367
383
  def to_str(self):
368
- """Returns the string representation of the model"""
384
+ """Returns the string representation of the model."""
369
385
  return pprint.pformat(self.to_dict())
370
386
 
371
387
  def __repr__(self):
@@ -373,13 +389,13 @@ class DatasetNewRequest(object):
373
389
  return self.to_str()
374
390
 
375
391
  def __eq__(self, other):
376
- """Returns true if both objects are equal"""
392
+ """Returns true if both objects are equal."""
377
393
  if not isinstance(other, DatasetNewRequest):
378
394
  return False
379
395
 
380
396
  return self.__dict__ == other.__dict__
381
397
 
382
398
  def __ne__(self, other):
383
- """Returns true if both objects are not equal"""
399
+ """Returns true if both objects are not equal."""
384
400
  return not self == other
385
401