Skip to content

Add --format option to CLI commands supporting --csv#1062

Open
stevemessick wants to merge 2 commits into
mainfrom
add-format-option
Open

Add --format option to CLI commands supporting --csv#1062
stevemessick wants to merge 2 commits into
mainfrom
add-format-option

Conversation

@stevemessick

Copy link
Copy Markdown
Contributor

Add --format option to CLI commands supporting --csv

This change introduces a new --format option to all Kaggle CLI commands
that previously supported the --csv option. The --format option
accepts 'csv', 'table', or 'json' as values.

The --csv and --format options are mutually exclusive.

Internally, the KaggleApi class has been updated to use a new OutputFormat
enum and _get_output_format helper method to resolve the desired output
format. All _cli methods have been updated to branch based on this enum.
Currently, 'json' format prints a 'not yet implemented' warning.

Added tests for argparse validation and output formatting.
Updated documentation with examples.

TAG=agy
CONV=8eb2e998-74be-49e0-8f0f-e84eaad7bda0

This change introduces a new `--format` option to all Kaggle CLI commands
that previously supported the `--csv` option. The `--format` option
accepts 'csv', 'table', or 'json' as values.

The `--csv` and `--format` options are mutually exclusive.

Internally, the `KaggleApi` class has been updated to use a new `OutputFormat`
enum and `_get_output_format` helper method to resolve the desired output
format. All `_cli` methods have been updated to branch based on this enum.
Currently, 'json' format prints a 'not yet implemented' warning.

Added tests for argparse validation and output formatting.
Updated documentation with examples.

TAG=agy
CONV=8eb2e998-74be-49e0-8f0f-e84eaad7bda0
@stevemessick stevemessick requested a review from rosbo June 12, 2026 19:13
@stevemessick

Copy link
Copy Markdown
Contributor Author

First phase of adding JSON format: allow the option but don't implement the new format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant