kaggle
Download and submit Kaggle datasets/competitions
TLDR
View current configuration values
Download a specific file from a competition dataset
SYNOPSIS
kaggle command [options] [arguments]
Where command is one of the main functionalities (e.g., datasets, competitions, kernels), each having its own subcommands and options.
PARAMETERS
datasets
Interact with Kaggle datasets (download, upload, list, create, etc.).
competitions
Manage Kaggle competitions (download data, submit predictions, list, etc.).
kernels
Work with Kaggle notebooks/kernels (push, pull, run, list, etc.).
models
Interact with Kaggle models (download, upload, list, etc.).
config
Manage Kaggle API configuration settings (e.g., proxy settings).
--version
Display the Kaggle API client version.
--help / -h
Show help message for the command or subcommand.
DESCRIPTION
The kaggle command is a powerful command-line interface (CLI) tool that allows users to interact directly with the Kaggle platform without needing to use the website. It's a Python package that provides functionalities to download datasets, submit to competitions, create and manage Kaggle notebooks (kernels), interact with Kaggle models, and manage configuration settings. This CLI is invaluable for data scientists, machine learning engineers, and researchers who frequently work with Kaggle, enabling automation of common tasks like downloading large datasets, fetching competition details, or submitting predictions directly from their local development environment or servers. It streamlines workflows, making it easier to integrate Kaggle activities into scripts and automated pipelines.
CAVEATS
Using the kaggle command requires a valid Kaggle API token (kaggle.json) to be correctly placed in the `~/.kaggle/` directory (or equivalent for Windows).
All operations require active internet connectivity.
Downloading large datasets can consume significant disk space and bandwidth.
Specific subcommand options and arguments can be complex; users should consult `kaggle command --help` for detailed usage instructions.
AUTHENTICATION
To use the kaggle command, you need to authenticate with the Kaggle API. This involves generating an API token (a `kaggle.json` file) from your Kaggle account settings (Profile -> Account -> 'Create New API Token') and placing it in the correct directory:
For Linux/macOS: `~/.kaggle/kaggle.json`
For Windows: `C:\Users\
INSTALLATION
The kaggle CLI is installed as a Python package using `pip`. It typically requires Python 3.6 or later: pip install kaggle
HISTORY
The kaggle command-line interface is distributed as part of the `kaggle` Python package. It was developed by Kaggle itself to provide a more direct and programmatic way for users to interact with the platform's vast resources. Its development has focused on simplifying common tasks for data scientists, allowing for easier integration into automated scripts and workflows, and reducing reliance on the web UI for repetitive actions. The CLI has evolved with the Kaggle platform, adding support for new features like Kaggle Models and expanding capabilities for datasets and notebooks.