kaggle 1.8.3__py3-none-any.whl → 1.8.4__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.
@@ -1,443 +0,0 @@
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 DatasetNewRequest(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
-
36
- project_types = {
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]",
47
- }
48
-
49
- attribute_map = {
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",
60
- }
61
-
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
75
-
76
- self._title = None
77
- self._slug = None
78
- self._owner_slug = None
79
- self._license_name = None
80
- self._subtitle = None
81
- self._description = None
82
- self._files = None
83
- self._is_private = None
84
- self._convert_to_csv = None
85
- self._category_ids = None
86
- self.discriminator = None
87
-
88
- self.title = title
89
- if slug is not None:
90
- self.slug = slug
91
- if owner_slug is not None:
92
- self.owner_slug = owner_slug
93
- if license_name is not None:
94
- self.license_name = license_name
95
- if subtitle is not None:
96
- self.subtitle = subtitle
97
- if description is not None:
98
- self.description = description
99
- self.files = files
100
- if is_private is not None:
101
- self.is_private = is_private
102
- if convert_to_csv is not None:
103
- self.convert_to_csv = convert_to_csv
104
- if category_ids is not None:
105
- self.category_ids = category_ids
106
-
107
- @property
108
- def title(self):
109
- """Gets the title of this DatasetNewRequest. # noqa: E501.
110
-
111
- The title of the new dataset # noqa: E501
112
-
113
- :return: The title of this DatasetNewRequest. # noqa: E501
114
- :rtype: str
115
- """
116
- return self._title
117
-
118
- @title.setter
119
- def title(self, title):
120
- """Sets the title of this DatasetNewRequest.
121
-
122
- The title of the new dataset # noqa: E501
123
-
124
- :param title: The title of this DatasetNewRequest. # noqa: E501
125
- :type: str
126
- """
127
- if title is None:
128
- raise ValueError("Invalid value for `title`, must not be `None`") # noqa: E501
129
-
130
- self._title = title
131
-
132
- @property
133
- def slug(self):
134
- """Gets the slug of this DatasetNewRequest. # noqa: E501.
135
-
136
- The slug that the dataset should be created with # noqa: E501
137
-
138
- :return: The slug of this DatasetNewRequest. # noqa: E501
139
- :rtype: str
140
- """
141
- return self._slug
142
-
143
- @slug.setter
144
- def slug(self, slug):
145
- """Sets the slug of this DatasetNewRequest.
146
-
147
- The slug that the dataset should be created with # noqa: E501
148
-
149
- :param slug: The slug of this DatasetNewRequest. # noqa: E501
150
- :type: str
151
- """
152
-
153
- self._slug = slug
154
-
155
- @property
156
- def owner_slug(self):
157
- """Gets the owner_slug of this DatasetNewRequest. # noqa: E501.
158
-
159
- The owner's username # noqa: E501
160
-
161
- :return: The owner_slug of this DatasetNewRequest. # noqa: E501
162
- :rtype: str
163
- """
164
- return self._owner_slug
165
-
166
- @owner_slug.setter
167
- def owner_slug(self, owner_slug):
168
- """Sets the owner_slug of this DatasetNewRequest.
169
-
170
- The owner's username # noqa: E501
171
-
172
- :param owner_slug: The owner_slug of this DatasetNewRequest. #
173
- noqa: E501
174
- :type: str
175
- """
176
-
177
- self._owner_slug = owner_slug
178
-
179
- @property
180
- def license_name(self):
181
- """Gets the license_name of this DatasetNewRequest. # noqa: E501.
182
-
183
- The license that should be associated with the dataset # noqa:
184
- E501
185
-
186
- :return: The license_name of this DatasetNewRequest. # noqa:
187
- E501
188
- :rtype: str
189
- """
190
- return self._license_name
191
-
192
- @license_name.setter
193
- def license_name(self, license_name):
194
- """Sets the license_name of this DatasetNewRequest.
195
-
196
- The license that should be associated with the dataset # noqa:
197
- E501
198
-
199
- :param license_name: The license_name of this DatasetNewRequest.
200
- # noqa: E501
201
- :type: str
202
- """
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
235
- if license_name not in allowed_values:
236
- raise ValueError(
237
- "Invalid value for `license_name` ({0}), must be one of {1}".format( # noqa: E501
238
- license_name, allowed_values
239
- )
240
- )
241
- else:
242
- license_name = license_name.lower()
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"
249
- else:
250
- license_name = "other"
251
- self._license_name = license_name
252
-
253
- @property
254
- def subtitle(self):
255
- """Gets the subtitle of this DatasetNewRequest. # noqa: E501.
256
-
257
- The subtitle to be set on the dataset # noqa: E501
258
-
259
- :return: The subtitle of this DatasetNewRequest. # noqa: E501
260
- :rtype: str
261
- """
262
- return self._subtitle
263
-
264
- @subtitle.setter
265
- def subtitle(self, subtitle):
266
- """Sets the subtitle of this DatasetNewRequest.
267
-
268
- The subtitle to be set on the dataset # noqa: E501
269
-
270
- :param subtitle: The subtitle of this DatasetNewRequest. #
271
- noqa: E501
272
- :type: str
273
- """
274
-
275
- self._subtitle = subtitle
276
-
277
- @property
278
- def description(self):
279
- """Gets the description of this DatasetNewRequest. # noqa: E501.
280
-
281
- The description to be set on the dataset # noqa: E501
282
-
283
- :return: The description of this DatasetNewRequest. # noqa: E501
284
- :rtype: str
285
- """
286
- return self._description
287
-
288
- @description.setter
289
- def description(self, description):
290
- """Sets the description of this DatasetNewRequest.
291
-
292
- The description to be set on the dataset # noqa: E501
293
-
294
- :param description: The description of this DatasetNewRequest. #
295
- noqa: E501
296
- :type: str
297
- """
298
-
299
- self._description = description
300
-
301
- @property
302
- def files(self):
303
- """Gets the files of this DatasetNewRequest. # noqa: E501.
304
-
305
- A list of files that should be associated with the dataset #
306
- noqa: E501
307
-
308
- :return: The files of this DatasetNewRequest. # noqa: E501
309
- :rtype: list[UploadFile]
310
- """
311
- return self._files
312
-
313
- @files.setter
314
- def files(self, files):
315
- """Sets the files of this DatasetNewRequest.
316
-
317
- A list of files that should be associated with the dataset #
318
- noqa: E501
319
-
320
- :param files: The files of this DatasetNewRequest. # noqa: E501
321
- :type: list[UploadFile]
322
- """
323
- if files is None:
324
- raise ValueError("Invalid value for `files`, must not be `None`") # noqa: E501
325
-
326
- self._files = files
327
-
328
- @property
329
- def is_private(self):
330
- """Gets the is_private of this DatasetNewRequest. # noqa: E501.
331
-
332
- Whether or not the dataset should be private # noqa: E501
333
-
334
- :return: The is_private of this DatasetNewRequest. # noqa: E501
335
- :rtype: bool
336
- """
337
- return self._is_private
338
-
339
- @is_private.setter
340
- def is_private(self, is_private):
341
- """Sets the is_private of this DatasetNewRequest.
342
-
343
- Whether or not the dataset should be private # noqa: E501
344
-
345
- :param is_private: The is_private of this DatasetNewRequest. #
346
- noqa: E501
347
- :type: bool
348
- """
349
-
350
- self._is_private = is_private
351
-
352
- @property
353
- def convert_to_csv(self):
354
- """Gets the convert_to_csv of this DatasetNewRequest. # noqa: E501.
355
-
356
- Whether or not a tabular dataset should be converted to csv #
357
- noqa: E501
358
-
359
- :return: The convert_to_csv of this DatasetNewRequest. # noqa:
360
- E501
361
- :rtype: bool
362
- """
363
- return self._convert_to_csv
364
-
365
- @convert_to_csv.setter
366
- def convert_to_csv(self, convert_to_csv):
367
- """Sets the convert_to_csv of this DatasetNewRequest.
368
-
369
- Whether or not a tabular dataset should be converted to csv #
370
- noqa: E501
371
-
372
- :param convert_to_csv: The convert_to_csv of this
373
- DatasetNewRequest. # noqa: E501
374
- :type: bool
375
- """
376
-
377
- self._convert_to_csv = convert_to_csv
378
-
379
- @property
380
- def category_ids(self):
381
- """Gets the category_ids of this DatasetNewRequest. # noqa: E501.
382
-
383
- A list of tag IDs to associated with the dataset # noqa: E501
384
-
385
- :return: The category_ids of this DatasetNewRequest. # noqa:
386
- E501
387
- :rtype: list[str]
388
- """
389
- return self._category_ids
390
-
391
- @category_ids.setter
392
- def category_ids(self, category_ids):
393
- """Sets the category_ids of this DatasetNewRequest.
394
-
395
- A list of tag IDs to associated with the dataset # noqa: E501
396
-
397
- :param category_ids: The category_ids of this DatasetNewRequest.
398
- # noqa: E501
399
- :type: list[str]
400
- """
401
-
402
- self._category_ids = category_ids
403
-
404
- def to_dict(self):
405
- """Returns the model properties as a dict."""
406
- result = {}
407
-
408
- for attr, _ in six.iteritems(self.project_types):
409
- value = getattr(self, attr)
410
- if isinstance(value, list):
411
- result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
412
- elif hasattr(value, "to_dict"):
413
- result[attr] = value.to_dict()
414
- elif isinstance(value, dict):
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
- )
421
- else:
422
- result[attr] = value
423
-
424
- return result
425
-
426
- def to_str(self):
427
- """Returns the string representation of the model."""
428
- return pprint.pformat(self.to_dict())
429
-
430
- def __repr__(self):
431
- """For `print` and `pprint`"""
432
- return self.to_str()
433
-
434
- def __eq__(self, other):
435
- """Returns true if both objects are equal."""
436
- if not isinstance(other, DatasetNewRequest):
437
- return False
438
-
439
- return self.__dict__ == other.__dict__
440
-
441
- def __ne__(self, other):
442
- """Returns true if both objects are not equal."""
443
- return not self == other