kaggle 2.2.2__tar.gz → 2.2.3__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 (94) hide show
  1. {kaggle-2.2.2 → kaggle-2.2.3}/CHANGELOG.md +9 -0
  2. {kaggle-2.2.2 → kaggle-2.2.3}/PKG-INFO +1 -1
  3. {kaggle-2.2.2 → kaggle-2.2.3}/docs/README.md +4 -0
  4. {kaggle-2.2.2 → kaggle-2.2.3}/docs/kernels.md +7 -1
  5. kaggle-2.2.3/docs/output_format.md +140 -0
  6. {kaggle-2.2.2 → kaggle-2.2.3}/pyproject.toml +4 -5
  7. {kaggle-2.2.2 → kaggle-2.2.3}/src/kaggle/__init__.py +1 -1
  8. {kaggle-2.2.2 → kaggle-2.2.3}/src/kaggle/api/kaggle_api_extended.py +631 -173
  9. {kaggle-2.2.2 → kaggle-2.2.3}/src/kaggle/cli.py +39 -56
  10. kaggle-2.2.2/tests/unit_tests.py → kaggle-2.2.3/tests/backend/backend_tests.py +3 -3
  11. {kaggle-2.2.2 → kaggle-2.2.3}/tests/run_tests.sh +2 -2
  12. {kaggle-2.2.2/tests → kaggle-2.2.3/tests/unit}/test_dataset_metadata_update.py +1 -1
  13. {kaggle-2.2.2/tests → kaggle-2.2.3/tests/unit}/test_dataset_status.py +1 -1
  14. {kaggle-2.2.2/src/kaggle/test → kaggle-2.2.3/tests/unit}/test_discussions_cli.py +99 -0
  15. {kaggle-2.2.2/tests → kaggle-2.2.3/tests/unit}/test_kernel_parsing.py +1 -1
  16. kaggle-2.2.3/tests/unit/test_kernels_logs.py +504 -0
  17. {kaggle-2.2.2/tests → kaggle-2.2.3/tests/unit}/test_kernels_pull.py +1 -1
  18. {kaggle-2.2.2/tests → kaggle-2.2.3/tests/unit}/test_quota.py +102 -1
  19. kaggle-2.2.3/tests/unit/test_team_submissions.py +182 -0
  20. {kaggle-2.2.2 → kaggle-2.2.3}/tools/releases/requirements.txt +99 -99
  21. kaggle-2.2.2/src/kaggle/models/__init__.py +0 -0
  22. kaggle-2.2.2/tests/__init__.py +0 -0
  23. kaggle-2.2.2/tests/test_kernels_logs.py +0 -281
  24. kaggle-2.2.2/tests/test_team_submissions.py +0 -96
  25. {kaggle-2.2.2 → kaggle-2.2.3}/.gcloudignore +0 -0
  26. {kaggle-2.2.2 → kaggle-2.2.3}/.gitignore +0 -0
  27. {kaggle-2.2.2 → kaggle-2.2.3}/CONTRIBUTING.md +0 -0
  28. {kaggle-2.2.2 → kaggle-2.2.3}/Dockerfile +0 -0
  29. {kaggle-2.2.2 → kaggle-2.2.3}/GEMINI.md +0 -0
  30. {kaggle-2.2.2 → kaggle-2.2.3}/LICENSE.txt +0 -0
  31. {kaggle-2.2.2 → kaggle-2.2.3}/README.md +0 -0
  32. {kaggle-2.2.2 → kaggle-2.2.3}/SECURITY.md +0 -0
  33. {kaggle-2.2.2 → kaggle-2.2.3}/docker-hatch +0 -0
  34. {kaggle-2.2.2 → kaggle-2.2.3}/docs/Makefile +0 -0
  35. {kaggle-2.2.2 → kaggle-2.2.3}/docs/benchmarks.md +0 -0
  36. {kaggle-2.2.2 → kaggle-2.2.3}/docs/competitions.md +0 -0
  37. {kaggle-2.2.2 → kaggle-2.2.3}/docs/conf.py +0 -0
  38. {kaggle-2.2.2 → kaggle-2.2.3}/docs/configuration.md +0 -0
  39. {kaggle-2.2.2 → kaggle-2.2.3}/docs/datasets.md +0 -0
  40. {kaggle-2.2.2 → kaggle-2.2.3}/docs/datasets_metadata.md +0 -0
  41. {kaggle-2.2.2 → kaggle-2.2.3}/docs/forums.md +0 -0
  42. {kaggle-2.2.2 → kaggle-2.2.3}/docs/index.rst +0 -0
  43. {kaggle-2.2.2 → kaggle-2.2.3}/docs/kernels_metadata.md +0 -0
  44. {kaggle-2.2.2 → kaggle-2.2.3}/docs/make.bat +0 -0
  45. {kaggle-2.2.2 → kaggle-2.2.3}/docs/model_variations.md +0 -0
  46. {kaggle-2.2.2 → kaggle-2.2.3}/docs/model_variations_versions.md +0 -0
  47. {kaggle-2.2.2 → kaggle-2.2.3}/docs/models.md +0 -0
  48. {kaggle-2.2.2 → kaggle-2.2.3}/docs/models_metadata.md +0 -0
  49. {kaggle-2.2.2 → kaggle-2.2.3}/docs/simulation_competitions.md +0 -0
  50. {kaggle-2.2.2 → kaggle-2.2.3}/docs/tutorials.md +0 -0
  51. {kaggle-2.2.2 → kaggle-2.2.3}/requirements-lint.in +0 -0
  52. {kaggle-2.2.2 → kaggle-2.2.3}/requirements-lint.lock +0 -0
  53. {kaggle-2.2.2 → kaggle-2.2.3}/requirements-test.in +0 -0
  54. {kaggle-2.2.2 → kaggle-2.2.3}/requirements-test.lock +0 -0
  55. {kaggle-2.2.2 → kaggle-2.2.3}/requirements.lock +0 -0
  56. {kaggle-2.2.2 → kaggle-2.2.3}/skills/SKILL.md +0 -0
  57. {kaggle-2.2.2 → kaggle-2.2.3}/skills/references/auth.md +0 -0
  58. {kaggle-2.2.2 → kaggle-2.2.3}/skills/references/benchmarks.md +0 -0
  59. {kaggle-2.2.2 → kaggle-2.2.3}/skills/references/competitions.md +0 -0
  60. {kaggle-2.2.2 → kaggle-2.2.3}/skills/references/configuration.md +0 -0
  61. {kaggle-2.2.2 → kaggle-2.2.3}/skills/references/datasets.md +0 -0
  62. {kaggle-2.2.2 → kaggle-2.2.3}/skills/references/files.md +0 -0
  63. {kaggle-2.2.2 → kaggle-2.2.3}/skills/references/forums.md +0 -0
  64. {kaggle-2.2.2 → kaggle-2.2.3}/skills/references/kernels.md +0 -0
  65. {kaggle-2.2.2 → kaggle-2.2.3}/skills/references/model_variations.md +0 -0
  66. {kaggle-2.2.2 → kaggle-2.2.3}/skills/references/model_variations_versions.md +0 -0
  67. {kaggle-2.2.2 → kaggle-2.2.3}/skills/references/models.md +0 -0
  68. {kaggle-2.2.2 → kaggle-2.2.3}/skills/references/quota.md +0 -0
  69. {kaggle-2.2.2 → kaggle-2.2.3}/src/kaggle/LICENSE +0 -0
  70. {kaggle-2.2.2 → kaggle-2.2.3}/src/kaggle/__main__.py +0 -0
  71. {kaggle-2.2.2/integration_tests → kaggle-2.2.3/src/kaggle/api}/__init__.py +0 -0
  72. {kaggle-2.2.2 → kaggle-2.2.3}/src/kaggle/api/kaggle_api.py +0 -0
  73. {kaggle-2.2.2/src/kaggle/api → kaggle-2.2.3/src/kaggle/models}/__init__.py +0 -0
  74. {kaggle-2.2.2 → kaggle-2.2.3}/src/kaggle/models/kaggle_models_extended.py +0 -0
  75. {kaggle-2.2.2 → kaggle-2.2.3}/src/kaggle/models/upload_file.py +0 -0
  76. {kaggle-2.2.2/tests → kaggle-2.2.3/tests/backend}/dataset/data.csv +0 -0
  77. {kaggle-2.2.2/tests → kaggle-2.2.3/tests/backend}/kernel/testing-x.ipynb +0 -0
  78. {kaggle-2.2.2/tests → kaggle-2.2.3/tests/backend}/model/instance/data.csv +0 -0
  79. {kaggle-2.2.2/tests → kaggle-2.2.3/tests/backend}/model/instance/version/metadata.json +0 -0
  80. {kaggle-2.2.2/tests → kaggle-2.2.3/tests/backend}/sample_submission.csv +0 -0
  81. {kaggle-2.2.2/integration_tests → kaggle-2.2.3/tests/integration}/test_models.py +0 -0
  82. {kaggle-2.2.2 → kaggle-2.2.3}/tests/test_commands.sh +0 -0
  83. {kaggle-2.2.2/src/kaggle/test → kaggle-2.2.3/tests/unit}/conftest.py +0 -0
  84. {kaggle-2.2.2/src/kaggle/test → kaggle-2.2.3/tests/unit}/test_authenticate.py +0 -0
  85. {kaggle-2.2.2/src/kaggle/test → kaggle-2.2.3/tests/unit}/test_benchmarks_cli.py +0 -0
  86. {kaggle-2.2.2/tests → kaggle-2.2.3/tests/unit}/test_retry_after.py +0 -0
  87. {kaggle-2.2.2 → kaggle-2.2.3}/tools/cicd/Dockerfile +0 -0
  88. {kaggle-2.2.2 → kaggle-2.2.3}/tools/cicd/cloudbuild.yaml +0 -0
  89. {kaggle-2.2.2 → kaggle-2.2.3}/tools/cicd/integration-tests.yaml +0 -0
  90. {kaggle-2.2.2 → kaggle-2.2.3}/tools/releases/Dockerfile +0 -0
  91. {kaggle-2.2.2 → kaggle-2.2.3}/tools/releases/cloudbuild.yaml +0 -0
  92. {kaggle-2.2.2 → kaggle-2.2.3}/tools/releases/requirements.in +0 -0
  93. {kaggle-2.2.2 → kaggle-2.2.3}/tools/use-localhost.sh +0 -0
  94. {kaggle-2.2.2 → kaggle-2.2.3}/tools/use-prod.sh +0 -0
