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
@@ -1,4 +1,4 @@
1
1
  class ApiBlobType(object):
2
- DATASET = "dataset"
3
- MODEL = "model"
4
- INBOX = "inbox"
2
+ DATASET = "dataset"
3
+ MODEL = "model"
4
+ INBOX = "inbox"
@@ -23,92 +23,84 @@ import six
23
23
 
24
24
 
25
25
  class DatasetColumn(object):
26
- """
26
+ """
27
27
  Attributes:
28
28
  column_types (dict): The key is attribute name
29
29
  and the value is attribute type.
30
30
  attribute_map (dict): The key is attribute name
31
31
  and the value is json key in definition.
32
32
  """
33
- column_types = {
34
- 'order': 'float',
35
- 'name': 'str',
36
- 'type': 'str',
37
- 'original_type': 'str',
38
- 'description': 'str'
39
- }
40
-
41
- attribute_map = {
42
- 'order': 'order',
43
- 'name': 'name',
44
- 'type': 'type',
45
- 'original_type': 'originalType',
46
- 'description': 'description'
47
- }
48
-
49
- def __init__(self,
50
- order=None,
51
- name=None,
52
- type=None,
53
- original_type=None,
54
- description=None): # noqa: E501
55
- """DatasetColumn - a model defined in Swagger""" # noqa: E501
56
-
57
- self._order = None
58
- self._name = None
59
- self._type = None
60
- self._original_type = None
61
- self._description = None
62
- self.discriminator = None
63
-
64
- if order is not None:
65
- self.order = order
66
- if name is not None:
67
- self.name = name
68
- if type is not None:
69
- self.type = type
70
- if original_type is not None:
71
- self.original_type = original_type
72
- if description is not None:
73
- self.description = description
74
-
75
- @property
76
- def order(self):
77
- """Gets the order of this DatasetColumn. # noqa: E501
78
-
79
- The order that the column comes in, 0-based. (The first column is 0, second is 1, etc.) # noqa: E501
33
+
34
+ column_types = {"order": "float", "name": "str", "type": "str", "original_type": "str", "description": "str"}
35
+
36
+ attribute_map = {
37
+ "order": "order",
38
+ "name": "name",
39
+ "type": "type",
40
+ "original_type": "originalType",
41
+ "description": "description",
42
+ }
43
+
44
+ def __init__(self, order=None, name=None, type=None, original_type=None, description=None): # noqa: E501
45
+ """DatasetColumn - a model defined in Swagger""" # noqa: E501
46
+
47
+ self._order = None
48
+ self._name = None
49
+ self._type = None
50
+ self._original_type = None
51
+ self._description = None
52
+ self.discriminator = None
53
+
54
+ if order is not None:
55
+ self.order = order
56
+ if name is not None:
57
+ self.name = name
58
+ if type is not None:
59
+ self.type = type
60
+ if original_type is not None:
61
+ self.original_type = original_type
62
+ if description is not None:
63
+ self.description = description
64
+
65
+ @property
66
+ def order(self):
67
+ """Gets the order of this DatasetColumn. # noqa: E501.
68
+
69
+ The order that the column comes in, 0-based. (The first column is 0,
70
+ second is 1, etc.) # noqa: E501
80
71
 
81
72
  :return: The order of this DatasetColumn. # noqa: E501
82
73
  :rtype: float
83
74
  """
84
- return self._order
75
+ return self._order
85
76
 
86
- @order.setter
87
- def order(self, order):
88
- """Sets the order of this DatasetColumn.
77
+ @order.setter
78
+ def order(self, order):
79
+ """Sets the order of this DatasetColumn.
89
80
 
90
- The order that the column comes in, 0-based. (The first column is 0, second is 1, etc.) # noqa: E501
81
+ The order that the column comes in, 0-based. (The first column is 0,
82
+ second is 1, etc.) # noqa: E501
91
83
 
92
84
  :param order: The order of this DatasetColumn. # noqa: E501
93
85
  :type: float
94
86
  """
95
87
 
96
- self._order = order
88
+ self._order = order
97
89
 
98
- @property
99
- def name(self):
100
- """Gets the name of this DatasetColumn. # noqa: E501
90
+ @property
91
+ def name(self):
92
+ """Gets the name of this DatasetColumn. # noqa: E501.
101
93
 
102
94
  The column name # noqa: E501
103
95
 
104
96
  :return: The name of this DatasetColumn. # noqa: E501
105
97
  :rtype: str
106
98
  """
107
- return self._name
99
+ return self._name
108
100
 
109
- @name.setter
110
- def name(self, name):
111
- """Sets the name of this DatasetColumn.
101
+ @name.setter
102
+ def name(self, name):
103
+ """Sets the name of this DatasetColumn.
112
104
 
113
105
  The column name # noqa: E501
114
106
 
@@ -116,45 +108,51 @@ class DatasetColumn(object):
116
108
  :type: str
117
109
  """
118
110
 
119
- self._name = name
111
+ self._name = name
120
112
 
121
- @property
122
- def type(self):
123
- """Gets the type of this DatasetColumn. # noqa: E501
113
+ @property
114
+ def type(self):
115
+ """Gets the type of this DatasetColumn. # noqa: E501.
124
116
 
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
117
+ The type of all of the fields in the column. Please see the data
118
+ types on
119
+ https://github.com/Kaggle/kaggle-api/wiki/Dataset-Metadata
120
+ # noqa: E501
126
121
 
127
122
  :return: The type of this DatasetColumn. # noqa: E501
128
123
  :rtype: str
129
124
  """
