Skip to content

Documentation #780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
212 changes: 212 additions & 0 deletions documentation/competitions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
# Competitions Commands

Commands for interacting with Kaggle competitions.

## `kaggle competitions list`

Lists available competitions.

**Usage:**

```bash
kaggle competitions list [options]
```

**Options:**

* `--group <GROUP>`: Filter by competition group. Valid options: `general`, `entered`, `inClass`.
* `--category <CATEGORY>`: Filter by competition category. Valid options: `all`, `featured`, `research`, `recruitment`, `gettingStarted`, `masters`, `playground`.
* `--sort-by <SORT_BY>`: Sort results. Valid options: `grouped`, `prize`, `earliestDeadline`, `latestDeadline`, `numberOfTeams`, `recentlyCreated` (default: `latestDeadline`).
* `-p, --page <PAGE>`: Page number for results (default: 1).
* `-s, --search <SEARCH_TERM>`: Search term.
* `-v, --csv`: Print results in CSV format.

**Example:**

List featured competitions in the general group, sorted by prize:

```bash
kaggle competitions list --group general --category featured --sort-by prize
```

**Purpose:**

This command helps you discover new competitions or find specific ones based on various criteria.

## `kaggle competitions files`

Lists files for a specific competition.

**Usage:**

```bash
kaggle competitions files <COMPETITION> [options]
```

**Arguments:**

* `<COMPETITION>`: Competition URL suffix (e.g., `titanic`).

**Options:**

* `-v, --csv`: Print results in CSV format.
* `-q, --quiet`: Suppress verbose output.
* `--page-token <PAGE_TOKEN>`: Page token for results paging.
* `--page-size <PAGE_SIZE>`: Number of items to show on a page (default: 20, max: 200).

**Example:**

List the first 3 files for the "titanic" competition in CSV format, quietly:

```bash
kaggle competitions files titanic --page-size=3 -v -q
```

**Purpose:**

Use this command to see the data files available for a competition before downloading them.

## `kaggle competitions download`

Downloads competition files.

**Usage:**

```bash
kaggle competitions download <COMPETITION> [options]
```

**Arguments:**

* `<COMPETITION>`: Competition URL suffix (e.g., `titanic`).

**Options:**

* `-f, --file <FILE_NAME>`: Specific file to download (downloads all if not specified).
* `-p, --path <PATH>`: Folder to download files to (defaults to current directory).
* `-w, --wp`: Download files to the current working path (equivalent to `-p .`).
* `-o, --force`: Force download, overwriting existing files.
* `-q, --quiet`: Suppress verbose output.

**Examples:**

1. Download all files for the "titanic" competition to the current directory, overwriting existing files, quietly:

```bash
kaggle competitions download titanic -w -o -q
```

2. Download the `test.csv` file from the "titanic" competition to a folder named `tost`:

```bash
kaggle competitions download titanic -f test.csv -p tost
```

**Purpose:**

This command allows you to get the necessary data files for a competition onto your local machine.

## `kaggle competitions submit`

Makes a new submission to a competition.

**Usage:**

```bash
kaggle competitions submit <COMPETITION> -f <FILE_NAME> -m <MESSAGE> [options]
```

**Arguments:**

* `<COMPETITION>`: Competition URL suffix (e.g., `house-prices-advanced-regression-techniques`).
* `-f, --file <FILE_NAME>`: The submission file.
* `-m, --message <MESSAGE>`: The submission message.

**Options:**

* `-k, --kernel <KERNEL>`: Name of the kernel (notebook) to submit (for code competitions).
* `-v, --version <VERSION>`: Version of the kernel to submit.
* `-q, --quiet`: Suppress verbose output.

**Example:**

Submit `sample_submission.csv` to the "house-prices-advanced-regression-techniques" competition with the message "Test message":

```bash
kaggle competitions submit house-prices-advanced-regression-techniques -f sample_submission.csv -m "Test message"
```

**Purpose:**

Use this command to upload your predictions or code to a competition for scoring.

## `kaggle competitions submissions`

Shows your past submissions for a competition.

**Usage:**

```bash
kaggle competitions submissions <COMPETITION> [options]
```

**Arguments:**

* `<COMPETITION>`: Competition URL suffix (e.g., `house-prices-advanced-regression-techniques`).

**Options:**

* `-v, --csv`: Print results in CSV format.
* `-q, --quiet`: Suppress verbose output.

**Example:**

Show submissions for "house-prices-advanced-regression-techniques" in CSV format, quietly:

```bash
kaggle competitions submissions house-prices-advanced-regression-techniques -v -q
```

**Purpose:**

This command allows you to review your previous submission attempts and their scores.

## `kaggle competitions leaderboard`

Gets competition leaderboard information.

**Usage:**

```bash
kaggle competitions leaderboard <COMPETITION> [options]
```

**Arguments:**

* `<COMPETITION>`: Competition URL suffix (e.g., `titanic`).

**Options:**

* `-s, --show`: Show the top of the leaderboard in the console.
* `-d, --download`: Download the entire leaderboard to a CSV file.
* `-p, --path <PATH>`: Folder to download the leaderboard to (if `-d` is used).
* `-v, --csv`: Print results in CSV format (used with `-s`).
* `-q, --quiet`: Suppress verbose output.

**Examples:**

1. Download the "titanic" leaderboard to a folder named `leaders`, quietly:

```bash
kaggle competitions leaderboard titanic -d -p leaders -q
```

2. Download the leaderboard and save it to `leaderboard.txt`:

```bash
kaggle competitions leaderboard titanic > leaderboard.txt
```

**Purpose:**

This command lets you view your ranking and the scores of other participants in a competition.
89 changes: 89 additions & 0 deletions documentation/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Kaggle CLI Configuration

The Kaggle CLI uses a configuration file to store settings such as your API credentials and default values for commands.

## Configuration Commands

### `config view`

Displays the current configuration values.

**Usage:**

```bash
kaggle config view
```

**Purpose:**

This command allows you to inspect the current settings of your Kaggle CLI, such as the configured API endpoint, proxy settings, and default competition.

### `config set`

Sets a specific configuration value.

**Usage:**

```bash
kaggle config set -n <NAME> -v <VALUE>
```

**Arguments:**

* `-n, --name <NAME>`: The name of the configuration parameter to set. Valid options are `competition`, `path`, and `proxy`.
* `-v, --value <VALUE>`: The value to set for the configuration parameter.
* For `competition`: The competition URL suffix (e.g., `titanic`).
* For `path`: The default folder where files will be downloaded.
* For `proxy`: The proxy server URL.

**Example:**

Set the default competition to "titanic":

```bash
kaggle config set -n competition -v titanic
```

**Purpose:**

Use this command to customize the behavior of the Kaggle CLI, such as setting a default competition to avoid specifying it in every command, defining a default download path, or configuring a proxy server.

### `config unset`

Clears a specific configuration value, reverting it to its default.

**Usage:**

```bash
kaggle config unset -n <NAME>
```

**Arguments:**

* `-n, --name <NAME>`: The name of the configuration parameter to clear. Valid options are `competition`, `path`, and `proxy`.

**Example:**

Clear the default competition:

```bash
kaggle config unset -n competition
```

**Purpose:**

This command removes a previously set configuration value, allowing the CLI to use its default behavior or prompt for the value if required.

## Configuration File Location

The Kaggle CLI configuration is typically stored in a file named `kaggle.json` located in the `~/.kaggle/` directory on Linux and macOS, or `C:\Users\<Windows-username>\.kaggle\` on Windows.

This file contains your API username and key:

```json
{"username":"YOUR_USERNAME","key":"YOUR_API_KEY"}
```

You can download this file from your Kaggle account page (`https://www.kaggle.com/<YOUR_USERNAME>/account`) and place it in the correct directory.

Alternatively, you can set the `KAGGLE_USERNAME` and `KAGGLE_KEY` environment variables.
Loading