LinuxCommandLibrary

kaggle

Download and submit Kaggle datasets/competitions

TLDR

View current configuration values

$ kaggle config view
copy

Download a specific file from a competition dataset
$ kaggle [[c|competitions]] download [competition] [[-f|--file]] [path/to/file]
copy

List competitions matching a search term
$ kaggle [[c|competitions]] list [[-s|--search]] [search_term]
copy

List files available for a specific competition
$ kaggle [[c|competitions]] files [competition]
copy

Submit a file to a competition with a message
$ kaggle [[c|competitions]] submit [competition] [[-f|--file]] [path/to/submission.csv] [[-m|--message]] "[message]"
copy

List datasets matching a search term
$ kaggle [[d|datasets]] list [[-s|--search]] [search_term]
copy

Download all files from a dataset
$ kaggle [[d|datasets]] download [owner]/[dataset_name]
copy

List kernels (notebooks) matching a search term
$ kaggle [[k|kernels]] list [[-s|--search]] [search_term]
copy

SYNOPSIS

kaggle {api,clients,competitions,config,course,credentials,datasets,kernels,models,publish,translate} ... [-h] [-v] [-q] [-V] [--debug]

PARAMETERS

-h, --help
    Show help message and exit

-v, --version
    Show program's version number and exit

-q, --quiet
    Suppress non-error messages

-V, --verbose
    Enable verbose output

--debug
    Enable debug output (implies verbose)

DESCRIPTION

The kaggle command is the official CLI tool for interacting with the Kaggle platform, a hub for data science competitions, datasets, notebooks, and models. It allows users to manage datasets, competitions, kernels, and more via Kaggle's REST API without a web browser.

Key features include listing public/private datasets with kaggle datasets list, downloading them with kaggle datasets download, submitting competition entries via kaggle competitions submit, and pushing notebooks with kaggle kernels push. It supports authentication through a JSON API token, handles file uploads/downloads, and provides verbose/quiet modes for output control.

Prior to installation (pip install kaggle), users must generate an API token from their Kaggle account settings (under 'Account' > 'Create New API Token'), save it as ~/.kaggle/kaggle.json, and secure it with chmod 600 ~/.kaggle/kaggle.json. The tool is Python-based, cross-platform, and actively maintained, making it essential for automating workflows in machine learning pipelines.

CAVEATS

Requires kaggle Python package and valid API token in ~/.kaggle/kaggle.json (permissions 600). Subject to Kaggle API rate limits. Large file uploads/downloads may require sufficient bandwidth/disk space. Not all features available for private resources without proper access.

AUTHENTICATION SETUP

Download kaggle.json from Kaggle account > API > 'Create New Token'. Move to ~/.kaggle/ and run chmod 600 ~/.kaggle/kaggle.json.

COMMON EXAMPLES

kaggle datasets list - List public datasets
kaggle competitions download -c titanic - Download Titanic data
kaggle kernels pull user/notebook - Pull a kernel.

SUBCOMMANDS OVERVIEW

Core: datasets (list/download/create), competitions (submit/download/leaderboard), kernels (push/pull/list), models (create/push). Utilities: config, credentials.

HISTORY

Released in 2018 by the Kaggle team (Google-owned since 2017) to simplify API access beyond HTTP requests. Initial versions focused on datasets/competitions; later updates (v1.5+ in 2020s) added kernels, models, private dataset support, and bug fixes for Python 3. Evolved with platform features like Courses and Translate.

SEE ALSO

curl(1), wget(1), pip(1)

Copied to clipboard