kaggle 1.7.4.2__py3-none-any.whl → 1.8.0__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 (114) hide show
  1. kaggle/__init__.py +10 -6
  2. kaggle/api/kaggle_api.py +574 -585
  3. kaggle/api/kaggle_api_extended.py +5251 -4738
  4. kaggle/cli.py +1335 -1585
  5. kaggle/models/api_blob_type.py +3 -3
  6. kaggle/models/dataset_column.py +129 -129
  7. kaggle/models/dataset_new_request.py +130 -72
  8. kaggle/models/dataset_new_version_request.py +88 -56
  9. kaggle/models/dataset_update_settings_request.py +93 -59
  10. kaggle/models/kaggle_models_extended.py +169 -172
  11. kaggle/models/kernel_push_request.py +152 -100
  12. kaggle/models/model_instance_new_version_request.py +30 -30
  13. kaggle/models/model_instance_update_request.py +171 -71
  14. kaggle/models/model_new_instance_request.py +223 -88
  15. kaggle/models/model_new_request.py +61 -46
  16. kaggle/models/model_update_request.py +66 -48
  17. kaggle/models/start_blob_upload_request.py +146 -138
  18. kaggle/models/start_blob_upload_response.py +83 -78
  19. kaggle/models/upload_file.py +92 -96
  20. kaggle/test/test_authenticate.py +23 -23
  21. {kaggle-1.7.4.2.dist-info → kaggle-1.8.0.dist-info}/METADATA +11 -15
  22. kaggle-1.8.0.dist-info/RECORD +148 -0
  23. kagglesdk/__init__.py +5 -1
  24. kagglesdk/benchmarks/services/__init__.py +0 -0
  25. kagglesdk/benchmarks/services/benchmarks_api_service.py +19 -0
  26. kagglesdk/benchmarks/types/__init__.py +0 -0
  27. kagglesdk/benchmarks/types/benchmark_types.py +307 -0
  28. kagglesdk/benchmarks/types/benchmarks_api_service.py +243 -0
  29. kagglesdk/blobs/services/blob_api_service.py +1 -1
  30. kagglesdk/blobs/types/blob_api_service.py +2 -2
  31. kagglesdk/common/services/__init__.py +0 -0
  32. kagglesdk/common/services/operations_service.py +46 -0
  33. kagglesdk/common/types/file_download.py +1 -1
  34. kagglesdk/common/types/http_redirect.py +1 -1
  35. kagglesdk/common/types/operations.py +194 -0
  36. kagglesdk/common/types/operations_service.py +48 -0
  37. kagglesdk/community/__init__.py +0 -0
  38. kagglesdk/community/types/__init__.py +0 -0
  39. kagglesdk/community/types/content_enums.py +44 -0
  40. kagglesdk/community/types/organization.py +410 -0
  41. kagglesdk/competitions/services/competition_api_service.py +49 -12
  42. kagglesdk/competitions/types/competition.py +14 -0
  43. kagglesdk/competitions/types/competition_api_service.py +1639 -1275
  44. kagglesdk/competitions/types/search_competitions.py +28 -0
  45. kagglesdk/datasets/databundles/__init__.py +0 -0
  46. kagglesdk/datasets/databundles/types/__init__.py +0 -0
  47. kagglesdk/datasets/databundles/types/databundle_api_types.py +540 -0
  48. kagglesdk/datasets/services/dataset_api_service.py +39 -14
  49. kagglesdk/datasets/types/dataset_api_service.py +567 -297
  50. kagglesdk/datasets/types/dataset_enums.py +21 -0
  51. kagglesdk/datasets/types/dataset_service.py +145 -0
  52. kagglesdk/datasets/types/dataset_types.py +74 -74
  53. kagglesdk/datasets/types/search_datasets.py +6 -0
  54. kagglesdk/discussions/__init__.py +0 -0
  55. kagglesdk/discussions/types/__init__.py +0 -0
  56. kagglesdk/discussions/types/search_discussions.py +43 -0
  57. kagglesdk/discussions/types/writeup_enums.py +11 -0
  58. kagglesdk/education/services/education_api_service.py +1 -1
  59. kagglesdk/education/types/education_api_service.py +1 -1
  60. kagglesdk/kaggle_client.py +55 -20
  61. kagglesdk/kaggle_creds.py +148 -0
  62. kagglesdk/kaggle_env.py +89 -27
  63. kagglesdk/kaggle_http_client.py +235 -290
  64. kagglesdk/kaggle_oauth.py +200 -0
  65. kagglesdk/kaggle_object.py +298 -250
  66. kagglesdk/kernels/services/kernels_api_service.py +46 -9
  67. kagglesdk/kernels/types/kernels_api_service.py +658 -158
  68. kagglesdk/kernels/types/kernels_enums.py +6 -0
  69. kagglesdk/kernels/types/search_kernels.py +6 -0
  70. kagglesdk/licenses/__init__.py +0 -0
  71. kagglesdk/licenses/types/__init__.py +0 -0
  72. kagglesdk/licenses/types/licenses_types.py +182 -0
  73. kagglesdk/models/services/model_api_service.py +46 -21
  74. kagglesdk/models/types/model_api_service.py +1018 -652
  75. kagglesdk/models/types/model_enums.py +8 -0
  76. kagglesdk/models/types/model_service.py +71 -71
  77. kagglesdk/models/types/model_types.py +1057 -5
  78. kagglesdk/models/types/search_models.py +8 -0
  79. kagglesdk/search/__init__.py +0 -0
  80. kagglesdk/search/services/__init__.py +0 -0
  81. kagglesdk/search/services/search_api_service.py +19 -0
  82. kagglesdk/search/types/__init__.py +0 -0
  83. kagglesdk/search/types/search_api_service.py +2435 -0
  84. kagglesdk/search/types/search_content_shared.py +50 -0
  85. kagglesdk/search/types/search_enums.py +45 -0
  86. kagglesdk/search/types/search_service.py +303 -0
  87. kagglesdk/security/__init__.py +0 -0
  88. kagglesdk/security/services/__init__.py +0 -0
  89. kagglesdk/security/services/iam_service.py +31 -0
  90. kagglesdk/security/services/oauth_service.py +58 -0
  91. kagglesdk/security/types/__init__.py +0 -0
  92. kagglesdk/security/types/authentication.py +171 -0
  93. kagglesdk/security/types/iam_service.py +496 -0
  94. kagglesdk/security/types/oauth_service.py +1181 -0
  95. kagglesdk/security/types/roles.py +8 -0
  96. kagglesdk/security/types/security_types.py +159 -0
  97. kagglesdk/test/__init__.py +0 -0
  98. kagglesdk/test/test_client.py +20 -24
  99. kagglesdk/users/services/__init__.py +0 -0
  100. kagglesdk/users/services/account_service.py +31 -0
  101. kagglesdk/users/services/group_api_service.py +31 -0
  102. kagglesdk/users/types/account_service.py +345 -0
  103. kagglesdk/users/types/group_api_service.py +315 -0
  104. kagglesdk/users/types/group_types.py +165 -0
  105. kagglesdk/users/types/groups_enum.py +8 -0
  106. kagglesdk/users/types/progression_service.py +9 -0
  107. kagglesdk/users/types/search_users.py +23 -0
  108. kagglesdk/users/types/user_avatar.py +226 -0
  109. kaggle/configuration.py +0 -206
  110. kaggle-1.7.4.2.dist-info/RECORD +0 -89
  111. {kaggle-1.7.4.2.dist-info → kaggle-1.8.0.dist-info}/WHEEL +0 -0
  112. {kaggle-1.7.4.2.dist-info → kaggle-1.8.0.dist-info}/entry_points.txt +0 -0
  113. {kaggle-1.7.4.2.dist-info → kaggle-1.8.0.dist-info}/licenses/LICENSE.txt +0 -0
  114. {kaggle/test → kagglesdk/benchmarks}/__init__.py +0 -0
@@ -32,33 +32,46 @@ class DatasetNewRequest(object):
32
32
  attribute_map (dict): The key is attribute name
33
33
  and the value is json key in definition.
34
34
  """
35
+
35
36
  project_types = {
36
- 'title': 'str',
37
- 'slug': 'str',
38
- 'owner_slug': 'str',
39
- 'license_name': 'str',
40
- 'subtitle': 'str',
41
- 'description': 'str',
42
- 'files': 'list[UploadFile]',
43
- 'is_private': 'bool',
44
- 'convert_to_csv': 'bool',
45
- 'category_ids': 'list[str]'
37
+ "title": "str",
38
+ "slug": "str",
39
+ "owner_slug": "str",
40
+ "license_name": "str",
41
+ "subtitle": "str",
42
+ "description": "str",
43
+ "files": "list[UploadFile]",
44
+ "is_private": "bool",
45
+ "convert_to_csv": "bool",
46
+ "category_ids": "list[str]",
46
47
  }
47
48
 
48
49
  attribute_map = {
49
- 'title': 'title',
50
- 'slug': 'slug',
51
- 'owner_slug': 'ownerSlug',
52
- 'license_name': 'licenseName',
53
- 'subtitle': 'subtitle',
54
- 'description': 'description',
55
- 'files': 'files',
56
- 'is_private': 'isPrivate',
57
- 'convert_to_csv': 'convertToCsv',
58
- 'category_ids': 'categoryIds'
50
+ "title": "title",
51
+ "slug": "slug",
52
+ "owner_slug": "ownerSlug",
53
+ "license_name": "licenseName",
54
+ "subtitle": "subtitle",
55
+ "description": "description",
56
+ "files": "files",
57
+ "is_private": "isPrivate",
58
+ "convert_to_csv": "convertToCsv",
59
+ "category_ids": "categoryIds",
59
60
  }
60
61
 
61
- def __init__(self, title=None, slug=None, owner_slug=None, license_name='unknown', subtitle=None, description='', files=None, is_private=True, convert_to_csv=True, category_ids=None): # noqa: E501
62
+ def __init__(
63
+ self,
64
+ title=None,
65
+ slug=None,
66
+ owner_slug=None,
67
+ license_name="unknown",
68
+ subtitle=None,
69
+ description="",
70
+ files=None,
71
+ is_private=True,
72
+ convert_to_csv=True,
73
+ category_ids=None,
74
+ ): # noqa: E501
62
75
 
63
76
  self._title = None
64
77
  self._slug = None
@@ -93,7 +106,7 @@ class DatasetNewRequest(object):
93
106
 
94
107
  @property
95
108
  def title(self):
96
- """Gets the title of this DatasetNewRequest. # noqa: E501
109
+ """Gets the title of this DatasetNewRequest. # noqa: E501.
97
110
 
98
111
  The title of the new dataset # noqa: E501
99
112
 
@@ -118,7 +131,7 @@ class DatasetNewRequest(object):
118
131
 
119
132
  @property
120
133
  def slug(self):
121
- """Gets the slug of this DatasetNewRequest. # noqa: E501
134
+ """Gets the slug of this DatasetNewRequest. # noqa: E501.
122
135
 
123
136
  The slug that the dataset should be created with # noqa: E501
124
137
 
@@ -141,7 +154,7 @@ class DatasetNewRequest(object):
141
154
 
142
155
  @property
143
156
  def owner_slug(self):
144
- """Gets the owner_slug of this DatasetNewRequest. # noqa: E501
157
+ """Gets the owner_slug of this DatasetNewRequest. # noqa: E501.
145
158
 
146
159
  The owner's username # noqa: E501
147
160
 
@@ -156,7 +169,8 @@ class DatasetNewRequest(object):
156
169
 
157
170
  The owner's username # noqa: E501
158
171
 
159
- :param owner_slug: The owner_slug of this DatasetNewRequest. # noqa: E501
172
+ :param owner_slug: The owner_slug of this DatasetNewRequest. #
173
+ noqa: E501
160
174
  :type: str
161
175
  """
