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.
- kaggle/__init__.py +10 -6
- kaggle/api/kaggle_api.py +574 -585
- kaggle/api/kaggle_api_extended.py +5251 -4738
- kaggle/cli.py +1335 -1585
- kaggle/models/api_blob_type.py +3 -3
- kaggle/models/dataset_column.py +129 -129
- kaggle/models/dataset_new_request.py +130 -72
- kaggle/models/dataset_new_version_request.py +88 -56
- kaggle/models/dataset_update_settings_request.py +93 -59
- kaggle/models/kaggle_models_extended.py +169 -172
- kaggle/models/kernel_push_request.py +152 -100
- kaggle/models/model_instance_new_version_request.py +30 -30
- kaggle/models/model_instance_update_request.py +171 -71
- kaggle/models/model_new_instance_request.py +223 -88
- kaggle/models/model_new_request.py +61 -46
- kaggle/models/model_update_request.py +66 -48
- kaggle/models/start_blob_upload_request.py +146 -138
- kaggle/models/start_blob_upload_response.py +83 -78
- kaggle/models/upload_file.py +92 -96
- kaggle/test/test_authenticate.py +23 -23
- {kaggle-1.7.4.2.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 +567 -297
- 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 +55 -20
- kagglesdk/kaggle_creds.py +148 -0
- kagglesdk/kaggle_env.py +89 -27
- kagglesdk/kaggle_http_client.py +235 -290
- kagglesdk/kaggle_oauth.py +200 -0
- kagglesdk/kaggle_object.py +298 -250
- kagglesdk/kernels/services/kernels_api_service.py +46 -9
- kagglesdk/kernels/types/kernels_api_service.py +658 -158
- 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 +46 -21
- kagglesdk/models/types/model_api_service.py +1018 -652
- 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/__init__.py +0 -0
- kagglesdk/security/services/__init__.py +0 -0
- kagglesdk/security/services/iam_service.py +31 -0
- kagglesdk/security/services/oauth_service.py +58 -0
- kagglesdk/security/types/__init__.py +0 -0
- kagglesdk/security/types/authentication.py +171 -0
- kagglesdk/security/types/iam_service.py +496 -0
- kagglesdk/security/types/oauth_service.py +1181 -0
- 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 -24
- kagglesdk/users/services/__init__.py +0 -0
- kagglesdk/users/services/account_service.py +31 -0
- kagglesdk/users/services/group_api_service.py +31 -0
- kagglesdk/users/types/account_service.py +345 -0
- 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.2.dist-info/RECORD +0 -89
- {kaggle-1.7.4.2.dist-info → kaggle-1.8.0.dist-info}/WHEEL +0 -0
- {kaggle-1.7.4.2.dist-info → kaggle-1.8.0.dist-info}/entry_points.txt +0 -0
- {kaggle-1.7.4.2.dist-info → kaggle-1.8.0.dist-info}/licenses/LICENSE.txt +0 -0
- {kaggle/test → kagglesdk/benchmarks}/__init__.py +0 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
from kagglesdk.kaggle_object import *
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
4
|
+
class Operation(KaggleObject):
|
|
5
|
+
r"""
|
|
6
|
+
This resource represents a long-running operation that is the result of a
|
|
7
|
+
network API call.
|
|
8
|
+
|
|
9
|
+
Attributes:
|
|
10
|
+
name (str)
|
|
11
|
+
The server-assigned name, which is only unique within the same service that
|
|
12
|
+
originally returns it. If you use the default HTTP mapping, the
|
|
13
|
+
`name` should be a resource name ending with `operations/{unique_id}`.
|
|
14
|
+
metadata (object)
|
|
15
|
+
Service-specific metadata associated with the operation. It typically
|
|
16
|
+
contains progress information and common metadata such as create time.
|
|
17
|
+
Some services might not provide such metadata. Any method that returns a
|
|
18
|
+
long-running operation should document the metadata type, if any.
|
|
19
|
+
done (bool)
|
|
20
|
+
If the value is `false`, it means the operation is still in progress.
|
|
21
|
+
If `true`, the operation is completed, and either `error` or `response` is
|
|
22
|
+
available.
|
|
23
|
+
error (Operation.Status)
|
|
24
|
+
The error result of the operation in case of failure or cancellation.
|
|
25
|
+
response (object)
|
|
26
|
+
The normal, successful response of the operation. If the original
|
|
27
|
+
method returns no data on success, such as `Delete`, the response is
|
|
28
|
+
`google.protobuf.Empty`. If the original method is standard
|
|
29
|
+
`Get`/`Create`/`Update`, the response should be the resource. For other
|
|
30
|
+
methods, the response should have the type `XxxResponse`, where `Xxx`
|
|
31
|
+
is the original method name. For example, if the original method name
|
|
32
|
+
is `TakeSnapshot()`, the inferred response type is
|
|
33
|
+
`TakeSnapshotResponse`.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
class Status(KaggleObject):
|
|
37
|
+
r"""
|
|
38
|
+
Attributes:
|
|
39
|
+
code (int)
|
|
40
|
+
The HTTP status code that corresponds to `google.rpc.Status.code`.
|
|
41
|
+
message (str)
|
|
42
|
+
This corresponds to `google.rpc.Status.message`.
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
def __init__(self):
|
|
46
|
+
self._code = 0
|
|
47
|
+
self._message = ""
|
|
48
|
+
self._freeze()
|
|
49
|
+
|
|
50
|
+
@property
|
|
51
|
+
def code(self) -> int:
|
|
52
|
+
"""The HTTP status code that corresponds to `google.rpc.Status.code`."""
|
|
53
|
+
return self._code
|
|
54
|
+
|
|
55
|
+
@code.setter
|
|
56
|
+
def code(self, code: int):
|
|
57
|
+
if code is None:
|
|
58
|
+
del self.code
|
|
59
|
+
return
|
|
60
|
+
if not isinstance(code, int):
|
|
61
|
+
raise TypeError('code must be of type int')
|
|
62
|
+
self._code = code
|
|
63
|
+
|
|
64
|
+
@property
|
|
65
|
+
def message(self) -> str:
|
|
66
|
+
"""This corresponds to `google.rpc.Status.message`."""
|
|
67
|
+
return self._message
|
|
68
|
+
|
|
69
|
+
@message.setter
|
|
70
|
+
def message(self, message: str):
|
|
71
|
+
if message is None:
|
|
72
|
+
del self.message
|
|
73
|
+
return
|
|
74
|
+
if not isinstance(message, str):
|
|
75
|
+
raise TypeError('message must be of type str')
|
|
76
|
+
self._message = message
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def __init__(self):
|
|
80
|
+
self._name = ""
|
|
81
|
+
self._metadata = None
|
|
82
|
+
self._done = False
|
|
83
|
+
self._error = None
|
|
84
|
+
self._response = None
|
|
85
|
+
self._freeze()
|
|
86
|
+
|
|
87
|
+
@property
|
|
88
|
+
def name(self) -> str:
|
|
89
|
+
r"""
|
|
90
|
+
The server-assigned name, which is only unique within the same service that
|
|
91
|
+
originally returns it. If you use the default HTTP mapping, the
|
|
92
|
+
`name` should be a resource name ending with `operations/{unique_id}`.
|
|
93
|
+
"""
|
|
94
|
+
return self._name
|
|
95
|
+
|
|
96
|
+
@name.setter
|
|
97
|
+
def name(self, name: str):
|
|
98
|
+
if name is None:
|
|
99
|
+
del self.name
|
|
100
|
+
return
|
|
101
|
+
if not isinstance(name, str):
|
|
102
|
+
raise TypeError('name must be of type str')
|
|
103
|
+
self._name = name
|
|
104
|
+
|
|
105
|
+
@property
|
|
106
|
+
def metadata(self) -> object:
|
|
107
|
+
r"""
|
|
108
|
+
Service-specific metadata associated with the operation. It typically
|
|
109
|
+
contains progress information and common metadata such as create time.
|
|
110
|
+
Some services might not provide such metadata. Any method that returns a
|
|
111
|
+
long-running operation should document the metadata type, if any.
|
|
112
|
+
"""
|
|
113
|
+
return self._metadata
|
|
114
|
+
|
|
115
|
+
@metadata.setter
|
|
116
|
+
def metadata(self, metadata: object):
|
|
117
|
+
if metadata is None:
|
|
118
|
+
del self.metadata
|
|
119
|
+
return
|
|
120
|
+
if not isinstance(metadata, object):
|
|
121
|
+
raise TypeError('metadata must be of type object')
|
|
122
|
+
self._metadata = metadata
|
|
123
|
+
|
|
124
|
+
@property
|
|
125
|
+
def done(self) -> bool:
|
|
126
|
+
r"""
|
|
127
|
+
If the value is `false`, it means the operation is still in progress.
|
|
128
|
+
If `true`, the operation is completed, and either `error` or `response` is
|
|
129
|
+
available.
|
|
130
|
+
"""
|
|
131
|
+
return self._done
|
|
132
|
+
|
|
133
|
+
@done.setter
|
|
134
|
+
def done(self, done: bool):
|
|
135
|
+
if done is None:
|
|
136
|
+
del self.done
|
|
137
|
+
return
|
|
138
|
+
if not isinstance(done, bool):
|
|
139
|
+
raise TypeError('done must be of type bool')
|
|
140
|
+
self._done = done
|
|
141
|
+
|
|
142
|
+
@property
|
|
143
|
+
def error(self) -> Optional['Operation.Status']:
|
|
144
|
+
"""The error result of the operation in case of failure or cancellation."""
|
|
145
|
+
return self._error or None
|
|
146
|
+
|
|
147
|
+
@error.setter
|
|
148
|
+
def error(self, error: Optional['Operation.Status']):
|
|
149
|
+
if error is None:
|
|
150
|
+
del self.error
|
|
151
|
+
return
|
|
152
|
+
if not isinstance(error, Operation.Status):
|
|
153
|
+
raise TypeError('error must be of type Operation.Status')
|
|
154
|
+
del self.response
|
|
155
|
+
self._error = error
|
|
156
|
+
|
|
157
|
+
@property
|
|
158
|
+
def response(self) -> object:
|
|
159
|
+
r"""
|
|
160
|
+
The normal, successful response of the operation. If the original
|
|
161
|
+
method returns no data on success, such as `Delete`, the response is
|
|
162
|
+
`google.protobuf.Empty`. If the original method is standard
|
|
163
|
+
`Get`/`Create`/`Update`, the response should be the resource. For other
|
|
164
|
+
methods, the response should have the type `XxxResponse`, where `Xxx`
|
|
165
|
+
is the original method name. For example, if the original method name
|
|
166
|
+
is `TakeSnapshot()`, the inferred response type is
|
|
167
|
+
`TakeSnapshotResponse`.
|
|
168
|
+
"""
|
|
169
|
+
return self._response or None
|
|
170
|
+
|
|
171
|
+
@response.setter
|
|
172
|
+
def response(self, response: object):
|
|
173
|
+
if response is None:
|
|
174
|
+
del self.response
|
|
175
|
+
return
|
|
176
|
+
if not isinstance(response, object):
|
|
177
|
+
raise TypeError('response must be of type object')
|
|
178
|
+
del self.error
|
|
179
|
+
self._response = response
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
Operation.Status._fields = [
|
|
183
|
+
FieldMetadata("code", "code", "_code", int, 0, PredefinedSerializer()),
|
|
184
|
+
FieldMetadata("message", "message", "_message", str, "", PredefinedSerializer()),
|
|
185
|
+
]
|
|
186
|
+
|
|
187
|
+
Operation._fields = [
|
|
188
|
+
FieldMetadata("name", "name", "_name", str, "", PredefinedSerializer()),
|
|
189
|
+
FieldMetadata("metadata", "metadata", "_metadata", object, None, PredefinedSerializer()),
|
|
190
|
+
FieldMetadata("done", "done", "_done", bool, False, PredefinedSerializer()),
|
|
191
|
+
FieldMetadata("error", "error", "_error", Operation.Status, None, KaggleObjectSerializer(), optional=True),
|
|
192
|
+
FieldMetadata("response", "response", "_response", object, None, PredefinedSerializer(), optional=True),
|
|
193
|
+
]
|
|
194
|
+
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
from kagglesdk.kaggle_object import *
|
|
2
|
+
|
|
3
|
+
class GetOperationRequest(KaggleObject):
|
|
4
|
+
r"""
|
|
5
|
+
The request message for
|
|
6
|
+
[Operations.GetOperation][google.longrunning.Operations.GetOperation].
|
|
7
|
+
|
|
8
|
+
Attributes:
|
|
9
|
+
name (str)
|
|
10
|
+
The name of the operation resource.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self):
|
|
14
|
+
self._name = ""
|
|
15
|
+
self._freeze()
|
|
16
|
+
|
|
17
|
+
@property
|
|
18
|
+
def name(self) -> str:
|
|
19
|
+
"""The name of the operation resource."""
|
|
20
|
+
return self._name
|
|
21
|
+
|
|
22
|
+
@name.setter
|
|
23
|
+
def name(self, name: str):
|
|
24
|
+
if name is None:
|
|
25
|
+
del self.name
|
|
26
|
+
return
|
|
27
|
+
if not isinstance(name, str):
|
|
28
|
+
raise TypeError('name must be of type str')
|
|
29
|
+
self._name = name
|
|
30
|
+
|
|
31
|
+
def endpoint(self):
|
|
32
|
+
path = '/api/v1/operations/get'
|
|
33
|
+
return path.format_map(self.to_field_map(self))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@staticmethod
|
|
37
|
+
def method():
|
|
38
|
+
return 'POST'
|
|
39
|
+
|
|
40
|
+
@staticmethod
|
|
41
|
+
def body_fields():
|
|
42
|
+
return '*'
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
GetOperationRequest._fields = [
|
|
46
|
+
FieldMetadata("name", "name", "_name", str, "", PredefinedSerializer()),
|
|
47
|
+
]
|
|
48
|
+
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import enum
|
|
2
|
+
|
|
3
|
+
class ContentState(enum.Enum):
|
|
4
|
+
"""Keep synced with /Kaggle.Sdk/cloud/kaggle/moderation/sor.proto"""
|
|
5
|
+
CONTENT_STATE_UNSPECIFIED = 0
|
|
6
|
+
PENDING_CLASSIFICATION = 1
|
|
7
|
+
r"""
|
|
8
|
+
Awaiting abuse classification. This exists as a non-visible state prior to
|
|
9
|
+
classification.
|
|
10
|
+
"""
|
|
11
|
+
PUBLISHED = 2
|
|
12
|
+
r"""
|
|
13
|
+
Publicly viewable, although access may be restricted outside of its content
|
|
14
|
+
state.
|
|
15
|
+
"""
|
|
16
|
+
TEMPORARILY_QUARANTINED = 3
|
|
17
|
+
r"""
|
|
18
|
+
Quarantined by an admin or by the system. This means that the content is
|
|
19
|
+
only visible to the user and admins, however users are able to toggle their
|
|
20
|
+
content out of this state.
|
|
21
|
+
"""
|
|
22
|
+
PERMANENTLY_QUARANTINED = 4
|
|
23
|
+
r"""
|
|
24
|
+
Quarantined by an admin or by the system, the user cannot toggle their
|
|
25
|
+
content's state back to public.
|
|
26
|
+
"""
|
|
27
|
+
USER_DELETED = 5
|
|
28
|
+
"""Deleted by the user."""
|
|
29
|
+
SYSTEM_DELETED = 6
|
|
30
|
+
"""Deleted by an admin or by a system account."""
|
|
31
|
+
PENDING_PERMANENT_DELETE = 7
|
|
32
|
+
"""Awaiting hard deletion."""
|
|
33
|
+
DRAFT = 8
|
|
34
|
+
r"""
|
|
35
|
+
Initial state of entity that has never been previously published.
|
|
36
|
+
Unable to return back to Draft state once published.
|
|
37
|
+
State flow chart example: http://screen/8vDypV7HPeuHBFK
|
|
38
|
+
"""
|
|
39
|
+
UNPUBLISHED = 9
|
|
40
|
+
r"""
|
|
41
|
+
Intermediate stage that has either been upgraded from the Draft state or
|
|
42
|
+
downgraded from the Published state.
|
|
43
|
+
"""
|
|
44
|
+
|
|
@@ -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
|
+
|