kaggle 1.8.2__py3-none-any.whl → 1.8.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kaggle/__init__.py +1 -1
- kaggle/api/kaggle_api_extended.py +206 -75
- kaggle/cli.py +36 -28
- kaggle/models/upload_file.py +4 -4
- {kaggle-1.8.2.dist-info → kaggle-1.8.4.dist-info}/METADATA +66 -75
- kaggle-1.8.4.dist-info/RECORD +15 -0
- {kaggle-1.8.2.dist-info → kaggle-1.8.4.dist-info}/WHEEL +1 -1
- kaggle/models/api_blob_type.py +0 -4
- kaggle/models/dataset_column.py +0 -228
- kaggle/models/dataset_new_request.py +0 -443
- kaggle/models/dataset_new_version_request.py +0 -319
- kaggle/models/dataset_update_settings_request.py +0 -344
- kaggle/models/kernel_push_request.py +0 -608
- kaggle/models/model_instance_new_version_request.py +0 -145
- kaggle/models/model_instance_update_request.py +0 -451
- kaggle/models/model_new_instance_request.py +0 -552
- kaggle/models/model_new_request.py +0 -329
- kaggle/models/model_update_request.py +0 -300
- kaggle/models/start_blob_upload_request.py +0 -240
- kaggle/models/start_blob_upload_response.py +0 -142
- kaggle-1.8.2.dist-info/RECORD +0 -148
- kagglesdk/LICENSE +0 -201
- kagglesdk/__init__.py +0 -6
- kagglesdk/admin/__init__.py +0 -0
- kagglesdk/admin/services/__init__.py +0 -0
- kagglesdk/admin/services/inbox_file_service.py +0 -22
- kagglesdk/admin/types/__init__.py +0 -0
- kagglesdk/admin/types/inbox_file_service.py +0 -74
- kagglesdk/benchmarks/__init__.py +0 -0
- kagglesdk/benchmarks/services/__init__.py +0 -0
- kagglesdk/benchmarks/services/benchmarks_api_service.py +0 -19
- kagglesdk/benchmarks/types/__init__.py +0 -0
- kagglesdk/benchmarks/types/benchmark_types.py +0 -307
- kagglesdk/benchmarks/types/benchmarks_api_service.py +0 -243
- kagglesdk/blobs/__init__.py +0 -0
- kagglesdk/blobs/services/__init__.py +0 -0
- kagglesdk/blobs/services/blob_api_service.py +0 -25
- kagglesdk/blobs/types/__init__.py +0 -0
- kagglesdk/blobs/types/blob_api_service.py +0 -177
- kagglesdk/common/__init__.py +0 -0
- kagglesdk/common/services/__init__.py +0 -0
- kagglesdk/common/services/operations_service.py +0 -46
- kagglesdk/common/types/__init__.py +0 -0
- kagglesdk/common/types/file_download.py +0 -102
- kagglesdk/common/types/http_redirect.py +0 -105
- kagglesdk/common/types/operations.py +0 -194
- kagglesdk/common/types/operations_service.py +0 -48
- kagglesdk/community/__init__.py +0 -0
- kagglesdk/community/types/__init__.py +0 -0
- kagglesdk/community/types/content_enums.py +0 -44
- kagglesdk/community/types/organization.py +0 -410
- kagglesdk/competitions/__init__.py +0 -0
- kagglesdk/competitions/services/__init__.py +0 -0
- kagglesdk/competitions/services/competition_api_service.py +0 -178
- kagglesdk/competitions/types/__init__.py +0 -0
- kagglesdk/competitions/types/competition.py +0 -14
- kagglesdk/competitions/types/competition_api_service.py +0 -2393
- kagglesdk/competitions/types/competition_enums.py +0 -53
- kagglesdk/competitions/types/search_competitions.py +0 -28
- kagglesdk/competitions/types/submission_status.py +0 -9
- kagglesdk/datasets/__init__.py +0 -0
- kagglesdk/datasets/databundles/__init__.py +0 -0
- kagglesdk/datasets/databundles/types/__init__.py +0 -0
- kagglesdk/datasets/databundles/types/databundle_api_types.py +0 -540
- kagglesdk/datasets/services/__init__.py +0 -0
- kagglesdk/datasets/services/dataset_api_service.py +0 -195
- kagglesdk/datasets/types/__init__.py +0 -0
- kagglesdk/datasets/types/dataset_api_service.py +0 -3047
- kagglesdk/datasets/types/dataset_enums.py +0 -103
- kagglesdk/datasets/types/dataset_service.py +0 -145
- kagglesdk/datasets/types/dataset_types.py +0 -646
- kagglesdk/datasets/types/search_datasets.py +0 -6
- kagglesdk/discussions/__init__.py +0 -0
- kagglesdk/discussions/types/__init__.py +0 -0
- kagglesdk/discussions/types/search_discussions.py +0 -43
- kagglesdk/discussions/types/writeup_enums.py +0 -11
- kagglesdk/education/__init__.py +0 -0
- kagglesdk/education/services/__init__.py +0 -0
- kagglesdk/education/services/education_api_service.py +0 -19
- kagglesdk/education/types/__init__.py +0 -0
- kagglesdk/education/types/education_api_service.py +0 -248
- kagglesdk/education/types/education_service.py +0 -139
- kagglesdk/kaggle_client.py +0 -101
- kagglesdk/kaggle_creds.py +0 -148
- kagglesdk/kaggle_env.py +0 -104
- kagglesdk/kaggle_http_client.py +0 -269
- kagglesdk/kaggle_oauth.py +0 -200
- kagglesdk/kaggle_object.py +0 -344
- kagglesdk/kernels/__init__.py +0 -0
- kagglesdk/kernels/services/__init__.py +0 -0
- kagglesdk/kernels/services/kernels_api_service.py +0 -146
- kagglesdk/kernels/types/__init__.py +0 -0
- kagglesdk/kernels/types/kernels_api_service.py +0 -2451
- kagglesdk/kernels/types/kernels_enums.py +0 -39
- kagglesdk/kernels/types/search_kernels.py +0 -6
- kagglesdk/licenses/__init__.py +0 -0
- kagglesdk/licenses/types/__init__.py +0 -0
- kagglesdk/licenses/types/licenses_types.py +0 -182
- kagglesdk/models/__init__.py +0 -0
- kagglesdk/models/services/__init__.py +0 -0
- kagglesdk/models/services/model_api_service.py +0 -280
- kagglesdk/models/services/model_service.py +0 -19
- kagglesdk/models/types/__init__.py +0 -0
- kagglesdk/models/types/model_api_service.py +0 -4069
- kagglesdk/models/types/model_enums.py +0 -68
- kagglesdk/models/types/model_service.py +0 -275
- kagglesdk/models/types/model_types.py +0 -1338
- kagglesdk/models/types/search_models.py +0 -8
- kagglesdk/search/__init__.py +0 -0
- kagglesdk/search/services/__init__.py +0 -0
- kagglesdk/search/services/search_api_service.py +0 -19
- kagglesdk/search/types/__init__.py +0 -0
- kagglesdk/search/types/search_api_service.py +0 -2435
- kagglesdk/search/types/search_content_shared.py +0 -50
- kagglesdk/search/types/search_enums.py +0 -45
- kagglesdk/search/types/search_service.py +0 -303
- kagglesdk/security/__init__.py +0 -0
- kagglesdk/security/services/__init__.py +0 -0
- kagglesdk/security/services/iam_service.py +0 -31
- kagglesdk/security/services/oauth_service.py +0 -58
- kagglesdk/security/types/__init__.py +0 -0
- kagglesdk/security/types/authentication.py +0 -171
- kagglesdk/security/types/iam_service.py +0 -496
- kagglesdk/security/types/oauth_service.py +0 -1181
- kagglesdk/security/types/roles.py +0 -8
- kagglesdk/security/types/security_types.py +0 -159
- kagglesdk/test/__init__.py +0 -0
- kagglesdk/test/test_client.py +0 -41
- kagglesdk/users/__init__.py +0 -0
- kagglesdk/users/services/__init__.py +0 -0
- kagglesdk/users/services/account_service.py +0 -31
- kagglesdk/users/services/group_api_service.py +0 -31
- kagglesdk/users/types/__init__.py +0 -0
- kagglesdk/users/types/account_service.py +0 -345
- kagglesdk/users/types/group_api_service.py +0 -315
- kagglesdk/users/types/group_types.py +0 -165
- kagglesdk/users/types/groups_enum.py +0 -8
- kagglesdk/users/types/progression_service.py +0 -9
- kagglesdk/users/types/search_users.py +0 -23
- kagglesdk/users/types/user_avatar.py +0 -226
- kagglesdk/users/types/users_enums.py +0 -22
- {kaggle-1.8.2.dist-info → kaggle-1.8.4.dist-info}/entry_points.txt +0 -0
- {kaggle-1.8.2.dist-info → kaggle-1.8.4.dist-info}/licenses/LICENSE.txt +0 -0
kaggle/cli.py
CHANGED
|
@@ -35,8 +35,8 @@ def main() -> None:
|
|
|
35
35
|
"-v",
|
|
36
36
|
"--version",
|
|
37
37
|
action="version",
|
|
38
|
-
help="Print the Kaggle
|
|
39
|
-
version="Kaggle
|
|
38
|
+
help="Print the Kaggle CLI version",
|
|
39
|
+
version="Kaggle CLI " + kaggle.__version__,
|
|
40
40
|
)
|
|
41
41
|
parser.add_argument(
|
|
42
42
|
"-W",
|
|
@@ -550,6 +550,7 @@ def parse_kernels(subparsers) -> None:
|
|
|
550
550
|
parser_kernels_push_optional.add_argument(
|
|
551
551
|
"-t", "--timeout", type=int, dest="timeout", help=Help.param_kernel_timeout
|
|
552
552
|
)
|
|
553
|
+
parser_kernels_push_optional.add_argument("--accelerator", dest="acc", help=Help.param_kernel_acc)
|
|
553
554
|
parser_kernels_push._action_groups.append(parser_kernels_push_optional)
|
|
554
555
|
parser_kernels_push.set_defaults(func=api.kernels_push_cli)
|
|
555
556
|
|
|
@@ -592,6 +593,9 @@ def parse_kernels(subparsers) -> None:
|
|
|
592
593
|
parser_kernels_output_optional.add_argument(
|
|
593
594
|
"-q", "--quiet", dest="quiet", action="store_true", required=False, help=Help.param_quiet
|
|
594
595
|
)
|
|
596
|
+
parser_kernels_output_optional.add_argument(
|
|
597
|
+
"--file-pattern", dest="file_pattern", required=False, help=Help.param_kernel_output_file_pattern
|
|
598
|
+
)
|
|
595
599
|
parser_kernels_output._action_groups.append(parser_kernels_output_optional)
|
|
596
600
|
parser_kernels_output.set_defaults(func=api.kernels_output_cli)
|
|
597
601
|
|
|
@@ -1083,9 +1087,9 @@ class Help(object):
|
|
|
1083
1087
|
+ ", ".join(kernels_choices)
|
|
1084
1088
|
+ "}\nmodels {"
|
|
1085
1089
|
+ ", ".join(models_choices)
|
|
1086
|
-
+ "}\nmodels
|
|
1090
|
+
+ "}\nmodels variations {"
|
|
1087
1091
|
+ ", ".join(model_instances_choices)
|
|
1088
|
-
+ "}\nmodels
|
|
1092
|
+
+ "}\nmodels variations versions {"
|
|
1089
1093
|
+ ", ".join(model_instance_versions_choices)
|
|
1090
1094
|
+ "}\nconfig {"
|
|
1091
1095
|
+ ", ".join(config_choices)
|
|
@@ -1098,8 +1102,8 @@ class Help(object):
|
|
|
1098
1102
|
group_datasets = "Commands related to Kaggle datasets"
|
|
1099
1103
|
group_kernels = "Commands related to Kaggle kernels"
|
|
1100
1104
|
group_models = "Commands related to Kaggle models"
|
|
1101
|
-
group_model_instances = "Commands related to Kaggle model
|
|
1102
|
-
group_model_instance_versions = "Commands related to Kaggle model
|
|
1105
|
+
group_model_instances = "Commands related to Kaggle model variations"
|
|
1106
|
+
group_model_instance_versions = "Commands related to Kaggle model variations versions"
|
|
1103
1107
|
group_files = "Commands related files"
|
|
1104
1108
|
group_config = "Configuration settings"
|
|
1105
1109
|
group_auth = "Commands related to authentication"
|
|
@@ -1174,7 +1178,7 @@ class Help(object):
|
|
|
1174
1178
|
"File for upload (full path), or the name of the output file produced by a kernel (for code competitions)"
|
|
1175
1179
|
)
|
|
1176
1180
|
param_code_kernel = "Name of kernel (notebook) to submit to a code competition"
|
|
1177
|
-
param_code_version = 'Version of kernel to submit to a code competition, e.g. "
|
|
1181
|
+
param_code_version = 'Version of kernel to submit to a code competition, e.g. "3"'
|
|
1178
1182
|
param_csv = "Print results in CSV format (if not set print in table format)"
|
|
1179
1183
|
param_page = "Page number for results paging. Page size is 20 by default"
|
|
1180
1184
|
# NOTE: Default and max page size are set by the mid-tier code.
|
|
@@ -1226,7 +1230,7 @@ class Help(object):
|
|
|
1226
1230
|
param_dataset_upfile = (
|
|
1227
1231
|
"Folder for upload, containing data files and a "
|
|
1228
1232
|
"special datasets-metadata.json file "
|
|
1229
|
-
"(https://github.com/Kaggle/kaggle-
|
|
1233
|
+
"(https://github.com/Kaggle/kaggle-cli/blob/main/docs/datasets_metadata.md). "
|
|
1230
1234
|
"Defaults to current working directory"
|
|
1231
1235
|
)
|
|
1232
1236
|
param_dataset_sort_by = (
|
|
@@ -1258,7 +1262,7 @@ class Help(object):
|
|
|
1258
1262
|
param_kernel_upfile = (
|
|
1259
1263
|
"Folder for upload, containing data files and a "
|
|
1260
1264
|
"special kernel-metadata.json file "
|
|
1261
|
-
"(https://github.com/Kaggle/kaggle-
|
|
1265
|
+
"(https://github.com/Kaggle/kaggle-cli/blob/main/docs/kernels_metadata.md). "
|
|
1262
1266
|
"Defaults to current working directory"
|
|
1263
1267
|
)
|
|
1264
1268
|
param_kernel_parent = "Find children of the specified parent kernel"
|
|
@@ -1293,6 +1297,10 @@ class Help(object):
|
|
|
1293
1297
|
"is only applicable if a search term is specified."
|
|
1294
1298
|
)
|
|
1295
1299
|
param_kernel_pull_metadata = "Generate metadata when pulling kernel"
|
|
1300
|
+
param_kernel_output_file_pattern = (
|
|
1301
|
+
"Regex pattern to match against filenames. Only files matching the pattern will be downloaded."
|
|
1302
|
+
)
|
|
1303
|
+
param_kernel_acc = "Specify the type of accelerator to use for the kernel run"
|
|
1296
1304
|
|
|
1297
1305
|
# Models params
|
|
1298
1306
|
param_model = "Model URL suffix in format <owner>/<model-name>"
|
|
@@ -1303,47 +1311,47 @@ class Help(object):
|
|
|
1303
1311
|
param_model_owner = "Find public models owned by a specific user or organization"
|
|
1304
1312
|
param_model_downfile = (
|
|
1305
1313
|
"Folder containing the special model-metadata.json file "
|
|
1306
|
-
"(https://github.com/Kaggle/kaggle-
|
|
1314
|
+
"(https://github.com/Kaggle/kaggle-cli/blob/main/docs/models_metadata.md)."
|
|
1307
1315
|
)
|
|
1308
1316
|
param_model_upfile = (
|
|
1309
1317
|
"Folder containing the special model-metadata.json file "
|
|
1310
|
-
"(https://github.com/Kaggle/kaggle-
|
|
1318
|
+
"(https://github.com/Kaggle/kaggle-cli/blob/main/docs/models_metadata.md). "
|
|
1311
1319
|
"Defaults to current working directory"
|
|
1312
1320
|
)
|
|
1313
1321
|
|
|
1314
1322
|
# Model Instances params
|
|
1315
|
-
param_model_instance = "Model
|
|
1316
|
-
command_model_instances_get = "Get a model
|
|
1317
|
-
command_model_instances_init = "Initialize metadata file for model
|
|
1318
|
-
command_model_instances_files = "List files for the current version of a model
|
|
1319
|
-
command_model_instances_list = "List
|
|
1320
|
-
command_model_instances_new = "Create a new model
|
|
1323
|
+
param_model_instance = "Model variation URL suffix in format <owner>/<model-name>/<framework>/<instance-slug>"
|
|
1324
|
+
command_model_instances_get = "Get a model variation"
|
|
1325
|
+
command_model_instances_init = "Initialize metadata file for model variation creation"
|
|
1326
|
+
command_model_instances_files = "List files for the current version of a model variation"
|
|
1327
|
+
command_model_instances_list = "List variations of a model"
|
|
1328
|
+
command_model_instances_new = "Create a new model variation"
|
|
1321
1329
|
param_model_instance_downfile = (
|
|
1322
1330
|
"Folder for downloading the special model-instance-metadata.json file "
|
|
1323
|
-
"(https://github.com/Kaggle/kaggle-
|
|
1331
|
+
"(https://github.com/Kaggle/kaggle-cli/blob/main/docs/models_metadata.md#model-instance). "
|
|
1324
1332
|
)
|
|
1325
1333
|
param_model_instance_upfile = (
|
|
1326
1334
|
"Folder for upload, containing data files and a "
|
|
1327
1335
|
"special model-instance-metadata.json file "
|
|
1328
|
-
"(https://github.com/Kaggle/kaggle-
|
|
1336
|
+
"(https://github.com/Kaggle/kaggle-cli/blob/main/docs/models_metadata.md#model-instance). "
|
|
1329
1337
|
"Defaults to current working directory"
|
|
1330
1338
|
)
|
|
1331
|
-
command_model_instances_delete = "Delete a model
|
|
1332
|
-
command_model_instances_update = "Update a model
|
|
1339
|
+
command_model_instances_delete = "Delete a model variation"
|
|
1340
|
+
command_model_instances_update = "Update a model variation"
|
|
1333
1341
|
|
|
1334
1342
|
# Model Instance Versions params
|
|
1335
1343
|
param_model_instance_version = (
|
|
1336
|
-
"Model
|
|
1344
|
+
"Model variation version URL suffix in format <owner>/<model-name>/<framework>/<variation-slug>/<version-number>"
|
|
1337
1345
|
)
|
|
1338
1346
|
|
|
1339
1347
|
# Model Instance Versions params
|
|
1340
|
-
command_model_instance_versions_new = "Create a new model
|
|
1348
|
+
command_model_instance_versions_new = "Create a new model variation version"
|
|
1341
1349
|
param_model_instance_version_upfile = "Folder for upload. Defaults to current working directory"
|
|
1342
|
-
command_model_instance_versions_delete = "Delete a model
|
|
1343
|
-
command_model_instance_versions_download = "Download model
|
|
1344
|
-
command_model_instance_versions_files = "List model
|
|
1345
|
-
command_model_instance_versions_list = "List model
|
|
1346
|
-
param_model_instance_version_notes = "Version notes to record for the new model
|
|
1350
|
+
command_model_instance_versions_delete = "Delete a model variation version"
|
|
1351
|
+
command_model_instance_versions_download = "Download model variation version files"
|
|
1352
|
+
command_model_instance_versions_files = "List model variation version files"
|
|
1353
|
+
command_model_instance_versions_list = "List model variation versions"
|
|
1354
|
+
param_model_instance_version_notes = "Version notes to record for the new model variation version"
|
|
1347
1355
|
|
|
1348
1356
|
# Files params
|
|
1349
1357
|
param_files_upload_inbox_path = "Virtual path on the server where the uploaded files will be stored"
|
kaggle/models/upload_file.py
CHANGED
|
@@ -21,7 +21,7 @@ import re # noqa: F401
|
|
|
21
21
|
|
|
22
22
|
import six
|
|
23
23
|
|
|
24
|
-
from
|
|
24
|
+
from kagglesdk.datasets.types.dataset_api_service import ApiDatasetColumn
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
class UploadFile(object):
|
|
@@ -33,7 +33,7 @@ class UploadFile(object):
|
|
|
33
33
|
and the value is json key in definition.
|
|
34
34
|
"""
|
|
35
35
|
|
|
36
|
-
column_types = {"token": "str", "description": "str", "columns": "list[
|
|
36
|
+
column_types = {"token": "str", "description": "str", "columns": "list[ApiDatasetColumn]"}
|
|
37
37
|
|
|
38
38
|
attribute_map = {"token": "token", "description": "description", "columns": "columns"}
|
|
39
39
|
|
|
@@ -107,7 +107,7 @@ class UploadFile(object):
|
|
|
107
107
|
A list of dataset column metadata # noqa: E501
|
|
108
108
|
|
|
109
109
|
:return: The columns of this UploadFile. # noqa: E501
|
|
110
|
-
:rtype: list[
|
|
110
|
+
:rtype: list[ApiDatasetColumn]
|
|
111
111
|
"""
|
|
112
112
|
return self._columns
|
|
113
113
|
|
|
@@ -118,7 +118,7 @@ class UploadFile(object):
|
|
|
118
118
|
A list of dataset column metadata # noqa: E501
|
|
119
119
|
|
|
120
120
|
:param columns: The columns of this UploadFile. # noqa: E501
|
|
121
|
-
:type: list[
|
|
121
|
+
:type: list[ApiDatasetColumn]
|
|
122
122
|
"""
|
|
123
123
|
|
|
124
124
|
self._columns = columns
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kaggle
|
|
3
|
-
Version: 1.8.
|
|
3
|
+
Version: 1.8.4
|
|
4
4
|
Summary: Access Kaggle resources anywhere
|
|
5
|
-
Project-URL: Homepage, https://github.com/Kaggle/kaggle-
|
|
6
|
-
Project-URL: Issues, https://github.com/Kaggle/kaggle-
|
|
5
|
+
Project-URL: Homepage, https://github.com/Kaggle/kaggle-cli
|
|
6
|
+
Project-URL: Issues, https://github.com/Kaggle/kaggle-cli/issues
|
|
7
7
|
Author-email: Kaggle <support@kaggle.com>
|
|
8
8
|
License: Apache License
|
|
9
9
|
Version 2.0, January 2004
|
|
@@ -212,46 +212,57 @@ Classifier: License :: OSI Approved :: Apache Software License
|
|
|
212
212
|
Classifier: Operating System :: OS Independent
|
|
213
213
|
Classifier: Programming Language :: Python :: 3
|
|
214
214
|
Requires-Python: >=3.11
|
|
215
|
-
Requires-Dist: black>=24.10.0
|
|
216
215
|
Requires-Dist: bleach
|
|
217
|
-
Requires-Dist: kagglesdk
|
|
218
|
-
Requires-Dist:
|
|
216
|
+
Requires-Dist: kagglesdk<1.0,>=0.1.15
|
|
217
|
+
Requires-Dist: packaging
|
|
219
218
|
Requires-Dist: protobuf
|
|
220
219
|
Requires-Dist: python-dateutil
|
|
221
220
|
Requires-Dist: python-slugify
|
|
222
221
|
Requires-Dist: requests
|
|
223
|
-
Requires-Dist: setuptools>=21.0.0
|
|
224
|
-
Requires-Dist: six>=1.10
|
|
225
222
|
Requires-Dist: tqdm
|
|
226
|
-
Requires-Dist: types-requests
|
|
227
|
-
Requires-Dist: types-tqdm
|
|
228
223
|
Requires-Dist: urllib3>=1.15.1
|
|
229
224
|
Description-Content-Type: text/markdown
|
|
230
225
|
|
|
231
|
-
# Kaggle
|
|
226
|
+
# Kaggle CLI
|
|
232
227
|
|
|
233
|
-
|
|
228
|
+
The official CLI to interact with [Kaggle](https://www.kaggle.com).
|
|
229
|
+
|
|
230
|
+
---
|
|
234
231
|
|
|
235
232
|
[User documentation](docs/README.md)
|
|
236
233
|
|
|
237
|
-
|
|
234
|
+
---
|
|
238
235
|
|
|
239
|
-
|
|
236
|
+
## Key Features
|
|
240
237
|
|
|
241
|
-
|
|
238
|
+
Some of the key features are:
|
|
239
|
+
|
|
240
|
+
* List competitions, download competition data, submit to a competition.
|
|
241
|
+
* List, create, update, download or delete datasets.
|
|
242
|
+
* List, create, update, download or delete models & model variations.
|
|
243
|
+
* List, update & run, download code & output or delete kernels (notebooks).
|
|
244
|
+
|
|
245
|
+
## Installation
|
|
246
|
+
|
|
247
|
+
Install the `kaggle` package with [pip](https://pypi.org/project/pip/):
|
|
242
248
|
|
|
243
249
|
```sh
|
|
244
250
|
pip install kaggle
|
|
245
251
|
```
|
|
246
252
|
|
|
247
|
-
|
|
253
|
+
Additional installation instructions can be found [here](docs/README.md#installation).
|
|
248
254
|
|
|
249
|
-
|
|
255
|
+
## Quick start
|
|
250
256
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
257
|
+
Explore the available commands by running:
|
|
258
|
+
|
|
259
|
+
```sh
|
|
260
|
+
kaggle --help
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
See the [User documentation](docs/README.md) for more examples & tutorials.
|
|
264
|
+
|
|
265
|
+
## Development
|
|
255
266
|
|
|
256
267
|
### Prerequisites
|
|
257
268
|
|
|
@@ -259,87 +270,67 @@ We use [hatch](https://hatch.pypa.io) to manage this project.
|
|
|
259
270
|
|
|
260
271
|
Follow these [instructions](https://hatch.pypa.io/latest/install/) to install it.
|
|
261
272
|
|
|
262
|
-
|
|
263
|
-
try `sudo apt install pipx`. Then you should be able to proceed with `pipx install hatch`.
|
|
273
|
+
### Run `kaggle` from source
|
|
264
274
|
|
|
265
|
-
|
|
275
|
+
#### Option 1: Execute a one-liner of code from the command line
|
|
266
276
|
|
|
267
277
|
```sh
|
|
268
|
-
hatch run
|
|
278
|
+
hatch run kaggle datasets list
|
|
269
279
|
```
|
|
270
280
|
|
|
271
|
-
|
|
281
|
+
#### Option 2: Run many commands in a shell
|
|
272
282
|
|
|
273
283
|
```sh
|
|
274
|
-
hatch
|
|
284
|
+
hatch shell
|
|
285
|
+
|
|
286
|
+
# Inside the shell, you can run many commands
|
|
287
|
+
kaggle datasets list
|
|
288
|
+
kaggle competitions list
|
|
289
|
+
...
|
|
275
290
|
```
|
|
276
291
|
|
|
277
|
-
|
|
292
|
+
### Lint / Format
|
|
278
293
|
|
|
279
|
-
|
|
294
|
+
```sh
|
|
295
|
+
# Lint check
|
|
296
|
+
hatch run lint:style
|
|
297
|
+
hatch run lint:typing
|
|
298
|
+
hatch run lint:all # for both
|
|
280
299
|
|
|
281
|
-
|
|
300
|
+
# Format
|
|
301
|
+
hatch run lint:fmt
|
|
302
|
+
```
|
|
282
303
|
|
|
283
|
-
|
|
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`.
|
|
304
|
+
### Tests
|
|
286
305
|
|
|
287
|
-
|
|
306
|
+
Note: These tests are not true unit tests and are calling the Kaggle web server.
|
|
288
307
|
|
|
289
308
|
```sh
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
```python
|
|
294
|
-
import kaggle
|
|
295
|
-
from kaggle.api.kaggle_api_extended import KaggleApi
|
|
296
|
-
api = KaggleApi()
|
|
297
|
-
api.authenticate()
|
|
298
|
-
api.model_list_cli()
|
|
299
|
-
|
|
300
|
-
Next Page Token = [...]
|
|
301
|
-
[...]
|
|
309
|
+
# Run against kaggle.com
|
|
310
|
+
hatch run test:prod
|
|
302
311
|
|
|
312
|
+
# Run against a local web server (Kaggle engineers only)
|
|
313
|
+
hatch run test:local
|
|
303
314
|
```
|
|
304
315
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
```sh
|
|
308
|
-
hatch run python -c "import kaggle; from kaggle.api.kaggle_api_extended import KaggleApi; api = KaggleApi(); api.authenticate(); api.model_list_cli()"
|
|
309
|
-
```
|
|
316
|
+
### Integration Tests
|
|
310
317
|
|
|
311
|
-
|
|
318
|
+
To run integration tests on your local machine, you need to set up your Kaggle credentials. You can do this by following the [authentication instructions](docs/README.md#authentication).
|
|
312
319
|
|
|
313
|
-
|
|
320
|
+
After setting up your credentials, you can run the integration tests as follows:
|
|
314
321
|
|
|
315
322
|
```sh
|
|
316
|
-
|
|
317
|
-
[...]
|
|
318
|
-
+ print('hello Kaggle CLI update')^M
|
|
319
|
-
models = self.model_list(sort_by, search, owner, page_size, page_token)
|
|
320
|
-
[...]
|
|
321
|
-
|
|
322
|
-
❯ hatch run compile
|
|
323
|
-
[...]
|
|
324
|
-
|
|
325
|
-
❯ hatch run python -c "import kaggle; from kaggle.api.kaggle_api_extended import KaggleApi; api = KaggleApi(); api.authenticate(); api.model_list_cli()"
|
|
326
|
-
hello Kaggle CLI update
|
|
327
|
-
Next Page Token = [...]
|
|
323
|
+
hatch run test:integration
|
|
328
324
|
```
|
|
329
325
|
|
|
330
|
-
|
|
326
|
+
## Changelog
|
|
331
327
|
|
|
332
|
-
|
|
333
|
-
- Using environment variables
|
|
334
|
-
- Using credentials file
|
|
328
|
+
See [CHANGELOG](CHANGELOG.md).
|
|
335
329
|
|
|
336
|
-
|
|
330
|
+
## Contributing
|
|
337
331
|
|
|
338
|
-
|
|
339
|
-
# Run all tests
|
|
340
|
-
hatch run integration-test
|
|
341
|
-
```
|
|
332
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
342
333
|
|
|
343
334
|
## License
|
|
344
335
|
|
|
345
|
-
The Kaggle
|
|
336
|
+
The Kaggle CLI is released under the [Apache 2.0 license](LICENSE.txt).
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
kaggle/LICENSE,sha256=PN5H3cwV3xW9nvUXKcB_XOH60cWqne6qK3SAE8NI74s,11340
|
|
2
|
+
kaggle/__init__.py,sha256=fUks8_ewdXRldJ0jq82KRKgsyUae8DtxU6QFrGtaxeE,280
|
|
3
|
+
kaggle/cli.py,sha256=f6RX_XZJNwMkbj5ftDSHcHGrV_czqwWrfRqK63y-Lx0,69820
|
|
4
|
+
kaggle/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
+
kaggle/api/kaggle_api.py,sha256=k_Fm5TxiUM6O19dMy43XTdYyBNIWWGWDE9QRf6otwUE,25521
|
|
6
|
+
kaggle/api/kaggle_api_extended.py,sha256=H50hT_jbQcD0DirfX89jT3HvqGiX6Eko3LyAx_gulFI,228320
|
|
7
|
+
kaggle/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
+
kaggle/models/kaggle_models_extended.py,sha256=w-IEn0AQvIZRj3ialSoOMOJm8vu48whqte36IdggI7Q,7997
|
|
9
|
+
kaggle/models/upload_file.py,sha256=i_8CfypwOToCoxAvG96Gle3IgNkrVnc38Y4oMHKqNjg,5081
|
|
10
|
+
kaggle/test/test_authenticate.py,sha256=6HvLhQ4noCXs3hVJpQP-tlSYv1_I9kKfAT2Nu3PeC7Q,1185
|
|
11
|
+
kaggle-1.8.4.dist-info/METADATA,sha256=KD5dM79V1y57b-X76cdRuWi0pvmn45oMYOkR1y0fpTA,15925
|
|
12
|
+
kaggle-1.8.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
13
|
+
kaggle-1.8.4.dist-info/entry_points.txt,sha256=hl3dQAS4qpVkC5FWiqfnU6qKJU924OEN6PsHEiw-FGg,43
|
|
14
|
+
kaggle-1.8.4.dist-info/licenses/LICENSE.txt,sha256=IzhfWrxIlFAci3lzZCg5WWHZJBI1QSzsHxO0plI63vk,11541
|
|
15
|
+
kaggle-1.8.4.dist-info/RECORD,,
|
kaggle/models/api_blob_type.py
DELETED
kaggle/models/dataset_column.py
DELETED
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/python
|
|
2
|
-
#
|
|
3
|
-
# Copyright 2024 Kaggle Inc
|
|
4
|
-
#
|
|
5
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
# you may not use this file except in compliance with the License.
|
|
7
|
-
# You may obtain a copy of the License at
|
|
8
|
-
#
|
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
#
|
|
11
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
# See the License for the specific language governing permissions and
|
|
15
|
-
# limitations under the License.
|
|
16
|
-
|
|
17
|
-
# coding: utf-8
|
|
18
|
-
|
|
19
|
-
import pprint
|
|
20
|
-
import re # noqa: F401
|
|
21
|
-
|
|
22
|
-
import six
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class DatasetColumn(object):
|
|
26
|
-
"""
|
|
27
|
-
Attributes:
|
|
28
|
-
column_types (dict): The key is attribute name
|
|
29
|
-
and the value is attribute type.
|
|
30
|
-
attribute_map (dict): The key is attribute name
|
|
31
|
-
and the value is json key in definition.
|
|
32
|
-
"""
|
|
33
|
-
|
|
34
|
-
column_types = {"order": "float", "name": "str", "type": "str", "original_type": "str", "description": "str"}
|
|
35
|
-
|
|
36
|
-
attribute_map = {
|
|
37
|
-
"order": "order",
|
|
38
|
-
"name": "name",
|
|
39
|
-
"type": "type",
|
|
40
|
-
"original_type": "originalType",
|
|
41
|
-
"description": "description",
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
def __init__(self, order=None, name=None, type=None, original_type=None, description=None): # noqa: E501
|
|
45
|
-
"""DatasetColumn - a model defined in Swagger""" # noqa: E501
|
|
46
|
-
|
|
47
|
-
self._order = None
|
|
48
|
-
self._name = None
|
|
49
|
-
self._type = None
|
|
50
|
-
self._original_type = None
|
|
51
|
-
self._description = None
|
|
52
|
-
self.discriminator = None
|
|
53
|
-
|
|
54
|
-
if order is not None:
|
|
55
|
-
self.order = order
|
|
56
|
-
if name is not None:
|
|
57
|
-
self.name = name
|
|
58
|
-
if type is not None:
|
|
59
|
-
self.type = type
|
|
60
|
-
if original_type is not None:
|
|
61
|
-
self.original_type = original_type
|
|
62
|
-
if description is not None:
|
|
63
|
-
self.description = description
|
|
64
|
-
|
|
65
|
-
@property
|
|
66
|
-
def order(self):
|
|
67
|
-
"""Gets the order of this DatasetColumn. # noqa: E501.
|
|
68
|
-
|
|
69
|
-
The order that the column comes in, 0-based. (The first column is 0,
|
|
70
|
-
second is 1, etc.) # noqa: E501
|
|
71
|
-
|
|
72
|
-
:return: The order of this DatasetColumn. # noqa: E501
|
|
73
|
-
:rtype: float
|
|
74
|
-
"""
|
|
75
|
-
return self._order
|
|
76
|
-
|
|
77
|
-
@order.setter
|
|
78
|
-
def order(self, order):
|
|
79
|
-
"""Sets the order of this DatasetColumn.
|
|
80
|
-
|
|
81
|
-
The order that the column comes in, 0-based. (The first column is 0,
|
|
82
|
-
second is 1, etc.) # noqa: E501
|
|
83
|
-
|
|
84
|
-
:param order: The order of this DatasetColumn. # noqa: E501
|
|
85
|
-
:type: float
|
|
86
|
-
"""
|
|
87
|
-
|
|
88
|
-
self._order = order
|
|
89
|
-
|
|
90
|
-
@property
|
|
91
|
-
def name(self):
|
|
92
|
-
"""Gets the name of this DatasetColumn. # noqa: E501.
|
|
93
|
-
|
|
94
|
-
The column name # noqa: E501
|
|
95
|
-
|
|
96
|
-
:return: The name of this DatasetColumn. # noqa: E501
|
|
97
|
-
:rtype: str
|
|
98
|
-
"""
|
|
99
|
-
return self._name
|
|
100
|
-
|
|
101
|
-
@name.setter
|
|
102
|
-
def name(self, name):
|
|
103
|
-
"""Sets the name of this DatasetColumn.
|
|
104
|
-
|
|
105
|
-
The column name # noqa: E501
|
|
106
|
-
|
|
107
|
-
:param name: The name of this DatasetColumn. # noqa: E501
|
|
108
|
-
:type: str
|
|
109
|
-
"""
|
|
110
|
-
|
|
111
|
-
self._name = name
|
|
112
|
-
|
|
113
|
-
@property
|
|
114
|
-
def type(self):
|
|
115
|
-
"""Gets the type of this DatasetColumn. # noqa: E501.
|
|
116
|
-
|
|
117
|
-
The type of all of the fields in the column. Please see the data
|
|
118
|
-
types on
|
|
119
|
-
https://github.com/Kaggle/kaggle-api/wiki/Dataset-Metadata
|
|
120
|
-
# noqa: E501
|
|
121
|
-
|
|
122
|
-
:return: The type of this DatasetColumn. # noqa: E501
|
|
123
|
-
:rtype: str
|
|
124
|
-
"""
|
|
125
|
-
return self._type
|
|
126
|
-
|
|
127
|
-
@type.setter
|
|
128
|
-
def type(self, type):
|
|
129
|
-
"""Sets the type of this DatasetColumn.
|
|
130
|
-
|
|
131
|
-
The type of all of the fields in the column. Please see the data
|
|
132
|
-
types on
|
|
133
|
-
https://github.com/Kaggle/kaggle-api/wiki/Dataset-Metadata
|
|
134
|
-
# noqa: E501
|
|
135
|
-
|
|
136
|
-
:param type: The type of this DatasetColumn. # noqa: E501
|
|
137
|
-
:type: str
|
|
138
|
-
"""
|
|
139
|
-
|
|
140
|
-
self._type = type
|
|
141
|
-
|
|
142
|
-
@property
|
|
143
|
-
def original_type(self):
|
|
144
|
-
"""Gets the original_type of this DatasetColumn. # noqa: E501.
|
|
145
|
-
|
|
146
|
-
Used to store the original type of the column, which will be converted to Kaggle's types. For example, an `originalType` of `\"integer\"` would convert to a `type` of `\"numeric\"` # noqa: E501
|
|
147
|
-
|
|
148
|
-
:return: The original_type of this DatasetColumn. # noqa: E501
|
|
149
|
-
:rtype: str
|
|
150
|
-
"""
|
|
151
|
-
return self._original_type
|
|
152
|
-
|
|
153
|
-
@original_type.setter
|
|
154
|
-
def original_type(self, original_type):
|
|
155
|
-
"""Sets the original_type of this DatasetColumn.
|
|
156
|
-
|
|
157
|
-
Used to store the original type of the column, which will be converted to Kaggle's types. For example, an `originalType` of `\"integer\"` would convert to a `type` of `\"numeric\"` # noqa: E501
|
|
158
|
-
|
|
159
|
-
:param original_type: The original_type of this DatasetColumn. # noqa: E501
|
|
160
|
-
:type: str
|
|
161
|
-
"""
|
|
162
|
-
|
|
163
|
-
self._original_type = original_type
|
|
164
|
-
|
|
165
|
-
@property
|
|
166
|
-
def description(self):
|
|
167
|
-
"""Gets the description of this DatasetColumn. # noqa: E501.
|
|
168
|
-
|
|
169
|
-
The description of the column # noqa: E501
|
|
170
|
-
|
|
171
|
-
:return: The description of this DatasetColumn. # noqa: E501
|
|
172
|
-
:rtype: str
|
|
173
|
-
"""
|
|
174
|
-
return self._description
|
|
175
|
-
|
|
176
|
-
@description.setter
|
|
177
|
-
def description(self, description):
|
|
178
|
-
"""Sets the description of this DatasetColumn.
|
|
179
|
-
|
|
180
|
-
The description of the column # noqa: E501
|
|
181
|
-
|
|
182
|
-
:param description: The description of this DatasetColumn. # noqa:
|
|
183
|
-
E501
|
|
184
|
-
:type: str
|
|
185
|
-
"""
|
|
186
|
-
|
|
187
|
-
self._description = description
|
|
188
|
-
|
|
189
|
-
def to_dict(self):
|
|
190
|
-
"""Returns the model properties as a dict."""
|
|
191
|
-
result = {}
|
|
192
|
-
|
|
193
|
-
for attr, _ in six.iteritems(self.column_types):
|
|
194
|
-
value = getattr(self, attr)
|
|
195
|
-
if isinstance(value, list):
|
|
196
|
-
result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value))
|
|
197
|
-
elif hasattr(value, "to_dict"):
|
|
198
|
-
result[attr] = value.to_dict()
|
|
199
|
-
elif isinstance(value, dict):
|
|
200
|
-
result[attr] = dict(
|
|
201
|
-
map(
|
|
202
|
-
lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item,
|
|
203
|
-
value.items(),
|
|
204
|
-
)
|
|
205
|
-
)
|
|
206
|
-
else:
|
|
207
|
-
result[attr] = value
|
|
208
|
-
|
|
209
|
-
return result
|
|
210
|
-
|
|
211
|
-
def to_str(self):
|
|
212
|
-
"""Returns the string representation of the model."""
|
|
213
|
-
return pprint.pformat(self.to_dict())
|
|
214
|
-
|
|
215
|
-
def __repr__(self):
|
|
216
|
-
"""For `print` and `pprint`"""
|
|
217
|
-
return self.to_str()
|
|
218
|
-
|
|
219
|
-
def __eq__(self, other):
|
|
220
|
-
"""Returns true if both objects are equal."""
|
|
221
|
-
if not isinstance(other, DatasetColumn):
|
|
222
|
-
return False
|
|
223
|
-
|
|
224
|
-
return self.__dict__ == other.__dict__
|
|
225
|
-
|
|
226
|
-
def __ne__(self, other):
|
|
227
|
-
"""Returns true if both objects are not equal."""
|
|
228
|
-
return not self == other
|