130
- return self._type
125
+ return self._type
131
126
 
132
- @type.setter
133
- def type(self, type):
134
- """Sets the type of this DatasetColumn.
127
+ @type.setter
128
+ def type(self, type):
129
+ """Sets the type of this DatasetColumn.
135
130
 
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
131
+ The type of all of the fields in the column. Please see the data
132
+ types on
133
+ https://github.com/Kaggle/kaggle-api/wiki/Dataset-Metadata
134
+ # noqa: E501
137
135
 
138
136
  :param type: The type of this DatasetColumn. # noqa: E501
139
137
  :type: str
140
138
  """
141
139
 
142
- self._type = type
140
+ self._type = type
143
141
 
144
- @property
145
- def original_type(self):
146
- """Gets the original_type of this DatasetColumn. # noqa: E501
142
+ @property
143
+ def original_type(self):
144
+ """Gets the original_type of this DatasetColumn. # noqa: E501.
147
145
 
148
146
  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
147
 
150
148
  :return: The original_type of this DatasetColumn. # noqa: E501
151
149
  :rtype: str
152
150
  """
153
- return self._original_type
151
+ return self._original_type
154
152
 
155
- @original_type.setter
156
- def original_type(self, original_type):
157
- """Sets the original_type of this DatasetColumn.
153
+ @original_type.setter
154
+ def original_type(self, original_type):
155
+ """Sets the original_type of this DatasetColumn.
158
156
 
159
157
  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
158
 
@@ -162,67 +160,69 @@ class DatasetColumn(object):
162
160
  :type: str
163
161
  """
164
162
 
165
- self._original_type = original_type
163
+ self._original_type = original_type
166
164
 
167
- @property
168
- def description(self):
169
- """Gets the description of this DatasetColumn. # noqa: E501
165
+ @property
166
+ def description(self):
167
+ """Gets the description of this DatasetColumn. # noqa: E501.
170
168
 
171
169
  The description of the column # noqa: E501
172
170
 
173
171
  :return: The description of this DatasetColumn. # noqa: E501
174
172
  :rtype: str
175
173
  """
176
- return self._description
174
+ return self._description
177
175
 
178
- @description.setter
179
- def description(self, description):
180
- """Sets the description of this DatasetColumn.
176
+ @description.setter
177
+ def description(self, description):
178
+ """Sets the description of this DatasetColumn.
181
179
 
182
180
  The description of the column # noqa: E501
183
181
 
184
- :param description: The description of this DatasetColumn. # noqa: E501
182
+ :param description: The description of this DatasetColumn. # noqa:
183
+ E501
185
184
  :type: str
186
185
  """
187
186
 
188
- self._description = description
189
-
190
- def to_dict(self):
191
- """Returns the model properties as a dict"""
192
- result = {}
193
-
194
- for attr, _ in six.iteritems(self.column_types):
195
- value = getattr(self, attr)
196
- if isinstance(value, list):
197
- result[attr] = list(
198
- map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
199
- elif hasattr(value, "to_dict"):
200
- result[attr] = value.to_dict()
201
- elif isinstance(value, dict):
202
- result[attr] = dict(
203
- map(
204
- lambda item: (item[0], item[1].to_dict())
205
- if hasattr(item[1], "to_dict") else item, value.items()))
206
- else:
207
- result[attr] = value
208
-
209
- return result
210
-
211
- def to_str(self):
212
- """Returns the string representation of the model"""
213
- return pprint.pformat(self.to_dict())
214
-
215
- def __repr__(self):
216
- """For `print` and `pprint`"""
217
- return self.to_str()
218
-
219
- def __eq__(self, other):
220
- """Returns true if both objects are equal"""
221
- if not isinstance(other, DatasetColumn):
222
- return False
223
-
224
- return self.__dict__ == other.__dict__
225
-
226
- def __ne__(self, other):
227
- """Returns true if both objects are not equal"""
228
- return not self == other
187
+ self._description = description
188
+
189
+ def to_dict(self):
190
+ """Returns the model properties as a dict."""
191
+ result = {}
192
+
193
+ for attr, _ in six.iteritems(self.column_types):
194
+ value = getattr(self, attr)
195
+ if isinstance(value, list):
196
+ result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
197
+ elif hasattr(value, "to_dict"):
198
+ result[attr] = value.to_dict()
199
+ elif isinstance(value, dict):
200
+ result[attr] = dict(
201
+ map(
202
+ lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
203
+ value.items(),
204
+ )
205
+ )
206
+ else:
207
+ result[attr] = value
208
+
209
+ return result
210
+
211
+ def to_str(self):
212
+ """Returns the string representation of the model."""
213
+ return pprint.pformat(self.to_dict())
214
+
215
+ def __repr__(self):
216
+ """For `print` and `pprint`"""
217
+ return self.to_str()
218
+
219
+ def __eq__(self, other):
220
+ """Returns true if both objects are equal."""
221
+ if not isinstance(other, DatasetColumn):
222
+ return False
223
+
224
+ return self.__dict__ == other.__dict__
225
+
226
+ def __ne__(self, other):
227
+ """Returns true if both objects are not equal."""
228
+ return not self == other