@@ -3,6 +3,15 @@ Changelog
3
3
 
4
4
  ### Next
5
5
 
6
+ ### 2.2.3
7
+
8
+ * Update --format help text to reference output_format.md (#1074)
9
+ * Update kernel pull docs with version example (#1072)
10
+ * Reorganize tests and rename unit_tests.py to backend_tests.py (#1071)
11
+ * Add support for formatting projections (#1068)
12
+ * Rewrite `kaggle kernels logs --follow` to use SSE log stream (#999)
13
+ * Add --format option to CLI commands supporting --csv (#1062)
14
+
6
15
  ### 2.2.2
7
16
 
8
17
  * Clarify LLMS_AVAILABLE vs. full model set in benchmarks docs (#1061)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kaggle
3
- Version: 2.2.2
3
+ Version: 2.2.3
4
4
  Summary: Access Kaggle resources anywhere
5
5
  Project-URL: Homepage, https://github.com/Kaggle/kaggle-cli
6
6
  Project-URL: Issues, https://github.com/Kaggle/kaggle-cli/issues
@@ -62,6 +62,10 @@ The Kaggle CLI is organized into several command groups:
62
62
  * [Benchmarks](./benchmarks.md): Define evaluation tasks, run them against LLM models, and download results.
63
63
  * [Configuration](./configuration.md): Configure the Kaggle CLI.
64
64
 
65
+ Many commands produce output, which can be formatted for different purposes:
66
+
67
+ * [Output Format](./output_format.md): Control the format of output.
68
+
65
69
  ## Tutorials
66
70
 
67
71
  Explore these tutorials to learn how to perform common tasks:
@@ -179,7 +179,7 @@ kaggle kernels pull <KERNEL> [options]
179
179
 
180
180
  **Arguments:**
181
181
 
182
- * `<KERNEL>`: Kernel URL suffix (format: `owner/kernel-slug`, e.g., `$KAGGLE_DEVELOPER/exercise-as-with`).
182
+ * `<KERNEL>`: Kernel URL suffix (format: `owner/kernel-slug` or `owner/kernel-slug/version`, e.g., `$KAGGLE_DEVELOPER/exercise-as-with` or `$KAGGLE_DEVELOPER/exercise-as-with/2`).
183
183
 
184
184
  **Options:**
185
185
 
@@ -201,6 +201,12 @@ kaggle kernels pull <KERNEL> [options]
201
201
  kaggle kernels pull --wp $KAGGLE_DEVELOPER/exercise-as-with
202
202
  ```
203
203
 
204
+ 3. Pull version 2 of the kernel `$KAGGLE_DEVELOPER/exercise-as-with` into the current working directory:
205
+
206
+ ```bash
207
+ kaggle kernels pull --wp $KAGGLE_DEVELOPER/exercise-as-with/2
208
+ ```
209
+
204
210
  **Purpose:**
205
211
 
206
212
  This command allows you to download the source code and optionally the metadata of a kernel from Kaggle to your local machine.
@@ -0,0 +1,140 @@
1
+ # Kaggle CLI Output Formatting Documentation
2
+
3
+ This documentation describes the output formatting options available in the Kaggle CLI.
4
+
5
+ ## Output Format Options
6
+
7
+ The Kaggle CLI supports choosing the output format for various commands that list information.
8
+
9
+ ### `--csv` (or `-v`)
10
+
11
+ Historically, many commands supported a `-v` or `--csv` option to display output as comma-separated values (CSV) instead of a formatted table.
12
+
13
+ Example:
14
+ ```sh
15
+ kaggle competitions list --csv
16
+ ```
17
+
18
+ ### `--format`
19
+
20
+ We have introduced a new `--format` option to provide a unified way to specify the output format.
21
+ It accepts the following values:
22
+ * `csv`: Display output as comma-separated values.
23
+ * `table`: Display output as a formatted table (default).
24
+ * `json`: Display output as JSON.
25
+
26
+ Example:
27
+ ```sh
28
+ kaggle competitions list --format csv
29
+ kaggle competitions list --format table
30
+ kaggle competitions list --format json
31
+ ```
32
+
33
+ For most commands, the JSON output is a list of objects representing the rows, with keys corresponding to the column headers. For detailed commands like `topics show`, it returns a structured object:
34
+ ```json
35
+ {
36
+ "topic": { ... },
37
+ "comments": [ ... ]
38
+ }
39
+ ```
40
+
41
+ ### Projections (Field Selection)
42
+
43
+ The `--format` option supports optional `gcloud`-style field selection (projections) by appending a comma-separated list of fields in parentheses to the format name. This allows you to limit the output to only the specified fields and control their order.
44
+
45
+ Projections are supported for all formats (`csv`, `table`, `json`).
46
+
47
+ Example:
48
+ ```sh
49
+ # Only show 'ref' and 'reward' columns for competitions in a table
50
+ kaggle competitions list --format "table(ref,reward)"
51
+
52
+ # Export only 'id' and 'publicScore' to JSON for team submissions
53
+ kaggle competitions team-submissions --format "json(id,publicScore)" <team_id>
54
+
55
+ # Export only 'name' and 'size' to CSV for dataset files
56
+ kaggle datasets files -d zillow/zecon --format "csv(name,size)"
57
+ ```
58
+
59
+ You can specify fields using either their field names (e.g. `totalBytes`) or their display labels (e.g. `size`). If a field is not recognized, the CLI will display an error listing the allowed fields.
60
+
61
+ #### Special Case: Topics Show
62
+
63
+ For `topics show` commands, which output both a parent topic and a list of comments, the projection is applied to both types of objects. Fields matching the topic are applied to the topic output, and fields matching comments are applied to the comment output.
64
+
65
+ Example:
66
+ ```sh
67
+ kaggle forums topics show 123 --format "json(title,content)"
68
+ ```
69
+ In this case, `title` (which is a topic field) will be preserved in the topic output, and `content` (which is a comment field) will be preserved in the comments output.
70
+ ```json
71
+ {
72
+ "topic": {
73
+ "title": "Test Title"
74
+ },
75
+ "comments": [
76
+ {
77
+ "content": "Comment Content"
78
+ }
79
+ ]
80
+ }
81
+ ```
82
+
83
+ ### Mutual Exclusion
84
+
85
+ The `--csv` (or `-v`) option and the `--format` option are **mutually exclusive**. You cannot specify both at the same time.
86
+
87
+ If you attempt to use both, the CLI will display an error:
88
+ ```sh
89
+ kaggle competitions list --csv --format csv
90
+ # Error: argument --format: not allowed with argument -v/--csv
91
+ ```
92
+
93
+ ## Supported Commands
94
+
95
+ The following commands support both `--csv` (legacy) and `--format` options:
96
+
97
+ ### Competitions
98
+ * `kaggle competitions list`
99
+ * `kaggle competitions files`
100
+ * `kaggle competitions submissions`
101
+ * `kaggle competitions leaderboard`
102
+ * `kaggle competitions team-submissions`
103
+ * `kaggle competitions episodes`
104
+ * `kaggle competitions pages`
105
+ * `kaggle competitions topic-messages`
106
+ * `kaggle competitions topics list`
107
+ * `kaggle competitions topics show`
108
+
109
+ ### Datasets
110
+ * `kaggle datasets list`
111
+ * `kaggle datasets files`
112
+ * `kaggle datasets topics list`
113
+ * `kaggle datasets topics show`
114
+
115
+ ### Kernels
116
+ * `kaggle kernels list`
117
+ * `kaggle kernels files`
118
+ * `kaggle kernels topics list`
119
+ * `kaggle kernels topics show`
120
+
121
+ ### Models
122
+ * `kaggle models list`
123
+ * `kaggle models topics list`
124
+ * `kaggle models topics show`
125
+ * `kaggle models instances list`
126
+ * `kaggle models instances files`
127
+ * `kaggle models instances versions list`
128
+ * `kaggle models instances versions files`
129
+
130
+ ### Forums
131
+ * `kaggle forums list`
132
+ * `kaggle forums topics list`
133
+ * `kaggle forums topics show`
134
+
135
+ ### Benchmarks
136
+ * `kaggle benchmarks topics list`
137
+ * `kaggle benchmarks topics show`
138
+
139
+ ### Quota
140
+ * `kaggle quota`
@@ -55,9 +55,9 @@ dependencies = [
55
55
  ]
56
56
 
57
57
  [tool.hatch.envs.test.scripts]
58
- local = "source tools/use-localhost.sh; cd tests; python unit_tests.py --failfast"
59
- prod = "source tools/use-prod.sh; cd tests; python unit_tests.py --failfast"
60
- integration = "pytest integration_tests"
58
+ local = "source tools/use-localhost.sh; cd tests/backend; python backend_tests.py --failfast"
59
+ prod = "source tools/use-prod.sh; cd tests/backend; python backend_tests.py --failfast"
60
+ integration = "pytest tests/integration"
61
61
 
62
62
  [tool.hatch.envs.lint]
63
63
  detached = true
@@ -105,7 +105,6 @@ ignore_missing_imports = true
105
105
 
106
106
  [tool.pytest.ini_options]
107
107
  testpaths = [
108
- "src/kaggle/test",
109
- "tests",
108
+ "tests/unit",
110
109
  ]
111
110
  pythonpath = ["src"]
@@ -2,7 +2,7 @@
2
2
  from __future__ import absolute_import
3
3
  from kaggle.api.kaggle_api_extended import KaggleApi
4
4
 
5
- __version__ = "2.2.2"
5
+ __version__ = "2.2.3"
6
6
 
7
7
  api = KaggleApi()
8
8
  api.authenticate()