kaggle 1.6.14__tar.gz → 1.6.17__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. {kaggle-1.6.14/kaggle.egg-info → kaggle-1.6.17}/PKG-INFO +1 -1
  2. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/api/kaggle_api_extended.py +19 -4
  3. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/cli.py +12 -2
  4. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/models/model_instance_update_request.py +1 -1
  5. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/models/model_new_instance_request.py +2 -2
  6. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/test/test_authenticate.py +1 -1
  7. {kaggle-1.6.14 → kaggle-1.6.17/kaggle.egg-info}/PKG-INFO +1 -1
  8. {kaggle-1.6.14 → kaggle-1.6.17}/setup.py +1 -1
  9. {kaggle-1.6.14 → kaggle-1.6.17}/LICENSE +0 -0
  10. {kaggle-1.6.14 → kaggle-1.6.17}/MANIFEST.in +0 -0
  11. {kaggle-1.6.14 → kaggle-1.6.17}/README.md +0 -0
  12. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/__init__.py +0 -0
  13. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/api/__init__.py +0 -0
  14. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/api/kaggle_api.py +0 -0
  15. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/api_client.py +0 -0
  16. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/configuration.py +0 -0
  17. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/models/__init__.py +0 -0
  18. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/models/api_blob_type.py +0 -0
  19. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/models/collaborator.py +0 -0
  20. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/models/create_inbox_file_request.py +0 -0
  21. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/models/dataset_column.py +0 -0
  22. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/models/dataset_new_request.py +0 -0
  23. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/models/dataset_new_version_request.py +0 -0
  24. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/models/dataset_update_settings_request.py +0 -0
  25. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/models/error.py +0 -0
  26. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/models/kaggle_models_extended.py +0 -0
  27. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/models/kernel_push_request.py +0 -0
  28. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/models/license.py +0 -0
  29. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/models/model_instance_new_version_request.py +0 -0
  30. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/models/model_new_request.py +0 -0
  31. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/models/model_update_request.py +0 -0
  32. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/models/result.py +0 -0
  33. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/models/start_blob_upload_request.py +0 -0
  34. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/models/start_blob_upload_response.py +0 -0
  35. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/models/upload_file.py +0 -0
  36. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/rest.py +0 -0
  37. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle/test/__init__.py +0 -0
  38. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle.egg-info/SOURCES.txt +0 -0
  39. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle.egg-info/dependency_links.txt +0 -0
  40. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle.egg-info/entry_points.txt +0 -0
  41. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle.egg-info/requires.txt +0 -0
  42. {kaggle-1.6.14 → kaggle-1.6.17}/kaggle.egg-info/top_level.txt +0 -0
  43. {kaggle-1.6.14 → kaggle-1.6.17}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kaggle
3
- Version: 1.6.14
3
+ Version: 1.6.17
4
4
  Summary: Kaggle API
5
5
  Home-page: https://github.com/Kaggle/kaggle-api
6
6
  Author: Kaggle
@@ -256,7 +256,7 @@ class ResumableFileUpload(object):
256
256
 
257
257
 
258
258
  class KaggleApi(KaggleApi):
259
- __version__ = '1.6.14'
259
+ __version__ = '1.6.17'
260
260
 
261
261
  CONFIG_NAME_PROXY = 'proxy'
262
262
  CONFIG_NAME_COMPETITION = 'competition'
@@ -274,8 +274,17 @@ class KaggleApi(KaggleApi):
274
274
  MAX_NUM_INBOX_FILES_TO_UPLOAD = 1000
275
275
  MAX_UPLOAD_RESUME_ATTEMPTS = 10
276
276
 
277
- config_dir = os.environ.get('KAGGLE_CONFIG_DIR') or os.path.join(
278
- expanduser('~'), '.kaggle')
277
+ config_dir = os.environ.get('KAGGLE_CONFIG_DIR')
278
+
279
+ if not config_dir:
280
+ config_dir = os.path.join(expanduser('~'), '.kaggle')
281
+ # Use ~/.kaggle if it already exists for backwards compatibility,
282
+ # otherwise follow XDG base directory specification
283
+ if sys.platform.startswith('linux') and not os.path.exists(config_dir):
284
+ config_dir = os.path.join(
285
+ (os.environ.get('XDG_CONFIG_HOME')
286
+ or os.path.join(expanduser('~'), '.config')), 'kaggle')
287
+
279
288
  if not os.path.exists(config_dir):
280
289
  os.makedirs(config_dir)
281
290
 
@@ -396,7 +405,9 @@ class KaggleApi(KaggleApi):
396
405
  return
397
406
  else:
398
407
  raise IOError('Could not find {}. Make sure it\'s located in'
399
- ' {}. Or use the environment method.'.format(
408
+ ' {}. Or use the environment method. See setup'
409
+ ' instructions at'
410
+ ' https://github.com/Kaggle/kaggle-api/'.format(
400
411
  self.config_file, self.config_dir))
401
412
 
402
413
  # Step 3: load into configuration!
@@ -2307,6 +2318,10 @@ class KaggleApi(KaggleApi):
2307
2318
  for cell in json_body['cells']:
2308
2319
  if 'outputs' in cell and cell['cell_type'] == 'code':
2309
2320
  cell['outputs'] = []
2321
+ # The spec allows a list of strings,
2322
+ # but the server expects just one
2323
+ if 'source' in cell and isinstance(cell['source'], list):
2324
+ cell['source'] = ''.join(cell['source'])
2310
2325
  script_body = json.dumps(json_body)
2311
2326
 
2312
2327
  kernel_push_request = KernelPushRequest(
@@ -31,7 +31,13 @@ def main():
31
31
  parser.add_argument('-v',
32
32
  '--version',
33
33
  action='version',
34
+ help='Print the Kaggle API version',
34
35
  version='Kaggle API ' + KaggleApi.__version__)
36
+ parser.add_argument('-W',
37
+ '--no-warn',
38
+ dest='disable_version_warning',
39
+ action='store_true',
40
+ help='Disable out-of-date API version warning')
35
41
 
36
42
  subparsers = parser.add_subparsers(title='commands',
37
43
  help=Help.kaggle,
@@ -49,6 +55,9 @@ def main():
49
55
  command_args.update(vars(args))
50
56
  del command_args['func']
51
57
  del command_args['command']
58
+ if command_args['disable_version_warning']:
59
+ KaggleApi.already_printed_version_warning = True
60
+ del command_args['disable_version_warning']
52
61
  error = False
53
62
  try:
54
63
  out = args.func(**command_args)
@@ -1649,11 +1658,12 @@ class Help(object):
1649
1658
  command_model_instances_new = 'Create a new model instance'
1650
1659
  param_model_instance_downfile = (
1651
1660
  'Folder for downloading the special model-instance-metadata.json file '
1652
- '(https://github.com/Kaggle/kaggle-api/wiki/ModelInstance-Metadata). ')
1661
+ '(https://github.com/Kaggle/kaggle-api/wiki/Model-Metadata#model-instance). '
1662
+ )
1653
1663
  param_model_instance_upfile = (
1654
1664
  'Folder for upload, containing data files and a '
1655
1665
  'special model-instance-metadata.json file '
1656
- '(https://github.com/Kaggle/kaggle-api/wiki/ModelInstance-Metadata). '
1666
+ '(https://github.com/Kaggle/kaggle-api/wiki/Model-Metadata#model-instance). '
1657
1667
  'Defaults to current working directory')
1658
1668
  command_model_instances_delete = 'Delete a model instance'
1659
1669
  command_model_instances_update = 'Update a model instance'
@@ -152,7 +152,7 @@ class ModelInstanceUpdateRequest(object):
152
152
  :param license_name: The license_name of this ModelInstanceUpdateRequest. # noqa: E501
153
153
  :type: str
154
154
  """
155
- allowed_values = ["CC BY-NC-SA 4.0", "CC BY-SA 4.0", "GPL 2", "CC BY-SA 3.0", "Attribution 4.0 International (CC BY 4.0)", "Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)", "ODC Public Domain Dedication and Licence (PDDL)", "Attribution 3.0 Unported (CC BY 3.0)", "Attribution 3.0 IGO (CC BY 3.0 IGO)", "Attribution-NonCommercial-ShareAlike 3.0 IGO (CC BY-NC-SA 3.0 IGO)", "Community Data License Agreement - Permissive - Version 1.0", "Community Data License Agreement - Sharing - Version 1.0", "Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)", "Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)", "ODC Attribution License (ODC-By)", "GNU Lesser General Public License 3.0", "GNU Affero General Public License 3.0", "GNU Free Documentation License 1.3", "Apache 2.0", "MIT", "BSD-3-Clause", "GPL 3"] # noqa: E501
155
+ allowed_values = ["CC0 1.0", "CC BY-NC-SA 4.0", "Unknown", "CC BY-SA 4.0", "GPL 2", "CC BY-SA 3.0", "Other", "Other (specified in description)", "CC BY 4.0", "Attribution 4.0 International (CC BY 4.0)", "CC BY-NC 4.0", "Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)", "PDDL", "ODC Public Domain Dedication and Licence (PDDL)", "CC BY 3.0", "Attribution 3.0 Unported (CC BY 3.0)", "CC BY 3.0 IGO", "Attribution 3.0 IGO (CC BY 3.0 IGO)", "CC BY-NC-SA 3.0 IGO", "Attribution-NonCommercial-ShareAlike 3.0 IGO (CC BY-NC-SA 3.0 IGO)", "CDLA Permissive 1.0", "Community Data License Agreement - Permissive - Version 1.0", "CDLA Sharing 1.0", "Community Data License Agreement - Sharing - Version 1.0", "CC BY-ND 4.0", "Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)", "CC BY-NC-ND 4.0", "Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)", "ODC-BY 1.0", "ODC Attribution License (ODC-By)", "LGPL 3.0", "GNU Lesser General Public License 3.0", "AGPL 3.0", "GNU Affero General Public License 3.0", "FDL 1.3", "GNU Free Documentation License 1.3", "apache-2.0", "Apache 2.0", "mit", "MIT", "bsd-3-clause", "BSD-3-Clause", "Llama 2", "Llama 2 Community License", "Gemma", "gpl-3", "GPL 3", "RAIL-M", "AI Pubs Open RAIL-M License", "AIPubs Research-Use RAIL-M", "AI Pubs Research-Use RAIL-M License", "BigScience OpenRAIL-M", "BigScience Open RAIL-M License", "RAIL", "RAIL (specified in description)", "Llama 3", "Llama 3 Community License"] # noqa: E501
156
156
  if license_name not in allowed_values:
157
157
  raise ValueError(
158
158
  "Invalid value for `license_name` ({0}), must be one of {1}" # noqa: E501
@@ -143,7 +143,7 @@ class ModelNewInstanceRequest(object):
143
143
  """
144
144
  if framework is None:
145
145
  raise ValueError("Invalid value for `framework`, must not be `None`") # noqa: E501
146
- allowed_values = ["tensorFlow1", "tensorFlow2", "tfLite", "tfJs", "pyTorch", "jax", "flax", "pax", "maxText", "gemmaCpp", "tensorRtLlm", "ggml", "gguf", "coral", "scikitLearn", "mxnet", "onnx", "keras", "transformers", "other"] # noqa: E501
146
+ allowed_values = ["tensorFlow1", "tensorFlow2", "tfLite", "tfJs", "pyTorch", "jax", "flax", "pax", "maxText", "gemmaCpp", "tensorRtLlm", "ggml", "gguf", "coral", "scikitLearn", "mxnet", "onnx", "keras", "transformers", "triton", "other"] # noqa: E501
147
147
  if framework not in allowed_values:
148
148
  raise ValueError(
149
149
  "Invalid value for `framework` ({0}), must be one of {1}" # noqa: E501
@@ -220,7 +220,7 @@ class ModelNewInstanceRequest(object):
220
220
  """
221
221
  if license_name is None:
222
222
  raise ValueError("Invalid value for `license_name`, must not be `None`") # noqa: E501
223
- allowed_values = ["CC BY-NC-SA 4.0", "CC BY-SA 4.0", "GPL 2", "CC BY-SA 3.0", "Attribution 4.0 International (CC BY 4.0)", "Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)", "ODC Public Domain Dedication and Licence (PDDL)", "Attribution 3.0 Unported (CC BY 3.0)", "Attribution 3.0 IGO (CC BY 3.0 IGO)", "Attribution-NonCommercial-ShareAlike 3.0 IGO (CC BY-NC-SA 3.0 IGO)", "Community Data License Agreement - Permissive - Version 1.0", "Community Data License Agreement - Sharing - Version 1.0", "Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)", "Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)", "ODC Attribution License (ODC-By)", "GNU Lesser General Public License 3.0", "GNU Affero General Public License 3.0", "GNU Free Documentation License 1.3", "Apache 2.0", "MIT", "BSD-3-Clause", "GPL 3"] # noqa: E501
223
+ allowed_values = ["CC0 1.0", "CC BY-NC-SA 4.0", "Unknown", "CC BY-SA 4.0", "GPL 2", "CC BY-SA 3.0", "Other", "Other (specified in description)", "CC BY 4.0", "Attribution 4.0 International (CC BY 4.0)", "CC BY-NC 4.0", "Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)", "PDDL", "ODC Public Domain Dedication and Licence (PDDL)", "CC BY 3.0", "Attribution 3.0 Unported (CC BY 3.0)", "CC BY 3.0 IGO", "Attribution 3.0 IGO (CC BY 3.0 IGO)", "CC BY-NC-SA 3.0 IGO", "Attribution-NonCommercial-ShareAlike 3.0 IGO (CC BY-NC-SA 3.0 IGO)", "CDLA Permissive 1.0", "Community Data License Agreement - Permissive - Version 1.0", "CDLA Sharing 1.0", "Community Data License Agreement - Sharing - Version 1.0", "CC BY-ND 4.0", "Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)", "CC BY-NC-ND 4.0", "Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)", "ODC-BY 1.0", "ODC Attribution License (ODC-By)", "LGPL 3.0", "GNU Lesser General Public License 3.0", "AGPL 3.0", "GNU Affero General Public License 3.0", "FDL 1.3", "GNU Free Documentation License 1.3", "apache-2.0", "Apache 2.0", "mit", "MIT", "bsd-3-clause", "BSD-3-Clause", "Llama 2", "Llama 2 Community License", "Gemma", "gpl-3", "GPL 3", "RAIL-M", "AI Pubs Open RAIL-M License", "AIPubs Research-Use RAIL-M", "AI Pubs Research-Use RAIL-M License", "BigScience OpenRAIL-M", "BigScience Open RAIL-M License", "RAIL", "RAIL (specified in description)", "Llama 3", "Llama 3 Community License"] # noqa: E501
224
224
  if license_name not in allowed_values:
225
225
  raise ValueError(
226
226
  "Invalid value for `license_name` ({0}), must be one of {1}" # noqa: E501
@@ -35,7 +35,7 @@ class TestAuthenticate(unittest.TestCase):
35
35
  def test_config_actions(self):
36
36
  api = KaggleApi()
37
37
 
38
- self.assertTrue(api.config_dir.endswith('.kaggle'))
38
+ self.assertTrue(api.config_dir.endswith('kaggle'))
39
39
  self.assertEqual(api.get_config_value('doesntexist'), None)
40
40
 
41
41
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kaggle
3
- Version: 1.6.14
3
+ Version: 1.6.17
4
4
  Summary: Kaggle API
5
5
  Home-page: https://github.com/Kaggle/kaggle-api
6
6
  Author: Kaggle
@@ -6,7 +6,7 @@ from setuptools import setup, find_packages
6
6
  # pyproject.toml instead of maintaining both flows.
7
7
  setup(
8
8
  name='kaggle',
9
- version='1.6.14',
9
+ version='1.6.17',
10
10
  description='Kaggle API',
11
11
  long_description=
12
12
  ('Official API for https://www.kaggle.com, accessible using a command line '
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes