kaggle 1.7.4.5__py3-none-any.whl → 1.8.2__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.2.dist-info}/METADATA +12 -15
- kaggle-1.8.2.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 +224 -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.2.dist-info}/WHEEL +0 -0
- {kaggle-1.7.4.5.dist-info → kaggle-1.8.2.dist-info}/entry_points.txt +0 -0
- {kaggle-1.7.4.5.dist-info → kaggle-1.8.2.dist-info}/licenses/LICENSE.txt +0 -0
- {kaggle/test → kagglesdk/benchmarks}/__init__.py +0 -0
|
@@ -23,120 +23,120 @@ import six
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
class StartBlobUploadResponse(object):
|
|
26
|
-
|
|
26
|
+
"""
|
|
27
27
|
Attributes:
|
|
28
28
|
project_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
|
-
project_types = {'token': 'str', 'create_url': 'str'}
|
|
34
|
-
|
|
35
|
-
attribute_map = {'token': 'token', 'create_url': 'createUrl'}
|
|
36
|
-
|
|
37
|
-
def __init__(self, token=None, create_url=None): # noqa: E501
|
|
38
|
-
"""StartBlobUploadResponse - a model defined in Swagger""" # noqa: E501
|
|
39
33
|
|
|
40
|
-
|
|
41
|
-
self._create_url = None
|
|
42
|
-
self.discriminator = None
|
|
34
|
+
project_types = {"token": "str", "create_url": "str"}
|
|
43
35
|
|
|
44
|
-
|
|
45
|
-
self.create_url = create_url
|
|
36
|
+
attribute_map = {"token": "token", "create_url": "createUrl"}
|
|
46
37
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"""Gets the token of this StartBlobUploadResponse. # noqa: E501.
|
|
38
|
+
def __init__(self, token=None, create_url=None): # noqa: E501
|
|
39
|
+
"""StartBlobUploadResponse - a model defined in Swagger""" # noqa: E501
|
|
50
40
|
|
|
51
|
-
|
|
52
|
-
|
|
41
|
+
self._token = None
|
|
42
|
+
self._create_url = None
|
|
43
|
+
self.discriminator = None
|
|
53
44
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"""
|
|
57
|
-
return self._token
|
|
58
|
-
|
|
59
|
-
@token.setter
|
|
60
|
-
def token(self, token):
|
|
61
|
-
"""Sets the token of this StartBlobUploadResponse.
|
|
45
|
+
self.token = token
|
|
46
|
+
self.create_url = create_url
|
|
62
47
|
|
|
63
|
-
|
|
64
|
-
|
|
48
|
+
@property
|
|
49
|
+
def token(self):
|
|
50
|
+
"""Gets the token of this StartBlobUploadResponse. # noqa: E501.
|
|
65
51
|
|
|
66
|
-
|
|
52
|
+
Opaque string token used to reference the new blob/file. # noqa:
|
|
67
53
|
E501
|
|
68
|
-
:type: str
|
|
69
|
-
"""
|
|
70
|
-
if token is None:
|
|
71
|
-
raise ValueError(
|
|
72
|
-
"Invalid value for `token`, must not be `None`") # noqa: E501
|
|
73
54
|
|
|
74
|
-
|
|
55
|
+
:return: The token of this StartBlobUploadResponse. # noqa: E501
|
|
56
|
+
:rtype: str
|
|
57
|
+
"""
|
|
58
|
+
return self._token
|
|
75
59
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
60
|
+
@token.setter
|
|
61
|
+
def token(self, token):
|
|
62
|
+
"""Sets the token of this StartBlobUploadResponse.
|
|
79
63
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
:return: The create_url of this StartBlobUploadResponse. # noqa:
|
|
64
|
+
Opaque string token used to reference the new blob/file. # noqa:
|
|
83
65
|
E501
|
|
84
|
-
:rtype: str
|
|
85
|
-
"""
|
|
86
|
-
return self._create_url
|
|
87
|
-
|
|
88
|
-
@create_url.setter
|
|
89
|
-
def create_url(self, create_url):
|
|
90
|
-
"""Sets the create_url of this StartBlobUploadResponse.
|
|
91
66
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
67
|
+
:param token: The token of this StartBlobUploadResponse. # noqa:
|
|
68
|
+
E501
|
|
69
|
+
:type: str
|
|
70
|
+
"""
|
|
71
|
+
if token is None:
|
|
72
|
+
raise ValueError("Invalid value for `token`, must not be `None`") # noqa: E501
|
|
73
|
+
|
|
74
|
+
self._token = token
|
|
75
|
+
|
|
76
|
+
@property
|
|
77
|
+
def create_url(self):
|
|
78
|
+
"""Gets the create_url of this StartBlobUploadResponse. # noqa: E501.
|
|
79
|
+
|
|
80
|
+
URL to use to start the upload. # noqa: E501
|
|
81
|
+
|
|
82
|
+
:return: The create_url of this StartBlobUploadResponse. # noqa:
|
|
83
|
+
E501
|
|
84
|
+
:rtype: str
|
|
85
|
+
"""
|
|
86
|
+
return self._create_url
|
|
87
|
+
|
|
88
|
+
@create_url.setter
|
|
89
|
+
def create_url(self, create_url):
|
|
90
|
+
"""Sets the create_url of this StartBlobUploadResponse.
|
|
91
|
+
|
|
92
|
+
URL to use to start the upload. # noqa: E501
|
|
93
|
+
|
|
94
|
+
:param create_url: The create_url of this StartBlobUploadResponse. #
|
|
95
|
+
noqa: E501
|
|
96
|
+
:type: str
|
|
97
|
+
"""
|
|
98
|
+
if create_url is None:
|
|
99
|
+
raise ValueError("Invalid value for `create_url`, must not be `None`") # noqa: E501
|
|
100
|
+
|
|
101
|
+
self._create_url = create_url
|
|
102
|
+
|
|
103
|
+
def to_dict(self):
|
|
104
|
+
"""Returns the model properties as a dict."""
|
|
105
|
+
result = {}
|
|
106
|
+
|
|
107
|
+
for attr, _ in six.iteritems(self.project_types):
|
|
108
|
+
value = getattr(self, attr)
|
|
109
|
+
if isinstance(value, list):
|
|
110
|
+
result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
|
|
111
|
+
elif hasattr(value, "to_dict"):
|
|
112
|
+
result[attr] = value.to_dict()
|
|
113
|
+
elif isinstance(value, dict):
|
|
114
|
+
result[attr] = dict(
|
|
115
|
+
map(
|
|
116
|
+
lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
|
|
117
|
+
value.items(),
|
|
118
|
+
)
|
|
119
|
+
)
|
|
120
|
+
else:
|
|
121
|
+
result[attr] = value
|
|
122
|
+
|
|
123
|
+
return result
|
|
124
|
+
|
|
125
|
+
def to_str(self):
|
|
126
|
+
"""Returns the string representation of the model."""
|
|
127
|
+
return pprint.pformat(self.to_dict())
|
|
128
|
+
|
|
129
|
+
def __repr__(self):
|
|
130
|
+
"""For `print` and `pprint`"""
|
|
131
|
+
return self.to_str()
|
|
132
|
+
|
|
133
|
+
def __eq__(self, other):
|
|
134
|
+
"""Returns true if both objects are equal."""
|
|
135
|
+
if not isinstance(other, StartBlobUploadResponse):
|
|
136
|
+
return False
|
|
137
|
+
|
|
138
|
+
return self.__dict__ == other.__dict__
|
|
139
|
+
|
|
140
|
+
def __ne__(self, other):
|
|
141
|
+
"""Returns true if both objects are not equal."""
|
|
142
|
+
return not self == other
|
kaggle/models/upload_file.py
CHANGED
|
@@ -25,147 +25,141 @@ from kaggle.models.dataset_column import DatasetColumn # noqa: F401,E501
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
class UploadFile(object):
|
|
28
|
-
|
|
28
|
+
"""
|
|
29
29
|
Attributes:
|
|
30
30
|
column_types (dict): The key is attribute name
|
|
31
31
|
and the value is attribute type.
|
|
32
32
|
attribute_map (dict): The key is attribute name
|
|
33
33
|
and the value is json key in definition.
|
|
34
34
|
"""
|
|
35
|
-
column_types = {
|
|
36
|
-
'token': 'str',
|
|
37
|
-
'description': 'str',
|
|
38
|
-
'columns': 'list[DatasetColumn]'
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
attribute_map = {
|
|
42
|
-
'token': 'token',
|
|
43
|
-
'description': 'description',
|
|
44
|
-
'columns': 'columns'
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
def __init__(self, token=None, description=None, columns=None): # noqa: E501
|
|
48
|
-
"""UploadFile - a model defined in Swagger""" # noqa: E501
|
|
49
|
-
|
|
50
|
-
self._token = None
|
|
51
|
-
self._description = None
|
|
52
|
-
self._columns = None
|
|
53
|
-
self.discriminator = None
|
|
54
|
-
|
|
55
|
-
if token is not None:
|
|
56
|
-
self.token = token
|
|
57
|
-
if description is not None:
|
|
58
|
-
self.description = description
|
|
59
|
-
if columns is not None:
|
|
60
|
-
self.columns = columns
|
|
61
|
-
|
|
62
|
-
@property
|
|
63
|
-
def token(self):
|
|
64
|
-
"""Gets the token of this UploadFile. # noqa: E501.
|
|
65
|
-
|
|
66
|
-
A token referencing a specific file upload that can be used across
|
|
67
|
-
requests # noqa: E501
|
|
68
|
-
|
|
69
|
-
:return: The token of this UploadFile. # noqa: E501
|
|
70
|
-
:rtype: str
|
|
71
|
-
"""
|
|
72
|
-
return self._token
|
|
73
35
|
|
|
74
|
-
|
|
75
|
-
def token(self, token):
|
|
76
|
-
"""Sets the token of this UploadFile.
|
|
36
|
+
column_types = {"token": "str", "description": "str", "columns": "list[DatasetColumn]"}
|
|
77
37
|
|
|
78
|
-
|
|
79
|
-
requests # noqa: E501
|
|
38
|
+
attribute_map = {"token": "token", "description": "description", "columns": "columns"}
|
|
80
39
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"""
|
|
40
|
+
def __init__(self, token=None, description=None, columns=None): # noqa: E501
|
|
41
|
+
"""UploadFile - a model defined in Swagger""" # noqa: E501
|
|
84
42
|
|
|
85
|
-
|
|
43
|
+
self._token = None
|
|
44
|
+
self._description = None
|
|
45
|
+
self._columns = None
|
|
46
|
+
self.discriminator = None
|
|
86
47
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
48
|
+
if token is not None:
|
|
49
|
+
self.token = token
|
|
50
|
+
if description is not None:
|
|
51
|
+
self.description = description
|
|
52
|
+
if columns is not None:
|
|
53
|
+
self.columns = columns
|
|
90
54
|
|
|
91
|
-
|
|
55
|
+
@property
|
|
56
|
+
def token(self):
|
|
57
|
+
"""Gets the token of this UploadFile. # noqa: E501.
|
|
92
58
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
"""
|
|
96
|
-
return self._description
|
|
59
|
+
A token referencing a specific file upload that can be used across
|
|
60
|
+
requests # noqa: E501
|
|
97
61
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
62
|
+
:return: The token of this UploadFile. # noqa: E501
|
|
63
|
+
:rtype: str
|
|
64
|
+
"""
|
|
65
|
+
return self._token
|
|
101
66
|
|
|
102
|
-
|
|
67
|
+
@token.setter
|
|
68
|
+
def token(self, token):
|
|
69
|
+
"""Sets the token of this UploadFile.
|
|
103
70
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
"""
|
|
71
|
+
A token referencing a specific file upload that can be used across
|
|
72
|
+
requests # noqa: E501
|
|
107
73
|
|
|
108
|
-
|
|
74
|
+
:param token: The token of this UploadFile. # noqa: E501
|
|
75
|
+
:type: str
|
|
76
|
+
"""
|
|
109
77
|
|
|
110
|
-
|
|
111
|
-
def columns(self):
|
|
112
|
-
"""Gets the columns of this UploadFile. # noqa: E501.
|
|
78
|
+
self._token = token
|
|
113
79
|
|
|
114
|
-
|
|
80
|
+
@property
|
|
81
|
+
def description(self):
|
|
82
|
+
"""Gets the description of this UploadFile. # noqa: E501.
|
|
115
83
|
|
|
116
|
-
|
|
117
|
-
:rtype: list[DatasetColumn]
|
|
118
|
-
"""
|
|
119
|
-
return self._columns
|
|
84
|
+
The file description # noqa: E501
|
|
120
85
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
86
|
+
:return: The description of this UploadFile. # noqa: E501
|
|
87
|
+
:rtype: str
|
|
88
|
+
"""
|
|
89
|
+
return self._description
|
|
124
90
|
|
|
125
|
-
|
|
91
|
+
@description.setter
|
|
92
|
+
def description(self, description):
|
|
93
|
+
"""Sets the description of this UploadFile.
|
|
126
94
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
95
|
+
The file description # noqa: E501
|
|
96
|
+
|
|
97
|
+
:param description: The description of this UploadFile. # noqa: E501
|
|
98
|
+
:type: str
|
|
99
|
+
"""
|
|
100
|
+
|
|
101
|
+
self._description = description
|
|
102
|
+
|
|
103
|
+
@property
|
|
104
|
+
def columns(self):
|
|
105
|
+
"""Gets the columns of this UploadFile. # noqa: E501.
|
|
106
|
+
|
|
107
|
+
A list of dataset column metadata # noqa: E501
|
|
108
|
+
|
|
109
|
+
:return: The columns of this UploadFile. # noqa: E501
|
|
110
|
+
:rtype: list[DatasetColumn]
|
|
111
|
+
"""
|
|
112
|
+
return self._columns
|
|
113
|
+
|
|
114
|
+
@columns.setter
|
|
115
|
+
def columns(self, columns):
|
|
116
|
+
"""Sets the columns of this UploadFile.
|
|
117
|
+
|
|
118
|
+
A list of dataset column metadata # noqa: E501
|
|
119
|
+
|
|
120
|
+
:param columns: The columns of this UploadFile. # noqa: E501
|
|
121
|
+
:type: list[DatasetColumn]
|
|
122
|
+
"""
|
|
123
|
+
|
|
124
|
+
self._columns = columns
|
|
125
|
+
|
|
126
|
+
def to_dict(self):
|
|
127
|
+
"""Returns the model properties as a dict."""
|
|
128
|
+
result = {}
|
|
129
|
+
|
|
130
|
+
for attr, _ in six.iteritems(self.column_types):
|
|
131
|
+
value = getattr(self, attr)
|
|
132
|
+
if isinstance(value, list):
|
|
133
|
+
result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
|
|
134
|
+
elif hasattr(value, "to_dict"):
|
|
135
|
+
result[attr] = value.to_dict()
|
|
136
|
+
elif isinstance(value, dict):
|
|
137
|
+
result[attr] = dict(
|
|
138
|
+
map(
|
|
139
|
+
lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
|
|
140
|
+
value.items(),
|
|
141
|
+
)
|
|
142
|
+
)
|
|
143
|
+
else:
|
|
144
|
+
result[attr] = value
|
|
145
|
+
|
|
146
|
+
return result
|
|
147
|
+
|
|
148
|
+
def to_str(self):
|
|
149
|
+
"""Returns the string representation of the model."""
|
|
150
|
+
return pprint.pformat(self.to_dict())
|
|
151
|
+
|
|
152
|
+
def __repr__(self):
|
|
153
|
+
"""For `print` and `pprint`"""
|
|
154
|
+
return self.to_str()
|
|
155
|
+
|
|
156
|
+
def __eq__(self, other):
|
|
157
|
+
"""Returns true if both objects are equal."""
|
|
158
|
+
if not isinstance(other, UploadFile):
|
|
159
|
+
return False
|
|
160
|
+
|
|
161
|
+
return self.__dict__ == other.__dict__
|
|
130
162
|
|
|
131
|
-
self
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
"""Returns the model properties as a dict."""
|
|
135
|
-
result = {}
|
|
136
|
-
|
|
137
|
-
for attr, _ in six.iteritems(self.column_types):
|
|
138
|
-
value = getattr(self, attr)
|
|
139
|
-
if isinstance(value, list):
|
|
140
|
-
result[attr] = list(
|
|
141
|
-
map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
|
|
142
|
-
elif hasattr(value, "to_dict"):
|
|
143
|
-
result[attr] = value.to_dict()
|
|
144
|
-
elif isinstance(value, dict):
|
|
145
|
-
result[attr] = dict(
|
|
146
|
-
map(
|
|
147
|
-
lambda item: (item[0], item[1].to_dict())
|
|
148
|
-
if hasattr(item[1], "to_dict") else item, value.items()))
|
|
149
|
-
else:
|
|
150
|
-
result[attr] = value
|
|
151
|
-
|
|
152
|
-
return result
|
|
153
|
-
|
|
154
|
-
def to_str(self):
|
|
155
|
-
"""Returns the string representation of the model."""
|
|
156
|
-
return pprint.pformat(self.to_dict())
|
|
157
|
-
|
|
158
|
-
def __repr__(self):
|
|
159
|
-
"""For `print` and `pprint`"""
|
|
160
|
-
return self.to_str()
|
|
161
|
-
|
|
162
|
-
def __eq__(self, other):
|
|
163
|
-
"""Returns true if both objects are equal."""
|
|
164
|
-
if not isinstance(other, UploadFile):
|
|
165
|
-
return False
|
|
166
|
-
|
|
167
|
-
return self.__dict__ == other.__dict__
|
|
168
|
-
|
|
169
|
-
def __ne__(self, other):
|
|
170
|
-
"""Returns true if both objects are not equal."""
|
|
171
|
-
return not self == other
|
|
163
|
+
def __ne__(self, other):
|
|
164
|
+
"""Returns true if both objects are not equal."""
|
|
165
|
+
return not self == other
|
kaggle/test/test_authenticate.py
CHANGED
|
@@ -8,36 +8,36 @@ import unittest
|
|
|
8
8
|
|
|
9
9
|
class TestAuthenticate(unittest.TestCase):
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
def setUp(self):
|
|
12
|
+
print("setup class:%s" % self)
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
def tearDown(self):
|
|
15
|
+
print("teardown class:TestStuff")
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
# Environment
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
def test_environment_variables(self):
|
|
20
|
+
os.environ["KAGGLE_USERNAME"] = "dinosaur"
|
|
21
|
+
os.environ["KAGGLE_KEY"] = "xxxxxxxxxxxx"
|
|
22
|
+
api = KaggleApi()
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
# We haven't authenticated yet
|
|
25
|
+
self.assertTrue("key" not in api.config_values)
|
|
26
|
+
self.assertTrue("username" not in api.config_values)
|
|
27
|
+
api.authenticate()
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
# Should be set from the environment
|
|
30
|
+
self.assertEqual(api.config_values["key"], "xxxxxxxxxxxx")
|
|
31
|
+
self.assertEqual(api.config_values["username"], "dinosaur")
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
# Configuration Actions
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
def test_config_actions(self):
|
|
36
|
+
api = KaggleApi()
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
self.assertTrue(api.config_dir.endswith("kaggle"))
|
|
39
|
+
self.assertEqual(api.get_config_value("doesntexist"), None)
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
if __name__ ==
|
|
43
|
-
|
|
42
|
+
if __name__ == "__main__":
|
|
43
|
+
unittest.main()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kaggle
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.8.2
|
|
4
4
|
Summary: Access Kaggle resources anywhere
|
|
5
5
|
Project-URL: Homepage, https://github.com/Kaggle/kaggle-api
|
|
6
6
|
Project-URL: Issues, https://github.com/Kaggle/kaggle-api/issues
|
|
@@ -211,21 +211,21 @@ Keywords: API,Kaggle
|
|
|
211
211
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
212
212
|
Classifier: Operating System :: OS Independent
|
|
213
213
|
Classifier: Programming Language :: Python :: 3
|
|
214
|
-
Requires-Python: >=3.
|
|
214
|
+
Requires-Python: >=3.11
|
|
215
|
+
Requires-Dist: black>=24.10.0
|
|
215
216
|
Requires-Dist: bleach
|
|
216
|
-
Requires-Dist:
|
|
217
|
-
Requires-Dist:
|
|
218
|
-
Requires-Dist: idna
|
|
217
|
+
Requires-Dist: kagglesdk
|
|
218
|
+
Requires-Dist: mypy>=1.15.0
|
|
219
219
|
Requires-Dist: protobuf
|
|
220
|
-
Requires-Dist: python-dateutil
|
|
220
|
+
Requires-Dist: python-dateutil
|
|
221
221
|
Requires-Dist: python-slugify
|
|
222
222
|
Requires-Dist: requests
|
|
223
223
|
Requires-Dist: setuptools>=21.0.0
|
|
224
224
|
Requires-Dist: six>=1.10
|
|
225
|
-
Requires-Dist: text-unidecode
|
|
226
225
|
Requires-Dist: tqdm
|
|
226
|
+
Requires-Dist: types-requests
|
|
227
|
+
Requires-Dist: types-tqdm
|
|
227
228
|
Requires-Dist: urllib3>=1.15.1
|
|
228
|
-
Requires-Dist: webencodings
|
|
229
229
|
Description-Content-Type: text/markdown
|
|
230
230
|
|
|
231
231
|
# Kaggle API
|
|
@@ -253,13 +253,6 @@ or adding to those services, you should be working in your Kaggle mid-tier devel
|
|
|
253
253
|
environment. You'll run Kaggle locally, in the container, and test the Python code by
|
|
254
254
|
running it in the container so it can connect to your local testing environment.
|
|
255
255
|
|
|
256
|
-
Also, run the following command to get `autogen.sh` installed:
|
|
257
|
-
```bash
|
|
258
|
-
rm -rf /tmp/autogen && mkdir -p /tmp/autogen && unzip -qo /tmp/autogen.zip -d /tmp/autogen &&
|
|
259
|
-
mv /tmp/autogen/autogen-*/* /tmp/autogen && rm -rf /tmp/autogen/autogen-* &&
|
|
260
|
-
sudo chmod a+rx /tmp/autogen/autogen.sh
|
|
261
|
-
```
|
|
262
|
-
|
|
263
256
|
### Prerequisites
|
|
264
257
|
|
|
265
258
|
We use [hatch](https://hatch.pypa.io) to manage this project.
|
|
@@ -287,6 +280,10 @@ All the changes must be done in the `src/` directory.
|
|
|
287
280
|
|
|
288
281
|
### Run
|
|
289
282
|
|
|
283
|
+
Use `hatch run install` to compile the program and install it in the default `hatch` environment.
|
|
284
|
+
To run that version locally for testing, use hatch: `hatch run kaggle -v`. If you'd rather not
|
|
285
|
+
type `hatch run` every time, launch a new shell in the hatch environment: `hatch shell`.
|
|
286
|
+
|
|
290
287
|
You can also run the code in python directly:
|
|
291
288
|
|
|
292
289
|
```sh
|