162
176
 
@@ -164,11 +178,13 @@ class DatasetNewRequest(object):
164
178
 
165
179
  @property
166
180
  def license_name(self):
167
- """Gets the license_name of this DatasetNewRequest. # noqa: E501
181
+ """Gets the license_name of this DatasetNewRequest. # noqa: E501.
168
182
 
169
- The license that should be associated with the dataset # noqa: E501
183
+ The license that should be associated with the dataset # noqa:
184
+ E501
170
185
 
171
- :return: The license_name of this DatasetNewRequest. # noqa: E501
186
+ :return: The license_name of this DatasetNewRequest. # noqa:
187
+ E501
172
188
  :rtype: str
173
189
  """
174
190
  return self._license_name
@@ -177,32 +193,66 @@ class DatasetNewRequest(object):
177
193
  def license_name(self, license_name):
178
194
  """Sets the license_name of this DatasetNewRequest.
179
195
 
180
- The license that should be associated with the dataset # noqa: E501
196
+ The license that should be associated with the dataset # noqa:
197
+ E501
181
198
 
182
- :param license_name: The license_name of this DatasetNewRequest. # noqa: E501
199
+ :param license_name: The license_name of this DatasetNewRequest.
200
+ # noqa: E501
183
201
  :type: str
184
202
  """
185
- 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
203
+ allowed_values = [
204
+ "CC0-1.0",
205
+ "CC-BY-SA-4.0",
206
+ "GPL-2.0",
207
+ "ODbL-1.0",
208
+ "CC-BY-NC-SA-4.0",
209
+ "unknown",
210
+ "DbCL-1.0",
211
+ "CC-BY-SA-3.0",
212
+ "copyright-authors",
213
+ "other",
214
+ "reddit-api",
215
+ "world-bank",
216
+ "CC-BY-4.0",
217
+ "CC-BY-NC-4.0",
218
+ "PDDL",
219
+ "CC-BY-3.0",
220
+ "CC-BY-3.0-IGO",
221
+ "US-Government-Works",
222
+ "CC-BY-NC-SA-3.0-IGO",
223
+ "CDLA-Permissive-1.0",
224
+ "CDLA-Sharing-1.0",
225
+ "CC-BY-ND-4.0",
226
+ "CC-BY-NC-ND-4.0",
227
+ "ODC-BY-1.0",
228
+ "LGPL-3.0",
229
+ "AGPL-3.0",
230
+ "FDL-1.3",
231
+ "EU-ODP-Legal-Notice",
232
+ "apache-2.0",
233
+ "GPL-3.0",
234
+ ] # noqa: E501
186
235
  if license_name not in allowed_values:
187
236
  raise ValueError(
188
- "Invalid value for `license_name` ({0}), must be one of {1}" # noqa: E501
189
- .format(license_name, allowed_values)
237
+ "Invalid value for `license_name` ({0}), must be one of {1}".format( # noqa: E501
238
+ license_name, allowed_values
239
+ )
190
240
  )
191
241
  else:
192
242
  license_name = license_name.lower()
193
- if license_name[0-1] == 'cc':
194
- license_name = 'cc'
195
- elif license_name[0-3] == 'gpl':
196
- license_name = 'gpl'
197
- elif license_name[0-3] == 'odb':
198
- license_name = 'odb'
243
+ if license_name[0 - 1] == "cc":
244
+ license_name = "cc"
245
+ elif license_name[0 - 3] == "gpl":
246
+ license_name = "gpl"
247
+ elif license_name[0 - 3] == "odb":
248
+ license_name = "odb"
199
249
  else:
200
- license_name = 'other'
250
+ license_name = "other"
201
251
  self._license_name = license_name
202
252
 
203
253
  @property
204
254
  def subtitle(self):
205
- """Gets the subtitle of this DatasetNewRequest. # noqa: E501
255
+ """Gets the subtitle of this DatasetNewRequest. # noqa: E501.
206
256
 
207
257
  The subtitle to be set on the dataset # noqa: E501
208
258
 
@@ -217,7 +267,8 @@ class DatasetNewRequest(object):
217
267
 
218
268
  The subtitle to be set on the dataset # noqa: E501
219
269
 
220
- :param subtitle: The subtitle of this DatasetNewRequest. # noqa: E501
270
+ :param subtitle: The subtitle of this DatasetNewRequest. #
271
+ noqa: E501
221
272
  :type: str
222
273
  """
223
274
 
@@ -225,11 +276,11 @@ class DatasetNewRequest(object):
225
276
 
226
277
  @property
227
278
  def description(self):
228
- """Gets the description of this DatasetNewRequest. # noqa: E501
279
+ """Gets the description of this DatasetNewRequest. # noqa: E501.
229
280
 
230
281
  The description to be set on the dataset # noqa: E501
231
282
 
232
- :return: The description of this DatasetNewRequest. # noqa: E501
283
+ :return: The description of this DatasetNewRequest. # noqa: E501
233
284
  :rtype: str
234
285
  """
235
286
  return self._description
@@ -240,7 +291,8 @@ class DatasetNewRequest(object):
240
291
 
241
292
  The description to be set on the dataset # noqa: E501
242
293
 
243
- :param description: The description of this DatasetNewRequest. # noqa: E501
294
+ :param description: The description of this DatasetNewRequest. #
295
+ noqa: E501
244
296
  :type: str
245
297
  """
246
298
 
@@ -248,9 +300,10 @@ class DatasetNewRequest(object):
248
300
 
249
301
  @property
250
302
  def files(self):
251
- """Gets the files of this DatasetNewRequest. # noqa: E501
303
+ """Gets the files of this DatasetNewRequest. # noqa: E501.
252
304
 
