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,351 @@
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
+
25
+ class ModelInstanceUpdateRequest(object):
26
+ """
27
+ Attributes:
28
+ project_types (dict): The key is attribute name
29
+ and the value is attribute type.
30
+ attribute_map (dict): The key is attribute name
31
+ and the value is json key in definition.
32
+ """
33
+ project_types = {
34
+ 'overview': 'str',
35
+ 'usage': 'str',
36
+ 'license_name': 'str',
37
+ 'fine_tunable': 'bool',
38
+ 'training_data': 'list[str]',
39
+ 'model_instance_type': 'str',
40
+ 'base_model_instance': 'str',
41
+ 'external_base_model_url': 'int',
42
+ 'update_mask': 'str'
43
+ }
44
+
45
+ attribute_map = {
46
+ 'overview': 'overview',
47
+ 'usage': 'usage',
48
+ 'license_name': 'licenseName',
49
+ 'fine_tunable': 'fineTunable',
50
+ 'training_data': 'trainingData',
51
+ 'model_instance_type': 'modelInstanceType',
52
+ 'base_model_instance': 'baseModelInstance',
53
+ 'external_base_model_url': 'externalBaseModelUrl',
54
+ 'update_mask': 'updateMask'
55
+ }
56
+
57
+ def __init__(self, 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, update_mask=None): # noqa: E501
58
+
59
+ self._overview = None
60
+ self._usage = None
61
+ self._license_name = None
62
+ self._fine_tunable = None
63
+ self._training_data = None
64
+ self._model_instance_type = None
65
+ self._base_model_instance = None
66
+ self._external_base_model_url = None
67
+ self._update_mask = None
68
+ self.discriminator = None
69
+
70
+ if overview is not None:
71
+ self.overview = overview
72
+ if usage is not None:
73
+ self.usage = usage
74
+ if license_name is not None:
75
+ self.license_name = license_name
76
+ if fine_tunable is not None:
77
+ self.fine_tunable = fine_tunable
78
+ if training_data is not None:
79
+ self.training_data = training_data
80
+ if model_instance_type is not None:
81
+ self.model_instance_type = model_instance_type
82
+ if base_model_instance is not None:
83
+ self.base_model_instance = base_model_instance
84
+ if external_base_model_url is not None:
85
+ self.external_base_model_url = external_base_model_url
86
+ self.update_mask = update_mask
87
+
88
+ @property
89
+ def overview(self):
90
+ """Gets the overview of this ModelInstanceUpdateRequest. # noqa: E501
91
+
92
+ The overview of the model instance (markdown) # noqa: E501
93
+
94
+ :return: The overview of this ModelInstanceUpdateRequest. # noqa: E501
95
+ :rtype: str
96
+ """
97
+ return self._overview
98
+
99
+ @overview.setter
100
+ def overview(self, overview):
101
+ """Sets the overview of this ModelInstanceUpdateRequest.
102
+
103
+ The overview of the model instance (markdown) # noqa: E501
104
+
105
+ :param overview: The overview of this ModelInstanceUpdateRequest. # noqa: E501
106
+ :type: str
107
+ """
108
+
109
+ self._overview = overview
110
+
111
+ @property
112
+ def usage(self):
113
+ """Gets the usage of this ModelInstanceUpdateRequest. # noqa: E501
114
+
115
+ The description of how to use the model instance (markdown) # noqa: E501
116
+
117
+ :return: The usage of this ModelInstanceUpdateRequest. # noqa: E501
118
+ :rtype: str
119
+ """
120
+ return self._usage
121
+
122
+ @usage.setter
123
+ def usage(self, usage):
124
+ """Sets the usage of this ModelInstanceUpdateRequest.
125
+
126
+ The description of how to use the model instance (markdown) # noqa: E501
127
+
128
+ :param usage: The usage of this ModelInstanceUpdateRequest. # noqa: E501
129
+ :type: str
130
+ """
131
+
132
+ self._usage = usage
133
+
134
+ @property
135
+ def license_name(self):
136
+ """Gets the license_name of this ModelInstanceUpdateRequest. # noqa: E501
137
+
138
+ The license that should be associated with the model instance # noqa: E501
139
+
140
+ :return: The license_name of this ModelInstanceUpdateRequest. # noqa: E501
141
+ :rtype: str
142
+ """
143
+ return self._license_name
144
+
145
+ @license_name.setter
146
+ def license_name(self, license_name):
147
+ """Sets the license_name of this ModelInstanceUpdateRequest.
148
+
149
+ The license that should be associated with the model instance # noqa: E501
150
+
151
+ :param license_name: The license_name of this ModelInstanceUpdateRequest. # noqa: E501
152
+ :type: str
153
+ """
154
+ 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
155
+ if license_name not in allowed_values:
156
+ raise ValueError(
157
+ "Invalid value for `license_name` ({0}), must be one of {1}" # noqa: E501
158
+ .format(license_name, allowed_values)
159
+ )
160
+
161
+ self._license_name = license_name
162
+
163
+ @property
164
+ def fine_tunable(self):
165
+ """Gets the fine_tunable of this ModelInstanceUpdateRequest. # noqa: E501
166
+
167
+ Whether the model instance is fine tunable # noqa: E501
168
+
169
+ :return: The fine_tunable of this ModelInstanceUpdateRequest. # noqa: E501
170
+ :rtype: bool
171
+ """
172
+ return self._fine_tunable
173
+
174
+ @fine_tunable.setter
175
+ def fine_tunable(self, fine_tunable):
176
+ """Sets the fine_tunable of this ModelInstanceUpdateRequest.
177
+
178
+ Whether the model instance is fine tunable # noqa: E501
179
+
180
+ :param fine_tunable: The fine_tunable of this ModelInstanceUpdateRequest. # noqa: E501
181
+ :type: bool
182
+ """
183
+
184
+ self._fine_tunable = fine_tunable
185
+
186
+ @property
187
+ def training_data(self):
188
+ """Gets the training_data of this ModelInstanceUpdateRequest. # noqa: E501
189
+
190
+ A list of training data (urls or names) # noqa: E501
191
+
192
+ :return: The training_data of this ModelInstanceUpdateRequest. # noqa: E501
193
+ :rtype: list[str]
194
+ """
195
+ return self._training_data
196
+
197
+ @training_data.setter
198
+ def training_data(self, training_data):
199
+ """Sets the training_data of this ModelInstanceUpdateRequest.
200
+
201
+ A list of training data (urls or names) # noqa: E501
202
+
203
+ :param training_data: The training_data of this ModelInstanceUpdateRequest. # noqa: E501
204
+ :type: list[str]
205
+ """
206
+
207
+ self._training_data = training_data
208
+
209
+ @property
210
+ def model_instance_type(self):
211
+ """Gets the model_instance_type of this ModelInstanceUpdateRequest. # noqa: E501
212
+
213
+ Whether the model instance is a base model, external variant, internal variant, or unspecified # noqa: E501
214
+
215
+ :return: The model_instance_type of this ModelInstanceUpdateRequest. # noqa: E501
216
+ :rtype: str
217
+ """
218
+ return self._model_instance_type
219
+
220
+ @model_instance_type.setter
221
+ def model_instance_type(self, model_instance_type):
222
+ """Sets the model_instance_type of this ModelInstanceUpdateRequest.
223
+
224
+ Whether the model instance is a base model, external variant, internal variant, or unspecified # noqa: E501
225
+
226
+ :param model_instance_type: The model_instance_type of this ModelInstanceUpdateRequest. # noqa: E501
227
+ :type: str
228
+ """
229
+ allowed_values = ["Unspecified", "BaseModel", "KaggleVariant", "ExternalVariant"] # noqa: E501
230
+ if model_instance_type not in allowed_values:
231
+ raise ValueError(
232
+ "Invalid value for `model_instance_type` ({0}), must be one of {1}" # noqa: E501
233
+ .format(model_instance_type, allowed_values)
234
+ )
235
+
236
+ self._model_instance_type = model_instance_type
237
+
238
+ @property
239
+ def base_model_instance(self):
240
+ """Gets the base_model_instance of this ModelInstanceUpdateRequest. # noqa: E501
241
+
242
+ If this is an internal variant, the `{owner-slug}/{model-slug}/{framework}/{instance-slug}` of the base model instance # noqa: E501
243
+
244
+ :return: The base_model_instance of this ModelInstanceUpdateRequest. # noqa: E501
245
+ :rtype: str
246
+ """
247
+ return self._base_model_instance
248
+
249
+ @base_model_instance.setter
250
+ def base_model_instance(self, base_model_instance):
251
+ """Sets the base_model_instance of this ModelInstanceUpdateRequest.
252
+
253
+ If this is an internal variant, the `{owner-slug}/{model-slug}/{framework}/{instance-slug}` of the base model instance # noqa: E501
254
+
255
+ :param base_model_instance: The base_model_instance of this ModelInstanceUpdateRequest. # noqa: E501
256
+ :type: str
257
+ """
258
+
259
+ self._base_model_instance = base_model_instance
260
+
261
+ @property
262
+ def external_base_model_url(self):
263
+ """Gets the external_base_model_url of this ModelInstanceUpdateRequest. # noqa: E501
264
+
265
+ If this is an external variant, a URL to the base model # noqa: E501
266
+
267
+ :return: The external_base_model_url of this ModelInstanceUpdateRequest. # noqa: E501
268
+ :rtype: int
269
+ """
270
+ return self._external_base_model_url
271
+
272
+ @external_base_model_url.setter
273
+ def external_base_model_url(self, external_base_model_url):
274
+ """Sets the external_base_model_url of this ModelInstanceUpdateRequest.
275
+
276
+ If this is an external variant, a URL to the base model # noqa: E501
277
+
278
+ :param external_base_model_url: The external_base_model_url of this ModelInstanceUpdateRequest. # noqa: E501
279
+ :type: int
280
+ """
281
+
282
+ self._external_base_model_url = external_base_model_url
283
+
284
+ @property
285
+ def update_mask(self):
286
+ """Gets the update_mask of this ModelInstanceUpdateRequest. # noqa: E501
287
+
288
+ Describes which fields to update # noqa: E501
289
+
290
+ :return: The update_mask of this ModelInstanceUpdateRequest. # noqa: E501
291
+ :rtype: str
292
+ """
293
+ return self._update_mask
294
+
295
+ @update_mask.setter
296
+ def update_mask(self, update_mask):
297
+ """Sets the update_mask of this ModelInstanceUpdateRequest.
298
+
299
+ Describes which fields to update # noqa: E501
300
+
301
+ :param update_mask: The update_mask of this ModelInstanceUpdateRequest. # noqa: E501
302
+ :type: str
303
+ """
304
+ if update_mask is None:
305
+ raise ValueError("Invalid value for `update_mask`, must not be `None`") # noqa: E501
306
+
307
+ self._update_mask = update_mask
308
+
309
+ def to_dict(self):
310
+ """Returns the model properties as a dict"""
311
+ result = {}
312
+
313
+ for attr, _ in six.iteritems(self.project_types):
314
+ value = getattr(self, attr)
315
+ if isinstance(value, list):
316
+ result[attr] = list(map(
317
+ lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
318
+ value
319
+ ))
320
+ elif hasattr(value, "to_dict"):
321
+ result[attr] = value.to_dict()
322
+ elif isinstance(value, dict):
323
+ result[attr] = dict(map(
324
+ lambda item: (item[0], item[1].to_dict())
325
+ if hasattr(item[1], "to_dict") else item,
326
+ value.items()
327
+ ))
328
+ else:
329
+ result[attr] = value
330
+
331
+ return result
332
+
333
+ def to_str(self):
334
+ """Returns the string representation of the model"""
335
+ return pprint.pformat(self.to_dict())
336
+
337
+ def __repr__(self):
338
+ """For `print` and `pprint`"""
339
+ return self.to_str()
340
+
341
+ def __eq__(self, other):
342
+ """Returns true if both objects are equal"""
343
+ if not isinstance(other, ModelInstanceUpdateRequest):
344
+ return False
345
+
346
+ return self.__dict__ == other.__dict__
347
+
348
+ def __ne__(self, other):
349
+ """Returns true if both objects are not equal"""
350
+ return not self == other
351
+