Skip to main content

Kaggle CLI

The official CLI to interact with Kaggle.


User documentation


Key Features

Some of the key features are:

  • List competitions, download competition data, submit to a competition.
  • List, create, update, download or delete datasets.
  • List, create, update, download or delete models & model variations.
  • List, update & run, download code & output or delete kernels (notebooks).
  • Browse and read discussion forums.

Installation

Install the kaggle package with pip:

pip install kaggle

Additional installation instructions can be found here.

Quick start

Explore the available commands by running:

kaggle --help

See the User documentation for more examples & tutorials.

Hosting a competition

End-to-end host commands — scaffold a new competition, author its pages, tune its settings, and launch it — are documented in docs/competition_creation.md. Covers kaggle competitions init, create, pages create, hosts, settings get, settings update, and launch.

Development

kagglesdk Updates

New features that interact with kaggle.com probably require changes to the Python library, kagglesdk. Make sure to bump the minimum version required for kagglesdk in the dependencies list specified in [pyproject.toml][pyproject.toml]]. Make sure the required version is available on the pypi.org kagglesdk project.

Prerequisites

We use hatch to manage this project.

Follow these instructions to install it.

Run kaggle from source

Option 1: Execute a one-liner of code from the command line

hatch run kaggle datasets list

Option 2: Run many commands in a shell

hatch shell

# Inside the shell, you can run many commands
kaggle datasets list
kaggle competitions list
...

Lint / Format

# Lint check
hatch run lint:style
hatch run lint:typing
hatch run lint:all     # for both

# Format
hatch run lint:fmt

Tests

Note: These tests are not true unit tests and are calling the Kaggle web server.

# Run against kaggle.com
hatch run test:prod

# Run against a local web server (Kaggle engineers only)
hatch run test:local

Integration Tests

To run integration tests on your local machine, you need to set up your Kaggle credentials. You can do this by following the authentication instructions.

After setting up your credentials, you can run the integration tests as follows:

hatch run test:integration

Code Coverage

We measure code coverage using pytest-cov.

To run unit tests with coverage and generate reports:

hatch run test:cov

This generates:

  • Terminal output with a coverage summary.
  • coverage.xml (XML report in the root, used by IDE integrations).
  • htmlcov/index.html (HTML report for browser viewing).

Editor Integration

VSCode

Install the Coverage Gutters extension. After running the coverage command, click the Watch button in the status bar to see coverage indicators in the editor margins.

JetBrains Rider

With the Python plugin installed:

  • Run with Coverage: Create a Pytest run configuration and click the shield icon ("Run with Coverage").
  • Import Report: Go to Tools -> Show Code Coverage Data, click Add (+), and select coverage.xml.

Running hatch commands inside Docker

This is useful to run in a consistent environment and easily switch between Python versions.

The following shows how to run hatch run lint:all but this also works for any other hatch commands:

# Use default Python version
./docker-hatch run lint:all

Changelog

See CHANGELOG.

Contributing

See CONTRIBUTING.md.

License

The Kaggle CLI is released under the Apache 2.0 license.

Metadata

Release files for kaggle 2.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kaggle 2.2.4
File Size Uploaded
kaggle-2.2.4.tar.gz 317.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kaggle 2.2.4
File Interpreter ABI Platform
kaggle-2.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 443.2 kB

Release files / kaggle-2.2.4.tar.gz

Download URL kaggle-2.2.4.tar.gz
Size 317.1 kB
Tags Source
SHA-256 checksum
How to use checksums
28a58f6c1b9f46ce2afdfb439e0c4e91219e818b377ea4254f4e479456d8cb78
BLAKE2b-256 checksum
How to use checksums
8d229e4d5015aad7c7794af098e3def53a26a7deae3ee2e348c129bc2446260e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.2

Release files / kaggle-2.2.4-py3-none-any.whl

Download URL kaggle-2.2.4-py3-none-any.whl
Size 126.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
47d3b258363f4693ade67d875b1c108bfaa87a469f4b6fe85903e7c9757aa09c
BLAKE2b-256 checksum
How to use checksums
6d0b79bbabb2b3f7eaee3bcde7397abf29bbdd8694886f45bef460fca5d71729
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.2

Release history Release notifications | RSS feed

This release

2.2.4 This release

2 release files

2.2.3

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.8.4

2 release files

1.8.3

2 release files

1.8.2

2 release files

1.8.0

2 release files

1.7.4

2 release files

1.6.17

1 release file

1.6.15

1 release file

1.6.14

1 release file

1.6.12

1 release file

1.6.11

1 release file

1.6.10

1 release file

1.6.9

1 release file

1.6.8

1 release file

1.6.6

1 release file

1.6.5

1 release file

1.6.4

1 release file

1.6.3

1 release file

1.6.2

1 release file

1.6.1

1 release file

1.6.0

1 release file

1.5.16

1 release file

1.5.15

1 release file

1.5.14

1 release file

1.5.13

1 release file

1.5.12

1 release file

1.5.10

1 release file

1.5.9

1 release file

1.5.8

1 release file

1.5.7

1 release file

1.5.6

1 release file

1.5.5

1 release file

1.5.4

1 release file

1.5.3

1 release file

1.5.2

1 release file

1.5.1

1 release file

1.5.0

1 release file

1.4.7.1

1 release file

1.4.7

1 release file

1.4.6

1 release file

1.4.5

1 release file

1.4.4

1 release file

1.4.3

1 release file

1.4.2

1 release file

1.4.1

1 release file

1.4.0

1 release file

1.3.12

1 release file

1.3.11

1 release file

1.3.10

1 release file

1.3.9

1 release file

1.3.8

1 release file

1.3.7

1 release file

1.3.6

1 release file

1.3.5

1 release file

1.3.4

1 release file

1.3.3

1 release file

1.3.2.1

1 release file

1.3.2

1 release file

1.3.1

1 release file

1.3.0

1 release file

1.2.1

1 release file

1.1.0

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page