253
- A list of files that should be associated with the dataset # noqa: E501
305
+ A list of files that should be associated with the dataset #
306
+ noqa: E501
254
307
 
255
308
  :return: The files of this DatasetNewRequest. # noqa: E501
256
309
  :rtype: list[UploadFile]
@@ -261,7 +314,8 @@ class DatasetNewRequest(object):
261
314
  def files(self, files):
262
315
  """Sets the files of this DatasetNewRequest.
263
316
 
264
- A list of files that should be associated with the dataset # noqa: E501
317
+ A list of files that should be associated with the dataset #
318
+ noqa: E501
265
319
 
266
320
  :param files: The files of this DatasetNewRequest. # noqa: E501
267
321
  :type: list[UploadFile]
@@ -273,7 +327,7 @@ class DatasetNewRequest(object):
273
327
 
274
328
  @property
275
329
  def is_private(self):
276
- """Gets the is_private of this DatasetNewRequest. # noqa: E501
330
+ """Gets the is_private of this DatasetNewRequest. # noqa: E501.
277
331
 
278
332
  Whether or not the dataset should be private # noqa: E501
279
333
 
@@ -288,7 +342,8 @@ class DatasetNewRequest(object):
288
342
 
289
343
  Whether or not the dataset should be private # noqa: E501
290
344
 
291
- :param is_private: The is_private of this DatasetNewRequest. # noqa: E501
345
+ :param is_private: The is_private of this DatasetNewRequest. #
346
+ noqa: E501
292
347
  :type: bool
293
348
  """
294
349
 
@@ -296,11 +351,13 @@ class DatasetNewRequest(object):
296
351
 
297
352
  @property
298
353
  def convert_to_csv(self):
299
- """Gets the convert_to_csv of this DatasetNewRequest. # noqa: E501
354
+ """Gets the convert_to_csv of this DatasetNewRequest. # noqa: E501.
300
355
 
301
- Whether or not a tabular dataset should be converted to csv # noqa: E501
356
+ Whether or not a tabular dataset should be converted to csv #
357
+ noqa: E501
302
358
 
