kaggle 1.7.4.5__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.
- kaggle/__init__.py +10 -6
- kaggle/api/kaggle_api.py +574 -598
- kaggle/api/kaggle_api_extended.py +5251 -4769
- kaggle/cli.py +1335 -1585
- kaggle/models/api_blob_type.py +3 -3
- kaggle/models/dataset_column.py +165 -174
- kaggle/models/dataset_new_request.py +83 -41
- kaggle/models/dataset_new_version_request.py +32 -25
- kaggle/models/dataset_update_settings_request.py +35 -27
- kaggle/models/kaggle_models_extended.py +169 -172
- kaggle/models/kernel_push_request.py +66 -49
- kaggle/models/model_instance_new_version_request.py +10 -18
- kaggle/models/model_instance_update_request.py +103 -34
- kaggle/models/model_new_instance_request.py +138 -41
- kaggle/models/model_new_request.py +35 -27
- kaggle/models/model_update_request.py +32 -25
- kaggle/models/start_blob_upload_request.py +192 -195
- kaggle/models/start_blob_upload_response.py +98 -98
- kaggle/models/upload_file.py +114 -120
- kaggle/test/test_authenticate.py +23 -23
- {kaggle-1.7.4.5.dist-info → kaggle-1.8.0.dist-info}/METADATA +11 -15
- kaggle-1.8.0.dist-info/RECORD +148 -0
- kagglesdk/__init__.py +5 -1
- kagglesdk/benchmarks/services/__init__.py +0 -0
- kagglesdk/benchmarks/services/benchmarks_api_service.py +19 -0
- kagglesdk/benchmarks/types/__init__.py +0 -0
- kagglesdk/benchmarks/types/benchmark_types.py +307 -0
- kagglesdk/benchmarks/types/benchmarks_api_service.py +243 -0
- kagglesdk/blobs/services/blob_api_service.py +1 -1
- kagglesdk/blobs/types/blob_api_service.py +2 -2
- kagglesdk/common/services/__init__.py +0 -0
- kagglesdk/common/services/operations_service.py +46 -0
- kagglesdk/common/types/file_download.py +1 -1
- kagglesdk/common/types/http_redirect.py +1 -1
- kagglesdk/common/types/operations.py +194 -0
- kagglesdk/common/types/operations_service.py +48 -0
- kagglesdk/community/__init__.py +0 -0
- kagglesdk/community/types/__init__.py +0 -0
- kagglesdk/community/types/content_enums.py +44 -0
- kagglesdk/community/types/organization.py +410 -0
- kagglesdk/competitions/services/competition_api_service.py +49 -12
- kagglesdk/competitions/types/competition.py +14 -0
- kagglesdk/competitions/types/competition_api_service.py +1639 -1275
- kagglesdk/competitions/types/search_competitions.py +28 -0
- kagglesdk/datasets/databundles/__init__.py +0 -0
- kagglesdk/datasets/databundles/types/__init__.py +0 -0
- kagglesdk/datasets/databundles/types/databundle_api_types.py +540 -0
- kagglesdk/datasets/services/dataset_api_service.py +39 -14
- kagglesdk/datasets/types/dataset_api_service.py +554 -300
- kagglesdk/datasets/types/dataset_enums.py +21 -0
- kagglesdk/datasets/types/dataset_service.py +145 -0
- kagglesdk/datasets/types/dataset_types.py +74 -74
- kagglesdk/datasets/types/search_datasets.py +6 -0
- kagglesdk/discussions/__init__.py +0 -0
- kagglesdk/discussions/types/__init__.py +0 -0
- kagglesdk/discussions/types/search_discussions.py +43 -0
- kagglesdk/discussions/types/writeup_enums.py +11 -0
- kagglesdk/education/services/education_api_service.py +1 -1
- kagglesdk/education/types/education_api_service.py +1 -1
- kagglesdk/kaggle_client.py +46 -23
- kagglesdk/kaggle_creds.py +148 -0
- kagglesdk/kaggle_env.py +89 -25
- kagglesdk/kaggle_http_client.py +216 -306
- kagglesdk/kaggle_oauth.py +200 -0
- kagglesdk/kaggle_object.py +286 -293
- kagglesdk/kernels/services/kernels_api_service.py +46 -9
- kagglesdk/kernels/types/kernels_api_service.py +635 -159
- kagglesdk/kernels/types/kernels_enums.py +6 -0
- kagglesdk/kernels/types/search_kernels.py +6 -0
- kagglesdk/licenses/__init__.py +0 -0
- kagglesdk/licenses/types/__init__.py +0 -0
- kagglesdk/licenses/types/licenses_types.py +182 -0
- kagglesdk/models/services/model_api_service.py +41 -17
- kagglesdk/models/types/model_api_service.py +987 -637
- kagglesdk/models/types/model_enums.py +8 -0
- kagglesdk/models/types/model_service.py +71 -71
- kagglesdk/models/types/model_types.py +1057 -5
- kagglesdk/models/types/search_models.py +8 -0
- kagglesdk/search/__init__.py +0 -0
- kagglesdk/search/services/__init__.py +0 -0
- kagglesdk/search/services/search_api_service.py +19 -0
- kagglesdk/search/types/__init__.py +0 -0
- kagglesdk/search/types/search_api_service.py +2435 -0
- kagglesdk/search/types/search_content_shared.py +50 -0
- kagglesdk/search/types/search_enums.py +45 -0
- kagglesdk/search/types/search_service.py +303 -0
- kagglesdk/security/services/iam_service.py +31 -0
- kagglesdk/security/services/oauth_service.py +27 -1
- kagglesdk/security/types/authentication.py +63 -63
- kagglesdk/security/types/iam_service.py +496 -0
- kagglesdk/security/types/oauth_service.py +797 -10
- kagglesdk/security/types/roles.py +8 -0
- kagglesdk/security/types/security_types.py +159 -0
- kagglesdk/test/__init__.py +0 -0
- kagglesdk/test/test_client.py +20 -22
- kagglesdk/users/services/account_service.py +13 -1
- kagglesdk/users/services/group_api_service.py +31 -0
- kagglesdk/users/types/account_service.py +169 -28
- kagglesdk/users/types/group_api_service.py +315 -0
- kagglesdk/users/types/group_types.py +165 -0
- kagglesdk/users/types/groups_enum.py +8 -0
- kagglesdk/users/types/progression_service.py +9 -0
- kagglesdk/users/types/search_users.py +23 -0
- kagglesdk/users/types/user_avatar.py +226 -0
- kaggle/configuration.py +0 -206
- kaggle-1.7.4.5.dist-info/RECORD +0 -98
- {kaggle-1.7.4.5.dist-info → kaggle-1.8.0.dist-info}/WHEEL +0 -0
- {kaggle-1.7.4.5.dist-info → kaggle-1.8.0.dist-info}/entry_points.txt +0 -0
- {kaggle-1.7.4.5.dist-info → kaggle-1.8.0.dist-info}/licenses/LICENSE.txt +0 -0
- {kaggle/test → kagglesdk/benchmarks}/__init__.py +0 -0
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
import enum
|
|
3
|
+
from kagglesdk.community.types.content_enums import ContentState
|
|
4
|
+
from kagglesdk.kaggle_object import *
|
|
5
|
+
from kagglesdk.users.types.user_avatar import UserAvatar
|
|
6
|
+
from typing import Optional, List
|
|
7
|
+
|
|
8
|
+
class OrganizationCategory(enum.Enum):
|
|
9
|
+
ORGANIZATION_CATEGORY_UNSPECIFIED = 0
|
|
10
|
+
STUDY_GROUP = 1
|
|
11
|
+
"""Academic non-organization, e.g. student association"""
|
|
12
|
+
COMPANY_OR_NON_PROFIT_OR_GOVERNMENT = 2
|
|
13
|
+
"""Indicates a company, non-profit, or government organization"""
|
|
14
|
+
RESEARCH_LAB = 3
|
|
15
|
+
r"""
|
|
16
|
+
Academic / corporate research-focused organization, e.g. university or
|
|
17
|
+
medical research
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
class OrganizationMembershipType(enum.Enum):
|
|
21
|
+
ORGANIZATION_MEMBERSHIP_TYPE_UNSPECIFIED = 0
|
|
22
|
+
MEMBER = 1
|
|
23
|
+
"""Regular members of an organization"""
|
|
24
|
+
OWNER = 2
|
|
25
|
+
"""The current owner of an organization"""
|
|
26
|
+
CREATOR = 3
|
|
27
|
+
"""The original creator of an organization"""
|
|
28
|
+
|
|
29
|
+
class Organization(KaggleObject):
|
|
30
|
+
r"""
|
|
31
|
+
Attributes:
|
|
32
|
+
name (str)
|
|
33
|
+
Display name for an organization
|
|
34
|
+
thumbnail_image_url (str)
|
|
35
|
+
URL for a thumbnail image of an organization
|
|
36
|
+
subtitle (str)
|
|
37
|
+
Subtitle / tagline for an organization
|
|
38
|
+
external_url (str)
|
|
39
|
+
External website for an organization
|
|
40
|
+
id (int)
|
|
41
|
+
The organization's ID
|
|
42
|
+
slug (str)
|
|
43
|
+
Full slug for the organization
|
|
44
|
+
featured_members (UserAvatar)
|
|
45
|
+
A subset of the organization's members for displaying on an organization
|
|
46
|
+
profile
|
|
47
|
+
membership_type (OrganizationMembershipType)
|
|
48
|
+
Membership type for the current user for this organization
|
|
49
|
+
content_state (ContentState)
|
|
50
|
+
The Content State for this Organization, if the current user can view it.
|
|
51
|
+
member_count (int)
|
|
52
|
+
The total count of members in the organization
|
|
53
|
+
dataset_count (int)
|
|
54
|
+
The total count of datasets for the organization
|
|
55
|
+
competition_count (int)
|
|
56
|
+
The total count of competitions for the organization
|
|
57
|
+
model_count (int)
|
|
58
|
+
The total count of models for the organization
|
|
59
|
+
invite_code (str)
|
|
60
|
+
This organization's invite code, if the current user can view it.
|
|
61
|
+
category (OrganizationCategory)
|
|
62
|
+
The category this organization belongs to. Historically organizations did
|
|
63
|
+
not have this field, so not every organization is guaranteed to have it
|
|
64
|
+
now.
|
|
65
|
+
owner_user (UserAvatar)
|
|
66
|
+
The current owner of the organization
|
|
67
|
+
overview (str)
|
|
68
|
+
Organization overview
|
|
69
|
+
create_time (datetime)
|
|
70
|
+
When the organization was created.
|
|
71
|
+
allow_model_gating (bool)
|
|
72
|
+
benchmark_count (int)
|
|
73
|
+
The total count of benchmarks for the organization
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
def __init__(self):
|
|
77
|
+
self._name = ""
|
|
78
|
+
self._thumbnail_image_url = ""
|
|
79
|
+
self._subtitle = None
|
|
80
|
+
self._external_url = None
|
|
81
|
+
self._id = 0
|
|
82
|
+
self._slug = ""
|
|
83
|
+
self._featured_members = []
|
|
84
|
+
self._membership_type = None
|
|
85
|
+
self._content_state = None
|
|
86
|
+
self._member_count = 0
|
|
87
|
+
self._dataset_count = 0
|
|
88
|
+
self._competition_count = 0
|
|
89
|
+
self._model_count = 0
|
|
90
|
+
self._invite_code = None
|
|
91
|
+
self._category = None
|
|
92
|
+
self._owner_user = None
|
|
93
|
+
self._overview = None
|
|
94
|
+
self._create_time = None
|
|
95
|
+
self._allow_model_gating = None
|
|
96
|
+
self._benchmark_count = 0
|
|
97
|
+
self._freeze()
|
|
98
|
+
|
|
99
|
+
@property
|
|
100
|
+
def name(self) -> str:
|
|
101
|
+
"""Display name for an organization"""
|
|
102
|
+
return self._name
|
|
103
|
+
|
|
104
|
+
@name.setter
|
|
105
|
+
def name(self, name: str):
|
|
106
|
+
if name is None:
|
|
107
|
+
del self.name
|
|
108
|
+
return
|
|
109
|
+
if not isinstance(name, str):
|
|
110
|
+
raise TypeError('name must be of type str')
|
|
111
|
+
self._name = name
|
|
112
|
+
|
|
113
|
+
@property
|
|
114
|
+
def thumbnail_image_url(self) -> str:
|
|
115
|
+
"""URL for a thumbnail image of an organization"""
|
|
116
|
+
return self._thumbnail_image_url
|
|
117
|
+
|
|
118
|
+
@thumbnail_image_url.setter
|
|
119
|
+
def thumbnail_image_url(self, thumbnail_image_url: str):
|
|
120
|
+
if thumbnail_image_url is None:
|
|
121
|
+
del self.thumbnail_image_url
|
|
122
|
+
return
|
|
123
|
+
if not isinstance(thumbnail_image_url, str):
|
|
124
|
+
raise TypeError('thumbnail_image_url must be of type str')
|
|
125
|
+
self._thumbnail_image_url = thumbnail_image_url
|
|
126
|
+
|
|
127
|
+
@property
|
|
128
|
+
def subtitle(self) -> str:
|
|
129
|
+
"""Subtitle / tagline for an organization"""
|
|
130
|
+
return self._subtitle or ""
|
|
131
|
+
|
|
132
|
+
@subtitle.setter
|
|
133
|
+
def subtitle(self, subtitle: Optional[str]):
|
|
134
|
+
if subtitle is None:
|
|
135
|
+
del self.subtitle
|
|
136
|
+
return
|
|
137
|
+
if not isinstance(subtitle, str):
|
|
138
|
+
raise TypeError('subtitle must be of type str')
|
|
139
|
+
self._subtitle = subtitle
|
|
140
|
+
|
|
141
|
+
@property
|
|
142
|
+
def external_url(self) -> str:
|
|
143
|
+
"""External website for an organization"""
|
|
144
|
+
return self._external_url or ""
|
|
145
|
+
|
|
146
|
+
@external_url.setter
|
|
147
|
+
def external_url(self, external_url: Optional[str]):
|
|
148
|
+
if external_url is None:
|
|
149
|
+
del self.external_url
|
|
150
|
+
return
|
|
151
|
+
if not isinstance(external_url, str):
|
|
152
|
+
raise TypeError('external_url must be of type str')
|
|
153
|
+
self._external_url = external_url
|
|
154
|
+
|
|
155
|
+
@property
|
|
156
|
+
def id(self) -> int:
|
|
157
|
+
"""The organization's ID"""
|
|
158
|
+
return self._id
|
|
159
|
+
|
|
160
|
+
@id.setter
|
|
161
|
+
def id(self, id: int):
|
|
162
|
+
if id is None:
|
|
163
|
+
del self.id
|
|
164
|
+
return
|
|
165
|
+
if not isinstance(id, int):
|
|
166
|
+
raise TypeError('id must be of type int')
|
|
167
|
+
self._id = id
|
|
168
|
+
|
|
169
|
+
@property
|
|
170
|
+
def slug(self) -> str:
|
|
171
|
+
"""Full slug for the organization"""
|
|
172
|
+
return self._slug
|
|
173
|
+
|
|
174
|
+
@slug.setter
|
|
175
|
+
def slug(self, slug: str):
|
|
176
|
+
if slug is None:
|
|
177
|
+
del self.slug
|
|
178
|
+
return
|
|
179
|
+
if not isinstance(slug, str):
|
|
180
|
+
raise TypeError('slug must be of type str')
|
|
181
|
+
self._slug = slug
|
|
182
|
+
|
|
183
|
+
@property
|
|
184
|
+
def featured_members(self) -> Optional[List[Optional['UserAvatar']]]:
|
|
185
|
+
r"""
|
|
186
|
+
A subset of the organization's members for displaying on an organization
|
|
187
|
+
profile
|
|
188
|
+
"""
|
|
189
|
+
return self._featured_members
|
|
190
|
+
|
|
191
|
+
@featured_members.setter
|
|
192
|
+
def featured_members(self, featured_members: Optional[List[Optional['UserAvatar']]]):
|
|
193
|
+
if featured_members is None:
|
|
194
|
+
del self.featured_members
|
|
195
|
+
return
|
|
196
|
+
if not isinstance(featured_members, list):
|
|
197
|
+
raise TypeError('featured_members must be of type list')
|
|
198
|
+
if not all([isinstance(t, UserAvatar) for t in featured_members]):
|
|
199
|
+
raise TypeError('featured_members must contain only items of type UserAvatar')
|
|
200
|
+
self._featured_members = featured_members
|
|
201
|
+
|
|
202
|
+
@property
|
|
203
|
+
def membership_type(self) -> 'OrganizationMembershipType':
|
|
204
|
+
"""Membership type for the current user for this organization"""
|
|
205
|
+
return self._membership_type or OrganizationMembershipType.ORGANIZATION_MEMBERSHIP_TYPE_UNSPECIFIED
|
|
206
|
+
|
|
207
|
+
@membership_type.setter
|
|
208
|
+
def membership_type(self, membership_type: Optional['OrganizationMembershipType']):
|
|
209
|
+
if membership_type is None:
|
|
210
|
+
del self.membership_type
|
|
211
|
+
return
|
|
212
|
+
if not isinstance(membership_type, OrganizationMembershipType):
|
|
213
|
+
raise TypeError('membership_type must be of type OrganizationMembershipType')
|
|
214
|
+
self._membership_type = membership_type
|
|
215
|
+
|
|
216
|
+
@property
|
|
217
|
+
def content_state(self) -> 'ContentState':
|
|
218
|
+
"""The Content State for this Organization, if the current user can view it."""
|
|
219
|
+
return self._content_state or ContentState.CONTENT_STATE_UNSPECIFIED
|
|
220
|
+
|
|
221
|
+
@content_state.setter
|
|
222
|
+
def content_state(self, content_state: Optional['ContentState']):
|
|
223
|
+
if content_state is None:
|
|
224
|
+
del self.content_state
|
|
225
|
+
return
|
|
226
|
+
if not isinstance(content_state, ContentState):
|
|
227
|
+
raise TypeError('content_state must be of type ContentState')
|
|
228
|
+
self._content_state = content_state
|
|
229
|
+
|
|
230
|
+
@property
|
|
231
|
+
def member_count(self) -> int:
|
|
232
|
+
"""The total count of members in the organization"""
|
|
233
|
+
return self._member_count
|
|
234
|
+
|
|
235
|
+
@member_count.setter
|
|
236
|
+
def member_count(self, member_count: int):
|
|
237
|
+
if member_count is None:
|
|
238
|
+
del self.member_count
|
|
239
|
+
return
|
|
240
|
+
if not isinstance(member_count, int):
|
|
241
|
+
raise TypeError('member_count must be of type int')
|
|
242
|
+
self._member_count = member_count
|
|
243
|
+
|
|
244
|
+
@property
|
|
245
|
+
def dataset_count(self) -> int:
|
|
246
|
+
"""The total count of datasets for the organization"""
|
|
247
|
+
return self._dataset_count
|
|
248
|
+
|
|
249
|
+
@dataset_count.setter
|
|
250
|
+
def dataset_count(self, dataset_count: int):
|
|
251
|
+
if dataset_count is None:
|
|
252
|
+
del self.dataset_count
|
|
253
|
+
return
|
|
254
|
+
if not isinstance(dataset_count, int):
|
|
255
|
+
raise TypeError('dataset_count must be of type int')
|
|
256
|
+
self._dataset_count = dataset_count
|
|
257
|
+
|
|
258
|
+
@property
|
|
259
|
+
def competition_count(self) -> int:
|
|
260
|
+
"""The total count of competitions for the organization"""
|
|
261
|
+
return self._competition_count
|
|
262
|
+
|
|
263
|
+
@competition_count.setter
|
|
264
|
+
def competition_count(self, competition_count: int):
|
|
265
|
+
if competition_count is None:
|
|
266
|
+
del self.competition_count
|
|
267
|
+
return
|
|
268
|
+
if not isinstance(competition_count, int):
|
|
269
|
+
raise TypeError('competition_count must be of type int')
|
|
270
|
+
self._competition_count = competition_count
|
|
271
|
+
|
|
272
|
+
@property
|
|
273
|
+
def model_count(self) -> int:
|
|
274
|
+
"""The total count of models for the organization"""
|
|
275
|
+
return self._model_count
|
|
276
|
+
|
|
277
|
+
@model_count.setter
|
|
278
|
+
def model_count(self, model_count: int):
|
|
279
|
+
if model_count is None:
|
|
280
|
+
del self.model_count
|
|
281
|
+
return
|
|
282
|
+
if not isinstance(model_count, int):
|
|
283
|
+
raise TypeError('model_count must be of type int')
|
|
284
|
+
self._model_count = model_count
|
|
285
|
+
|
|
286
|
+
@property
|
|
287
|
+
def invite_code(self) -> str:
|
|
288
|
+
"""This organization's invite code, if the current user can view it."""
|
|
289
|
+
return self._invite_code or ""
|
|
290
|
+
|
|
291
|
+
@invite_code.setter
|
|
292
|
+
def invite_code(self, invite_code: Optional[str]):
|
|
293
|
+
if invite_code is None:
|
|
294
|
+
del self.invite_code
|
|
295
|
+
return
|
|
296
|
+
if not isinstance(invite_code, str):
|
|
297
|
+
raise TypeError('invite_code must be of type str')
|
|
298
|
+
self._invite_code = invite_code
|
|
299
|
+
|
|
300
|
+
@property
|
|
301
|
+
def category(self) -> 'OrganizationCategory':
|
|
302
|
+
r"""
|
|
303
|
+
The category this organization belongs to. Historically organizations did
|
|
304
|
+
not have this field, so not every organization is guaranteed to have it
|
|
305
|
+
now.
|
|
306
|
+
"""
|
|
307
|
+
return self._category or OrganizationCategory.ORGANIZATION_CATEGORY_UNSPECIFIED
|
|
308
|
+
|
|
309
|
+
@category.setter
|
|
310
|
+
def category(self, category: Optional['OrganizationCategory']):
|
|
311
|
+
if category is None:
|
|
312
|
+
del self.category
|
|
313
|
+
return
|
|
314
|
+
if not isinstance(category, OrganizationCategory):
|
|
315
|
+
raise TypeError('category must be of type OrganizationCategory')
|
|
316
|
+
self._category = category
|
|
317
|
+
|
|
318
|
+
@property
|
|
319
|
+
def owner_user(self) -> Optional['UserAvatar']:
|
|
320
|
+
"""The current owner of the organization"""
|
|
321
|
+
return self._owner_user
|
|
322
|
+
|
|
323
|
+
@owner_user.setter
|
|
324
|
+
def owner_user(self, owner_user: Optional['UserAvatar']):
|
|
325
|
+
if owner_user is None:
|
|
326
|
+
del self.owner_user
|
|
327
|
+
return
|
|
328
|
+
if not isinstance(owner_user, UserAvatar):
|
|
329
|
+
raise TypeError('owner_user must be of type UserAvatar')
|
|
330
|
+
self._owner_user = owner_user
|
|
331
|
+
|
|
332
|
+
@property
|
|
333
|
+
def overview(self) -> str:
|
|
334
|
+
"""Organization overview"""
|
|
335
|
+
return self._overview or ""
|
|
336
|
+
|
|
337
|
+
@overview.setter
|
|
338
|
+
def overview(self, overview: Optional[str]):
|
|
339
|
+
if overview is None:
|
|
340
|
+
del self.overview
|
|
341
|
+
return
|
|
342
|
+
if not isinstance(overview, str):
|
|
343
|
+
raise TypeError('overview must be of type str')
|
|
344
|
+
self._overview = overview
|
|
345
|
+
|
|
346
|
+
@property
|
|
347
|
+
def create_time(self) -> datetime:
|
|
348
|
+
"""When the organization was created."""
|
|
349
|
+
return self._create_time
|
|
350
|
+
|
|
351
|
+
@create_time.setter
|
|
352
|
+
def create_time(self, create_time: datetime):
|
|
353
|
+
if create_time is None:
|
|
354
|
+
del self.create_time
|
|
355
|
+
return
|
|
356
|
+
if not isinstance(create_time, datetime):
|
|
357
|
+
raise TypeError('create_time must be of type datetime')
|
|
358
|
+
self._create_time = create_time
|
|
359
|
+
|
|
360
|
+
@property
|
|
361
|
+
def allow_model_gating(self) -> bool:
|
|
362
|
+
return self._allow_model_gating or False
|
|
363
|
+
|
|
364
|
+
@allow_model_gating.setter
|
|
365
|
+
def allow_model_gating(self, allow_model_gating: Optional[bool]):
|
|
366
|
+
if allow_model_gating is None:
|
|
367
|
+
del self.allow_model_gating
|
|
368
|
+
return
|
|
369
|
+
if not isinstance(allow_model_gating, bool):
|
|
370
|
+
raise TypeError('allow_model_gating must be of type bool')
|
|
371
|
+
self._allow_model_gating = allow_model_gating
|
|
372
|
+
|
|
373
|
+
@property
|
|
374
|
+
def benchmark_count(self) -> int:
|
|
375
|
+
"""The total count of benchmarks for the organization"""
|
|
376
|
+
return self._benchmark_count
|
|
377
|
+
|
|
378
|
+
@benchmark_count.setter
|
|
379
|
+
def benchmark_count(self, benchmark_count: int):
|
|
380
|
+
if benchmark_count is None:
|
|
381
|
+
del self.benchmark_count
|
|
382
|
+
return
|
|
383
|
+
if not isinstance(benchmark_count, int):
|
|
384
|
+
raise TypeError('benchmark_count must be of type int')
|
|
385
|
+
self._benchmark_count = benchmark_count
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
Organization._fields = [
|
|
389
|
+
FieldMetadata("name", "name", "_name", str, "", PredefinedSerializer()),
|
|
390
|
+
FieldMetadata("thumbnailImageUrl", "thumbnail_image_url", "_thumbnail_image_url", str, "", PredefinedSerializer()),
|
|
391
|
+
FieldMetadata("subtitle", "subtitle", "_subtitle", str, None, PredefinedSerializer(), optional=True),
|
|
392
|
+
FieldMetadata("externalUrl", "external_url", "_external_url", str, None, PredefinedSerializer(), optional=True),
|
|
393
|
+
FieldMetadata("id", "id", "_id", int, 0, PredefinedSerializer()),
|
|
394
|
+
FieldMetadata("slug", "slug", "_slug", str, "", PredefinedSerializer()),
|
|
395
|
+
FieldMetadata("featuredMembers", "featured_members", "_featured_members", UserAvatar, [], ListSerializer(KaggleObjectSerializer())),
|
|
396
|
+
FieldMetadata("membershipType", "membership_type", "_membership_type", OrganizationMembershipType, None, EnumSerializer(), optional=True),
|
|
397
|
+
FieldMetadata("contentState", "content_state", "_content_state", ContentState, None, EnumSerializer(), optional=True),
|
|
398
|
+
FieldMetadata("memberCount", "member_count", "_member_count", int, 0, PredefinedSerializer()),
|
|
399
|
+
FieldMetadata("datasetCount", "dataset_count", "_dataset_count", int, 0, PredefinedSerializer()),
|
|
400
|
+
FieldMetadata("competitionCount", "competition_count", "_competition_count", int, 0, PredefinedSerializer()),
|
|
401
|
+
FieldMetadata("modelCount", "model_count", "_model_count", int, 0, PredefinedSerializer()),
|
|
402
|
+
FieldMetadata("inviteCode", "invite_code", "_invite_code", str, None, PredefinedSerializer(), optional=True),
|
|
403
|
+
FieldMetadata("category", "category", "_category", OrganizationCategory, None, EnumSerializer(), optional=True),
|
|
404
|
+
FieldMetadata("ownerUser", "owner_user", "_owner_user", UserAvatar, None, KaggleObjectSerializer()),
|
|
405
|
+
FieldMetadata("overview", "overview", "_overview", str, None, PredefinedSerializer(), optional=True),
|
|
406
|
+
FieldMetadata("createTime", "create_time", "_create_time", datetime, None, DateTimeSerializer()),
|
|
407
|
+
FieldMetadata("allowModelGating", "allow_model_gating", "_allow_model_gating", bool, None, PredefinedSerializer(), optional=True),
|
|
408
|
+
FieldMetadata("benchmarkCount", "benchmark_count", "_benchmark_count", int, 0, PredefinedSerializer()),
|
|
409
|
+
]
|
|
410
|
+
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from kagglesdk.common.types.file_download import FileDownload
|
|
2
2
|
from kagglesdk.common.types.http_redirect import HttpRedirect
|
|
3
|
-
from kagglesdk.competitions.types.competition_api_service import ApiCreateCodeSubmissionRequest, ApiCreateCodeSubmissionResponse, ApiCreateSubmissionRequest, ApiCreateSubmissionResponse, ApiDownloadDataFileRequest, ApiDownloadDataFilesRequest, ApiDownloadLeaderboardRequest, ApiGetLeaderboardRequest, ApiGetLeaderboardResponse, ApiGetSubmissionRequest, ApiListCompetitionsRequest, ApiListCompetitionsResponse, ApiListDataFilesRequest, ApiListDataFilesResponse, ApiListSubmissionsRequest, ApiListSubmissionsResponse, ApiStartSubmissionUploadRequest, ApiStartSubmissionUploadResponse, ApiSubmission
|
|
3
|
+
from kagglesdk.competitions.types.competition_api_service import ApiCompetition, ApiCreateCodeSubmissionRequest, ApiCreateCodeSubmissionResponse, ApiCreateSubmissionRequest, ApiCreateSubmissionResponse, ApiDownloadDataFileRequest, ApiDownloadDataFilesRequest, ApiDownloadLeaderboardRequest, ApiGetCompetitionDataFilesSummaryRequest, ApiGetCompetitionRequest, ApiGetLeaderboardRequest, ApiGetLeaderboardResponse, ApiGetSubmissionRequest, ApiListCompetitionsRequest, ApiListCompetitionsResponse, ApiListDataFilesRequest, ApiListDataFilesResponse, ApiListDataTreeFilesRequest, ApiListSubmissionsRequest, ApiListSubmissionsResponse, ApiStartSubmissionUploadRequest, ApiStartSubmissionUploadResponse, ApiSubmission
|
|
4
|
+
from kagglesdk.datasets.databundles.types.databundle_api_types import ApiDirectoryContent, ApiFilesSummary
|
|
4
5
|
from kagglesdk.kaggle_http_client import KaggleHttpClient
|
|
5
6
|
|
|
6
7
|
class CompetitionApiClient(object):
|
|
@@ -18,7 +19,7 @@ class CompetitionApiClient(object):
|
|
|
18
19
|
if request is None:
|
|
19
20
|
request = ApiListCompetitionsRequest()
|
|
20
21
|
|
|
21
|
-
return self._client.call("competitions.CompetitionApiService", "
|
|
22
|
+
return self._client.call("competitions.CompetitionApiService", "ListCompetitions", request, ApiListCompetitionsResponse)
|
|
22
23
|
|
|
23
24
|
def list_submissions(self, request: ApiListSubmissionsRequest = None) -> ApiListSubmissionsResponse:
|
|
24
25
|
r"""
|
|
@@ -30,7 +31,7 @@ class CompetitionApiClient(object):
|
|
|
30
31
|
if request is None:
|
|
31
32
|
request = ApiListSubmissionsRequest()
|
|
32
33
|
|
|
33
|
-
return self._client.call("competitions.CompetitionApiService", "
|
|
34
|
+
return self._client.call("competitions.CompetitionApiService", "ListSubmissions", request, ApiListSubmissionsResponse)
|
|
34
35
|
|
|
35
36
|
def list_data_files(self, request: ApiListDataFilesRequest = None) -> ApiListDataFilesResponse:
|
|
36
37
|
r"""
|
|
@@ -42,7 +43,19 @@ class CompetitionApiClient(object):
|
|
|
42
43
|
if request is None:
|
|
43
44
|
request = ApiListDataFilesRequest()
|
|
44
45
|
|
|
45
|
-
return self._client.call("competitions.CompetitionApiService", "
|
|
46
|
+
return self._client.call("competitions.CompetitionApiService", "ListDataFiles", request, ApiListDataFilesResponse)
|
|
47
|
+
|
|
48
|
+
def list_data_tree_files(self, request: ApiListDataTreeFilesRequest = None) -> ApiDirectoryContent:
|
|
49
|
+
r"""
|
|
50
|
+
Args:
|
|
51
|
+
request (ApiListDataTreeFilesRequest):
|
|
52
|
+
The request object; initialized to empty instance if not specified.
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
if request is None:
|
|
56
|
+
request = ApiListDataTreeFilesRequest()
|
|
57
|
+
|
|
58
|
+
return self._client.call("competitions.CompetitionApiService", "ListDataTreeFiles", request, ApiDirectoryContent)
|
|
46
59
|
|
|
47
60
|
def get_leaderboard(self, request: ApiGetLeaderboardRequest = None) -> ApiGetLeaderboardResponse:
|
|
48
61
|
r"""
|
|
@@ -54,7 +67,7 @@ class CompetitionApiClient(object):
|
|
|
54
67
|
if request is None:
|
|
55
68
|
request = ApiGetLeaderboardRequest()
|
|
56
69
|
|
|
57
|
-
return self._client.call("competitions.CompetitionApiService", "
|
|
70
|
+
return self._client.call("competitions.CompetitionApiService", "GetLeaderboard", request, ApiGetLeaderboardResponse)
|
|
58
71
|
|
|
59
72
|
def download_leaderboard(self, request: ApiDownloadLeaderboardRequest = None) -> FileDownload:
|
|
60
73
|
r"""
|
|
@@ -66,7 +79,7 @@ class CompetitionApiClient(object):
|
|
|
66
79
|
if request is None:
|
|
67
80
|
request = ApiDownloadLeaderboardRequest()
|
|
68
81
|
|
|
69
|
-
return self._client.call("competitions.CompetitionApiService", "
|
|
82
|
+
return self._client.call("competitions.CompetitionApiService", "DownloadLeaderboard", request, FileDownload)
|
|
70
83
|
|
|
71
84
|
def create_submission(self, request: ApiCreateSubmissionRequest = None) -> ApiCreateSubmissionResponse:
|
|
72
85
|
r"""
|
|
@@ -78,7 +91,7 @@ class CompetitionApiClient(object):
|
|
|
78
91
|
if request is None:
|
|
79
92
|
request = ApiCreateSubmissionRequest()
|
|
80
93
|
|
|
81
|
-
return self._client.call("competitions.CompetitionApiService", "
|
|
94
|
+
return self._client.call("competitions.CompetitionApiService", "CreateSubmission", request, ApiCreateSubmissionResponse)
|
|
82
95
|
|
|
83
96
|
def create_code_submission(self, request: ApiCreateCodeSubmissionRequest = None) -> ApiCreateCodeSubmissionResponse:
|
|
84
97
|
r"""
|
|
@@ -90,7 +103,7 @@ class CompetitionApiClient(object):
|
|
|
90
103
|
if request is None:
|
|
91
104
|
request = ApiCreateCodeSubmissionRequest()
|
|
92
105
|
|
|
93
|
-
return self._client.call("competitions.CompetitionApiService", "
|
|
106
|
+
return self._client.call("competitions.CompetitionApiService", "CreateCodeSubmission", request, ApiCreateCodeSubmissionResponse)
|
|
94
107
|
|
|
95
108
|
def get_submission(self, request: ApiGetSubmissionRequest = None) -> ApiSubmission:
|
|
96
109
|
r"""
|
|
@@ -102,7 +115,7 @@ class CompetitionApiClient(object):
|
|
|
102
115
|
if request is None:
|
|
103
116
|
request = ApiGetSubmissionRequest()
|
|
104
117
|
|
|
105
|
-
return self._client.call("competitions.CompetitionApiService", "
|
|
118
|
+
return self._client.call("competitions.CompetitionApiService", "GetSubmission", request, ApiSubmission)
|
|
106
119
|
|
|
107
120
|
def start_submission_upload(self, request: ApiStartSubmissionUploadRequest = None) -> ApiStartSubmissionUploadResponse:
|
|
108
121
|
r"""
|
|
@@ -114,7 +127,7 @@ class CompetitionApiClient(object):
|
|
|
114
127
|
if request is None:
|
|
115
128
|
request = ApiStartSubmissionUploadRequest()
|
|
116
129
|
|
|
117
|
-
return self._client.call("competitions.CompetitionApiService", "
|
|
130
|
+
return self._client.call("competitions.CompetitionApiService", "StartSubmissionUpload", request, ApiStartSubmissionUploadResponse)
|
|
118
131
|
|
|
119
132
|
def download_data_files(self, request: ApiDownloadDataFilesRequest = None) -> HttpRedirect:
|
|
120
133
|
r"""
|
|
@@ -126,7 +139,7 @@ class CompetitionApiClient(object):
|
|
|
126
139
|
if request is None:
|
|
127
140
|
request = ApiDownloadDataFilesRequest()
|
|
128
141
|
|
|
129
|
-
return self._client.call("competitions.CompetitionApiService", "
|
|
142
|
+
return self._client.call("competitions.CompetitionApiService", "DownloadDataFiles", request, HttpRedirect)
|
|
130
143
|
|
|
131
144
|
def download_data_file(self, request: ApiDownloadDataFileRequest = None) -> HttpRedirect:
|
|
132
145
|
r"""
|
|
@@ -138,4 +151,28 @@ class CompetitionApiClient(object):
|
|
|
138
151
|
if request is None:
|
|
139
152
|
request = ApiDownloadDataFileRequest()
|
|
140
153
|
|
|
141
|
-
return self._client.call("competitions.CompetitionApiService", "
|
|
154
|
+
return self._client.call("competitions.CompetitionApiService", "DownloadDataFile", request, HttpRedirect)
|
|
155
|
+
|
|
156
|
+
def get_competition(self, request: ApiGetCompetitionRequest = None) -> ApiCompetition:
|
|
157
|
+
r"""
|
|
158
|
+
Args:
|
|
159
|
+
request (ApiGetCompetitionRequest):
|
|
160
|
+
The request object; initialized to empty instance if not specified.
|
|
161
|
+
"""
|
|
162
|
+
|
|
163
|
+
if request is None:
|
|
164
|
+
request = ApiGetCompetitionRequest()
|
|
165
|
+
|
|
166
|
+
return self._client.call("competitions.CompetitionApiService", "GetCompetition", request, ApiCompetition)
|
|
167
|
+
|
|
168
|
+
def get_competition_data_files_summary(self, request: ApiGetCompetitionDataFilesSummaryRequest = None) -> ApiFilesSummary:
|
|
169
|
+
r"""
|
|
170
|
+
Args:
|
|
171
|
+
request (ApiGetCompetitionDataFilesSummaryRequest):
|
|
172
|
+
The request object; initialized to empty instance if not specified.
|
|
173
|
+
"""
|
|
174
|
+
|
|
175
|
+
if request is None:
|
|
176
|
+
request = ApiGetCompetitionDataFilesSummaryRequest()
|
|
177
|
+
|
|
178
|
+
return self._client.call("competitions.CompetitionApiService", "GetCompetitionDataFilesSummary", request, ApiFilesSummary)
|