Skip to main content

Access Kaggle resources anywhere

Project description

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.

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

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.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kaggle-2.2.3.tar.gz (245.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kaggle-2.2.3-py3-none-any.whl (111.5 kB view details)

Uploaded Python 3

File details

Details for the file kaggle-2.2.3.tar.gz.

File metadata

  • Download URL: kaggle-2.2.3.tar.gz
  • Upload date:
  • Size: 245.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.2

File hashes

Hashes for kaggle-2.2.3.tar.gz
Algorithm Hash digest
SHA256 ce292c459a13950553d894ee7368d6454be53291bd75c2d27ad2bed149cdd6c4
MD5 ade809b7021d199c28ae7792e3ffa919
BLAKE2b-256 97cf2e5b5e0710844ce78fbdae4630527f8e2c23c0851c0a215404b8a6c981b0

See more details on using hashes here.

File details

Details for the file kaggle-2.2.3-py3-none-any.whl.

File metadata

  • Download URL: kaggle-2.2.3-py3-none-any.whl
  • Upload date:
  • Size: 111.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.2

File hashes

Hashes for kaggle-2.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 535eed6612910979ff3025f9c213207718305d47ab5f263fe74acd735c7e902e
MD5 7ce8a9ca5fc23c59e4a246de1363080e
BLAKE2b-256 034624e3db0c32cd3e089816bd605ab39fae72a0ae688c677cc9b056789c5f3c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page