303
- :return: The convert_to_csv of this DatasetNewRequest. # noqa: E501
359
+ :return: The convert_to_csv of this DatasetNewRequest. # noqa:
360
+ E501
304
361
  :rtype: bool
305
362
  """
306
363
  return self._convert_to_csv
@@ -309,9 +366,11 @@ class DatasetNewRequest(object):
309
366
  def convert_to_csv(self, convert_to_csv):
310
367
  """Sets the convert_to_csv of this DatasetNewRequest.
311
368
 
312
- Whether or not a tabular dataset should be converted to csv # noqa: E501
369
+ Whether or not a tabular dataset should be converted to csv #
370
+ noqa: E501
313
371
 
314
- :param convert_to_csv: The convert_to_csv of this DatasetNewRequest. # noqa: E501
372
+ :param convert_to_csv: The convert_to_csv of this
373
+ DatasetNewRequest. # noqa: E501
315
374
  :type: bool
316
375
  """
317
376
 
@@ -319,11 +378,12 @@ class DatasetNewRequest(object):
319
378
 
320
379
  @property
321
380
  def category_ids(self):
322
- """Gets the category_ids of this DatasetNewRequest. # noqa: E501
381
+ """Gets the category_ids of this DatasetNewRequest. # noqa: E501.
323
382
 
324
383
  A list of tag IDs to associated with the dataset # noqa: E501
325
384
 
326
- :return: The category_ids of this DatasetNewRequest. # noqa: E501
385
+ :return: The category_ids of this DatasetNewRequest. # noqa:
386
+ E501
327
387
  :rtype: list[str]
328
388
  """
329
389
  return self._category_ids
@@ -334,38 +394,37 @@ class DatasetNewRequest(object):
334
394
 
335
395
  A list of tag IDs to associated with the dataset # noqa: E501
336
396
 
337
- :param category_ids: The category_ids of this DatasetNewRequest. # noqa: E501
397
+ :param category_ids: The category_ids of this DatasetNewRequest.
398
+ # noqa: E501
338
399
  :type: list[str]
339
400
  """
340
401
 
341
402
  self._category_ids = category_ids
342
403
 
343
404
  def to_dict(self):
344
- """Returns the model properties as a dict"""
405
+ """Returns the model properties as a dict."""
345
406
  result = {}
346
407
 
347
408
  for attr, _ in six.iteritems(self.project_types):
348
409
  value = getattr(self, attr)
349
410
  if isinstance(value, list):
350
- result[attr] = list(map(
351
- lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
352
- value
353
- ))
411
+ result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
354
412
  elif hasattr(value, "to_dict"):
355
413
  result[attr] = value.to_dict()
356
414
  elif isinstance(value, dict):
357
- result[attr] = dict(map(
358
- lambda item: (item[0], item[1].to_dict())
359
- if hasattr(item[1], "to_dict") else item,
360
- value.items()
361
- ))
415
+ result[attr] = dict(
416
+ map(
417
+ lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
418
+ value.items(),
419
+ )
420
+ )
362
421
  else:
363
422
  result[attr] = value
364
423
 
365
424
  return result
366
425
 
367
426
  def to_str(self):
368
- """Returns the string representation of the model"""
427
+ """Returns the string representation of the model."""
369
428
  return pprint.pformat(self.to_dict())
370
429
 
371
430
  def __repr__(self):
@@ -373,13 +432,12 @@ class DatasetNewRequest(object):
373
432
  return self.to_str()
374
433
 
375
434
  def __eq__(self, other):
376
- """Returns true if both objects are equal"""
435
+ """Returns true if both objects are equal."""
377
436
  if not isinstance(other, DatasetNewRequest):
378
437
  return False
379
438
 
380
439
  return self.__dict__ == other.__dict__
381
440
 
382
441
  def __ne__(self, other):
383
- """Returns true if both objects are not equal"""
442
+ """Returns true if both objects are not equal."""
384
443
  return not self == other
385
-