Skip to main content

Access Kaggle resources anywhere

Project description

Kaggle API

Official API for https://www.kaggle.com, accessible using a command line tool implemented in Python 3.

User documentation

Installation

Ensure you have Python 3 and the package manager pip installed.

Run the following command to access the Kaggle API using the command line:

pip install kaggle

Development

Prerequisites

We use hatch to manage this project.

Follow these instructions to install it.

Dependencies

hatch run install-deps

Compile

hatch run compile

The compiled files are generated in the kaggle/ directory from the src/ directory.

All the changes must be done in the src/ directory.

Run

You can also run the code in python directly:

hatch run python
import kaggle_waggle
from kaggle_waggle.api.kaggle_api_extended import KaggleApi
api = KaggleApi()
api.authenticate()
api.model_list_cli()

Next Page Token = [...]
[...]

Or in a single command:

hatch run python -c "import kaggle_waggle; from kaggle_waggle.api.kaggle_api_extended import KaggleApi; api = KaggleApi(); api.authenticate(); api.model_list_cli()"

Example

Let's change the model_list_cli method in the source file:

 git diff src/kaggle/api/kaggle_api_extended.py
[...]
+        print('hello Kaggle CLI update')^M
         models = self.model_list(sort_by, search, owner, page_size, page_token)
[...] hatch run compile
[...] hatch run python -c "import kaggle_waggle; from kaggle_waggle.api.kaggle_api_extended import KaggleApi; api = KaggleApi(); api.authenticate(); api.model_list_cli()"
hello Kaggle CLI update
Next Page Token = [...]

Integration Tests

To run integration tests on your local machine, you need to set up your Kaggle API credentials. You can do this in one of these two ways described this doc. Refer to the sections:

  • Using environment variables
  • Using credentials file

After setting up your credentials by any of these methods, you can run the integration tests as follows:

# Run all tests
hatch run integration-test

License

The Kaggle API is released under the Apache 2.0 license.

Project details


Download files

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

Source Distribution

kaggle_waggle-1.6.12a5.tar.gz (24.5 MB view details)

Uploaded Source

Built Distribution

kaggle_waggle-1.6.12a5-py3-none-any.whl (53.2 kB view details)

Uploaded Python 3

File details

Details for the file kaggle_waggle-1.6.12a5.tar.gz.

File metadata

  • Download URL: kaggle_waggle-1.6.12a5.tar.gz
  • Upload date:
  • Size: 24.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for kaggle_waggle-1.6.12a5.tar.gz
Algorithm Hash digest
SHA256 3833a60b95258c76f0e33c070e1ef04c59de0eb98d5d833a5a6f0edf9ce5bd8a
MD5 4ac0b6741bd56ef87b892ed26f116d11
BLAKE2b-256 acb3d468af2a53a9512bc8c9e0c57243ed3b7905399638a26dd42f2287e4dc3a

See more details on using hashes here.

File details

Details for the file kaggle_waggle-1.6.12a5-py3-none-any.whl.

File metadata

File hashes

Hashes for kaggle_waggle-1.6.12a5-py3-none-any.whl
Algorithm Hash digest
SHA256 1be14beea2dd3334808237b45339d051dcf19ab358b9d7178afbe4dc9723ef99
MD5 16c53f13b493c2f1bd9dcb7d3fd1e3c3
BLAKE2b-256 e0f4d0dea697ccca1992411b91863ee8c1f95fd5d9fce820acb9c9f488d84e3a

See more details on using hashes here.

Supported by

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