Skip to content

Latest commit

 

History

History
66 lines (43 loc) · 2.87 KB

File metadata and controls

66 lines (43 loc) · 2.87 KB

Kaggle CLI Documentation

Welcome to the Kaggle CLI documentation. This guide provides detailed information on how to use the Kaggle command-line interface to interact with Kaggle's platform.

Installation

Note: Ensure you have Python 3.11+ and the package manager pip installed.

Install the kaggle package with pip:

pip install kaggle

If you run into a Command kaggle not found error, ensure that your Python executable scripts are in your $PATH. For a local user install on Linux, the default location is ~/.local/bin. On Windows, the default location is $PYTHON_HOME/Scripts.

Authentication

First, you will need a Kaggle account. You can sign up here.

After login, you can download your Kaggle API credentials at https://www.kaggle.com/settings by clicking on the "Generate New Token" button under the "API" section.

Option 1: Environment variable

export KAGGLE_API_TOKEN=xxxxxxxxxxxxxx # Copied from the settings UI

Option 2: API token file

Store your Kaggle API token obtained from your Kaggle account settings page in a file at ~/.kaggle/access_token.

Option 3: Legacy API credentials file

From your Kaggle account settings page, under "Legacy API Credentials", click on the "Create Legacy API Key" button to generate a kaggle.json file and store it at ~/.kaggle/kaggle.json.

CLI Usage

Run the following command to list the available commands:

kaggle --help

The Kaggle CLI is organized into several command groups:

Tutorials

Explore these tutorials to learn how to perform common tasks: