Add --format option to CLI commands supporting --csv#1062
Open
stevemessick wants to merge 2 commits into
Open
Conversation
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
Contributor
Author
|
First phase of adding JSON format: allow the option but don't implement the new format. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add --format option to CLI commands supporting --csv
This change introduces a new
--formatoption to all Kaggle CLI commandsthat previously supported the
--csvoption. The--formatoptionaccepts 'csv', 'table', or 'json' as values.
The
--csvand--formatoptions are mutually exclusive.Internally, the
KaggleApiclass has been updated to use a newOutputFormatenum and
_get_output_formathelper method to resolve the desired outputformat. All
_climethods 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