kaggle 1.7.3b1__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 (89) hide show
  1. kaggle/LICENSE +201 -0
  2. kaggle/__init__.py +6 -0
  3. kaggle/api/__init__.py +0 -0
  4. kaggle/api/kaggle_api.py +614 -0
  5. kaggle/api/kaggle_api_extended.py +4657 -0
  6. kaggle/cli.py +1606 -0
  7. kaggle/configuration.py +206 -0
  8. kaggle/models/__init__.py +0 -0
  9. kaggle/models/api_blob_type.py +4 -0
  10. kaggle/models/dataset_column.py +228 -0
  11. kaggle/models/dataset_new_request.py +385 -0
  12. kaggle/models/dataset_new_version_request.py +287 -0
  13. kaggle/models/dataset_update_settings_request.py +310 -0
  14. kaggle/models/kaggle_models_extended.py +276 -0
  15. kaggle/models/kernel_push_request.py +556 -0
  16. kaggle/models/model_instance_new_version_request.py +145 -0
  17. kaggle/models/model_instance_update_request.py +351 -0
  18. kaggle/models/model_new_instance_request.py +417 -0
  19. kaggle/models/model_new_request.py +314 -0
  20. kaggle/models/model_update_request.py +282 -0
  21. kaggle/models/start_blob_upload_request.py +232 -0
  22. kaggle/models/start_blob_upload_response.py +137 -0
  23. kaggle/models/upload_file.py +169 -0
  24. kaggle/test/__init__.py +0 -0
  25. kaggle/test/test_authenticate.py +43 -0
  26. kaggle-1.7.3b1.dist-info/METADATA +348 -0
  27. kaggle-1.7.3b1.dist-info/RECORD +89 -0
  28. kaggle-1.7.3b1.dist-info/WHEEL +4 -0
  29. kaggle-1.7.3b1.dist-info/entry_points.txt +2 -0
  30. kaggle-1.7.3b1.dist-info/licenses/LICENSE.txt +201 -0
  31. kagglesdk/LICENSE +201 -0
  32. kagglesdk/__init__.py +2 -0
  33. kagglesdk/admin/__init__.py +0 -0
  34. kagglesdk/admin/services/__init__.py +0 -0
  35. kagglesdk/admin/services/inbox_file_service.py +22 -0
  36. kagglesdk/admin/types/__init__.py +0 -0
  37. kagglesdk/admin/types/inbox_file_service.py +74 -0
  38. kagglesdk/blobs/__init__.py +0 -0
  39. kagglesdk/blobs/services/__init__.py +0 -0
  40. kagglesdk/blobs/services/blob_api_service.py +25 -0
  41. kagglesdk/blobs/types/__init__.py +0 -0
  42. kagglesdk/blobs/types/blob_api_service.py +177 -0
  43. kagglesdk/common/__init__.py +0 -0
  44. kagglesdk/common/types/__init__.py +0 -0
  45. kagglesdk/common/types/file_download.py +102 -0
  46. kagglesdk/common/types/http_redirect.py +105 -0
  47. kagglesdk/competitions/__init__.py +0 -0
  48. kagglesdk/competitions/services/__init__.py +0 -0
  49. kagglesdk/competitions/services/competition_api_service.py +129 -0
  50. kagglesdk/competitions/types/__init__.py +0 -0
  51. kagglesdk/competitions/types/competition_api_service.py +1874 -0
  52. kagglesdk/competitions/types/competition_enums.py +53 -0
  53. kagglesdk/competitions/types/submission_status.py +9 -0
  54. kagglesdk/datasets/__init__.py +0 -0
  55. kagglesdk/datasets/services/__init__.py +0 -0
  56. kagglesdk/datasets/services/dataset_api_service.py +170 -0
  57. kagglesdk/datasets/types/__init__.py +0 -0
  58. kagglesdk/datasets/types/dataset_api_service.py +2777 -0
  59. kagglesdk/datasets/types/dataset_enums.py +82 -0
  60. kagglesdk/datasets/types/dataset_types.py +646 -0
  61. kagglesdk/education/__init__.py +0 -0
  62. kagglesdk/education/services/__init__.py +0 -0
  63. kagglesdk/education/services/education_api_service.py +19 -0
  64. kagglesdk/education/types/__init__.py +0 -0
  65. kagglesdk/education/types/education_api_service.py +248 -0
  66. kagglesdk/education/types/education_service.py +139 -0
  67. kagglesdk/kaggle_client.py +66 -0
  68. kagglesdk/kaggle_env.py +42 -0
  69. kagglesdk/kaggle_http_client.py +316 -0
  70. kagglesdk/kaggle_object.py +293 -0
  71. kagglesdk/kernels/__init__.py +0 -0
  72. kagglesdk/kernels/services/__init__.py +0 -0
  73. kagglesdk/kernels/services/kernels_api_service.py +109 -0
  74. kagglesdk/kernels/types/__init__.py +0 -0
  75. kagglesdk/kernels/types/kernels_api_service.py +1951 -0
  76. kagglesdk/kernels/types/kernels_enums.py +33 -0
  77. kagglesdk/models/__init__.py +0 -0
  78. kagglesdk/models/services/__init__.py +0 -0
  79. kagglesdk/models/services/model_api_service.py +255 -0
  80. kagglesdk/models/services/model_service.py +19 -0
  81. kagglesdk/models/types/__init__.py +0 -0
  82. kagglesdk/models/types/model_api_service.py +3719 -0
  83. kagglesdk/models/types/model_enums.py +60 -0
  84. kagglesdk/models/types/model_service.py +275 -0
  85. kagglesdk/models/types/model_types.py +286 -0
  86. kagglesdk/test/test_client.py +45 -0
  87. kagglesdk/users/__init__.py +0 -0
  88. kagglesdk/users/types/__init__.py +0 -0
  89. kagglesdk/users/types/users_enums.py +22 -0
@@ -0,0 +1,417 @@
1
+ #!/usr/bin/python
2
+ #
3
+ # Copyright 2024 Kaggle Inc
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # coding: utf-8
18
+
19
+ import pprint
20
+ import re # noqa: F401
21
+
22
+ import six
23
+
24
+ from kaggle.models.upload_file import UploadFile # noqa: F401,E501
25
+
26
+
27
+ class ModelNewInstanceRequest(object):
28
+ """
29
+ Attributes:
30
+ project_types (dict): The key is attribute name
31
+ and the value is attribute type.
32
+ attribute_map (dict): The key is attribute name
33
+ and the value is json key in definition.
34
+ """
35
+ project_types = {
36
+ 'instance_slug': 'str',
37
+ 'framework': 'str',
38
+ 'overview': 'str',
39
+ 'usage': 'str',
40
+ 'license_name': 'str',
41
+ 'fine_tunable': 'bool',
42
+ 'training_data': 'list[str]',
43
+ 'model_instance_type': 'str',
44
+ 'base_model_instance': 'str',
45
+ 'external_base_model_url': 'int',
46
+ 'files': 'list[UploadFile]'
47
+ }
48
+
49
+ attribute_map = {
50
+ 'instance_slug': 'instanceSlug',
51
+ 'framework': 'framework',
52
+ 'overview': 'overview',
53
+ 'usage': 'usage',
54
+ 'license_name': 'licenseName',
55
+ 'fine_tunable': 'fineTunable',
56
+ 'training_data': 'trainingData',
57
+ 'model_instance_type': 'modelInstanceType',
58
+ 'base_model_instance': 'baseModelInstance',
59
+ 'external_base_model_url': 'externalBaseModelUrl',
60
+ 'files': 'files'
61
+ }
62
+
63
+ def __init__(self, instance_slug=None, framework=None, overview=None, usage=None, license_name='Apache 2.0', fine_tunable=True, training_data=None, model_instance_type=None, base_model_instance=None, external_base_model_url=None, files=None): # noqa: E501
64
+
65
+ self._instance_slug = None
66
+ self._framework = None
67
+ self._overview = None
68
+ self._usage = None
69
+ self._license_name = None
70
+ self._fine_tunable = None
71
+ self._training_data = None
72
+ self._model_instance_type = None
73
+ self._base_model_instance = None
74
+ self._external_base_model_url = None
75
+ self._files = None
76
+ self.discriminator = None
77
+
78
+ self.instance_slug = instance_slug
79
+ self.framework = framework
80
+ if overview is not None:
81
+ self.overview = overview
82
+ if usage is not None:
83
+ self.usage = usage
84
+ self.license_name = license_name
85
+ if fine_tunable is not None:
86
+ self.fine_tunable = fine_tunable
87
+ if training_data is not None:
88
+ self.training_data = training_data
89
+ if model_instance_type is not None:
90
+ self.model_instance_type = model_instance_type
91
+ if base_model_instance is not None:
92
+ self.base_model_instance = base_model_instance
93
+ if external_base_model_url is not None:
94
+ self.external_base_model_url = external_base_model_url
95
+ if files is not None:
96
+ self.files = files
97
+
98
+ @property
99
+ def instance_slug(self):
100
+ """Gets the instance_slug of this ModelNewInstanceRequest. # noqa: E501
101
+
102
+ The slug that the model instance should be created with # noqa: E501
103
+
104
+ :return: The instance_slug of this ModelNewInstanceRequest. # noqa: E501
105
+ :rtype: str
106
+ """
107
+ return self._instance_slug
108
+
109
+ @instance_slug.setter
110
+ def instance_slug(self, instance_slug):
111
+ """Sets the instance_slug of this ModelNewInstanceRequest.
112
+
113
+ The slug that the model instance should be created with # noqa: E501
114
+
115
+ :param instance_slug: The instance_slug of this ModelNewInstanceRequest. # noqa: E501
116
+ :type: str
117
+ """
118
+ if instance_slug is None:
119
+ raise ValueError("Invalid value for `instance_slug`, must not be `None`") # noqa: E501
120
+
121
+ self._instance_slug = instance_slug
122
+
123
+ @property
124
+ def framework(self):
125
+ """Gets the framework of this ModelNewInstanceRequest. # noqa: E501
126
+
127
+ The framework of the model instance # noqa: E501
128
+
129
+ :return: The framework of this ModelNewInstanceRequest. # noqa: E501
130
+ :rtype: str
131
+ """
132
+ return self._framework
133
+
134
+ @framework.setter
135
+ def framework(self, framework):
136
+ """Sets the framework of this ModelNewInstanceRequest.
137
+
138
+ The framework of the model instance # noqa: E501
139
+
140
+ :param framework: The framework of this ModelNewInstanceRequest. # noqa: E501
141
+ :type: str
142
+ """
143
+ if framework is None:
144
+ raise ValueError("Invalid value for `framework`, must not be `None`") # noqa: E501
145
+ allowed_values = ["tensorFlow1", "tensorFlow2", "tfLite", "tfJs", "pyTorch", "jax", "flax", "pax", "maxText", "gemmaCpp", "tensorRtLlm", "ggml", "gguf", "coral", "scikitLearn", "mxnet", "onnx", "keras", "transformers", "triton", "api", "triton", "tensorRtLlm","other"] # noqa: E501
146
+ if framework not in allowed_values:
147
+ raise ValueError(
148
+ "Invalid value for `framework` ({0}), must be one of {1}" # noqa: E501
149
+ .format(framework, allowed_values)
150
+ )
151
+
152
+ self._framework = framework
153
+
154
+ @property
155
+ def overview(self):
156
+ """Gets the overview of this ModelNewInstanceRequest. # noqa: E501
157
+
158
+ The overview of the model instance (markdown) # noqa: E501
159
+
160
+ :return: The overview of this ModelNewInstanceRequest. # noqa: E501
161
+ :rtype: str
162
+ """
163
+ return self._overview
164
+
165
+ @overview.setter
166
+ def overview(self, overview):
167
+ """Sets the overview of this ModelNewInstanceRequest.
168
+
169
+ The overview of the model instance (markdown) # noqa: E501
170
+
171
+ :param overview: The overview of this ModelNewInstanceRequest. # noqa: E501
172
+ :type: str
173
+ """
174
+
175
+ self._overview = overview
176
+
177
+ @property
178
+ def usage(self):
179
+ """Gets the usage of this ModelNewInstanceRequest. # noqa: E501
180
+
181
+ The description of how to use the model instance (markdown) # noqa: E501
182
+
183
+ :return: The usage of this ModelNewInstanceRequest. # noqa: E501
184
+ :rtype: str
185
+ """
186
+ return self._usage
187
+
188
+ @usage.setter
189
+ def usage(self, usage):
190
+ """Sets the usage of this ModelNewInstanceRequest.
191
+
192
+ The description of how to use the model instance (markdown) # noqa: E501
193
+
194
+ :param usage: The usage of this ModelNewInstanceRequest. # noqa: E501
195
+ :type: str
196
+ """
197
+
198
+ self._usage = usage
199
+
200
+ @property
201
+ def license_name(self):
202
+ """Gets the license_name of this ModelNewInstanceRequest. # noqa: E501
203
+
204
+ The license that should be associated with the model instance # noqa: E501
205
+
206
+ :return: The license_name of this ModelNewInstanceRequest. # noqa: E501
207
+ :rtype: str
208
+ """
209
+ return self._license_name
210
+
211
+ @license_name.setter
212
+ def license_name(self, license_name):
213
+ """Sets the license_name of this ModelNewInstanceRequest.
214
+
215
+ The license that should be associated with the model instance # noqa: E501
216
+
217
+ :param license_name: The license_name of this ModelNewInstanceRequest. # noqa: E501
218
+ :type: str
219
+ """
220
+ if license_name is None:
221
+ raise ValueError("Invalid value for `license_name`, must not be `None`") # noqa: E501
222
+ allowed_values = ["CC0 1.0", "CC BY-NC-SA 4.0", "Unknown", "CC BY-SA 4.0", "GPL 2", "CC BY-SA 3.0", "Other", "Other (specified in description)", "CC BY 4.0", "Attribution 4.0 International (CC BY 4.0)", "CC BY-NC 4.0", "Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)", "PDDL", "ODC Public Domain Dedication and Licence (PDDL)", "CC BY 3.0", "Attribution 3.0 Unported (CC BY 3.0)", "CC BY 3.0 IGO", "Attribution 3.0 IGO (CC BY 3.0 IGO)", "CC BY-NC-SA 3.0 IGO", "Attribution-NonCommercial-ShareAlike 3.0 IGO (CC BY-NC-SA 3.0 IGO)", "CDLA Permissive 1.0", "Community Data License Agreement - Permissive - Version 1.0", "CDLA Sharing 1.0", "Community Data License Agreement - Sharing - Version 1.0", "CC BY-ND 4.0", "Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)", "CC BY-NC-ND 4.0", "Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)", "ODC-BY 1.0", "ODC Attribution License (ODC-By)", "LGPL 3.0", "GNU Lesser General Public License 3.0", "AGPL 3.0", "GNU Affero General Public License 3.0", "FDL 1.3", "GNU Free Documentation License 1.3", "apache-2.0", "Apache 2.0", "mit", "MIT", "bsd-3-clause", "BSD-3-Clause", "Llama 2", "Llama 2 Community License", "Gemma", "gpl-3", "GPL 3", "RAIL-M", "AI Pubs Open RAIL-M License", "AIPubs Research-Use RAIL-M", "AI Pubs Research-Use RAIL-M License", "BigScience OpenRAIL-M", "BigScience Open RAIL-M License", "RAIL", "RAIL (specified in description)", "Llama 3", "Llama 3 Community License"] # noqa: E501
223
+ if license_name not in allowed_values:
224
+ raise ValueError(
225
+ "Invalid value for `license_name` ({0}), must be one of {1}" # noqa: E501
226
+ .format(license_name, allowed_values)
227
+ )
228
+
229
+ self._license_name = license_name
230
+
231
+ @property
232
+ def fine_tunable(self):
233
+ """Gets the fine_tunable of this ModelNewInstanceRequest. # noqa: E501
234
+
235
+ Whether the model instance is fine tunable # noqa: E501
236
+
237
+ :return: The fine_tunable of this ModelNewInstanceRequest. # noqa: E501
238
+ :rtype: bool
239
+ """
240
+ return self._fine_tunable
241
+
242
+ @fine_tunable.setter
243
+ def fine_tunable(self, fine_tunable):
244
+ """Sets the fine_tunable of this ModelNewInstanceRequest.
245
+
246
+ Whether the model instance is fine tunable # noqa: E501
247
+
248
+ :param fine_tunable: The fine_tunable of this ModelNewInstanceRequest. # noqa: E501
249
+ :type: bool
250
+ """
251
+
252
+ self._fine_tunable = fine_tunable
253
+
254
+ @property
255
+ def training_data(self):
256
+ """Gets the training_data of this ModelNewInstanceRequest. # noqa: E501
257
+
258
+ A list of training data (urls or names) # noqa: E501
259
+
260
+ :return: The training_data of this ModelNewInstanceRequest. # noqa: E501
261
+ :rtype: list[str]
262
+ """
263
+ return self._training_data
264
+
265
+ @training_data.setter
266
+ def training_data(self, training_data):
267
+ """Sets the training_data of this ModelNewInstanceRequest.
268
+
269
+ A list of training data (urls or names) # noqa: E501
270
+
271
+ :param training_data: The training_data of this ModelNewInstanceRequest. # noqa: E501
272
+ :type: list[str]
273
+ """
274
+
275
+ self._training_data = training_data
276
+
277
+ @property
278
+ def model_instance_type(self):
279
+ """Gets the model_instance_type of this ModelNewInstanceRequest. # noqa: E501
280
+
281
+ Whether the model instance is a base model, external variant, internal variant, or unspecified # noqa: E501
282
+
283
+ :return: The model_instance_type of this ModelNewInstanceRequest. # noqa: E501
284
+ :rtype: str
285
+ """
286
+ return self._model_instance_type
287
+
288
+ @model_instance_type.setter
289
+ def model_instance_type(self, model_instance_type):
290
+ """Sets the model_instance_type of this ModelNewInstanceRequest.
291
+
292
+ Whether the model instance is a base model, external variant, internal variant, or unspecified # noqa: E501
293
+
294
+ :param model_instance_type: The model_instance_type of this ModelNewInstanceRequest. # noqa: E501
295
+ :type: str
296
+ """
297
+ allowed_values = ["Unspecified", "BaseModel", "KaggleVariant", "ExternalVariant"] # noqa: E501
298
+ if model_instance_type not in allowed_values:
299
+ raise ValueError(
300
+ "Invalid value for `model_instance_type` ({0}), must be one of {1}" # noqa: E501
301
+ .format(model_instance_type, allowed_values)
302
+ )
303
+
304
+ self._model_instance_type = model_instance_type
305
+
306
+ @property
307
+ def base_model_instance(self):
308
+ """Gets the base_model_instance of this ModelNewInstanceRequest. # noqa: E501
309
+
310
+ If this is an internal variant, the `{owner-slug}/{model-slug}/{framework}/{instance-slug}` of the base model instance # noqa: E501
311
+
312
+ :return: The base_model_instance of this ModelNewInstanceRequest. # noqa: E501
313
+ :rtype: str
314
+ """
315
+ return self._base_model_instance
316
+
317
+ @base_model_instance.setter
318
+ def base_model_instance(self, base_model_instance):
319
+ """Sets the base_model_instance of this ModelNewInstanceRequest.
320
+
321
+ If this is an internal variant, the `{owner-slug}/{model-slug}/{framework}/{instance-slug}` of the base model instance # noqa: E501
322
+
323
+ :param base_model_instance: The base_model_instance of this ModelNewInstanceRequest. # noqa: E501
324
+ :type: str
325
+ """
326
+
327
+ self._base_model_instance = base_model_instance
328
+
329
+ @property
330
+ def external_base_model_url(self):
331
+ """Gets the external_base_model_url of this ModelNewInstanceRequest. # noqa: E501
332
+
333
+ If this is an external variant, a URL to the base model # noqa: E501
334
+
335
+ :return: The external_base_model_url of this ModelNewInstanceRequest. # noqa: E501
336
+ :rtype: int
337
+ """
338
+ return self._external_base_model_url
339
+
340
+ @external_base_model_url.setter
341
+ def external_base_model_url(self, external_base_model_url):
342
+ """Sets the external_base_model_url of this ModelNewInstanceRequest.
343
+
344
+ If this is an external variant, a URL to the base model # noqa: E501
345
+
346
+ :param external_base_model_url: The external_base_model_url of this ModelNewInstanceRequest. # noqa: E501
347
+ :type: int
348
+ """
349
+
350
+ self._external_base_model_url = external_base_model_url
351
+
352
+ @property
353
+ def files(self):
354
+ """Gets the files of this ModelNewInstanceRequest. # noqa: E501
355
+
356
+ A list of files that should be associated with the model instance version # noqa: E501
357
+
358
+ :return: The files of this ModelNewInstanceRequest. # noqa: E501
359
+ :rtype: list[UploadFile]
360
+ """
361
+ return self._files
362
+
363
+ @files.setter
364
+ def files(self, files):
365
+ """Sets the files of this ModelNewInstanceRequest.
366
+
367
+ A list of files that should be associated with the model instance version # noqa: E501
368
+
369
+ :param files: The files of this ModelNewInstanceRequest. # noqa: E501
370
+ :type: list[UploadFile]
371
+ """
372
+
373
+ self._files = files
374
+
375
+ def to_dict(self):
376
+ """Returns the model properties as a dict"""
377
+ result = {}
378
+
379
+ for attr, _ in six.iteritems(self.project_types):
380
+ value = getattr(self, attr)
381
+ if isinstance(value, list):
382
+ result[attr] = list(map(
383
+ lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
384
+ value
385
+ ))
386
+ elif hasattr(value, "to_dict"):
387
+ result[attr] = value.to_dict()
388
+ elif isinstance(value, dict):
389
+ result[attr] = dict(map(
390
+ lambda item: (item[0], item[1].to_dict())
391
+ if hasattr(item[1], "to_dict") else item,
392
+ value.items()
393
+ ))
394
+ else:
395
+ result[attr] = value
396
+
397
+ return result
398
+
399
+ def to_str(self):
400
+ """Returns the string representation of the model"""
401
+ return pprint.pformat(self.to_dict())
402
+
403
+ def __repr__(self):
404
+ """For `print` and `pprint`"""
405
+ return self.to_str()
406
+
407
+ def __eq__(self, other):
408
+ """Returns true if both objects are equal"""
409
+ if not isinstance(other, ModelNewInstanceRequest):
410
+ return False
411
+
412
+ return self.__dict__ == other.__dict__
413
+
414
+ def __ne__(self, other):
415
+ """Returns true if both objects are not equal"""
416
+ return not self == other
417
+