kagglehub
Access Kaggle resources anywhere
What it is and what it does
kagglehub is a Python client library that simplifies downloading and uploading Kaggle resources—datasets, models, and notebook outputs—directly from your code. It wraps the Kaggle API and provides a straightforward interface for authentication and resource management.
The library behaves differently depending on where it runs: inside a Kaggle notebook, resources are automatically attached and served from Kaggle's shared cache; outside a notebook, files are downloaded to a local cache folder. It supports multiple authentication methods (API token, environment variable, config file, Google Colab secrets) and can load datasets directly into pandas, Hugging Face, or Polars objects via optional adapters. It also handles model uploads with versioning, licensing, and file-ignore patterns.
Use it for:
- Download pre-trained models from Kaggle to use in local ML projects without manual browser downloads
- Load Kaggle competition datasets directly into pandas DataFrames or Polars for analysis in Jupyter notebooks
- Automate dataset and model retrieval in CI/CD pipelines or scheduled data processing workflows
- Upload trained models to Kaggle with version notes and licensing information for sharing with the community
- Access private or consent-gated Kaggle resources programmatically after authentication
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
kagglehub provides Python access to Kaggle datasets, models, and notebook outputs with integrated caching and native support for the Kaggle notebook environment.
Yes. kagglehub is actively maintained, has low install friction, carries a permissive Apache 2.0 license, and no known vulnerabilities. Install it if you regularly work with Kaggle datasets or models and want to automate downloads in Python code. The native Kaggle notebook integration and multi-format dataset loading (pandas, Polars, Hugging Face) make it a natural choice for data science workflows.
Install
kagglehub on PyPI
pip
pip install kagglehubuv
uv add kagglehubpoetry
poetry add kagglehubInstalling kagglehub
Before you install
Low friction installation with five runtime dependencies (kagglesdk, packaging, pyyaml, requests, tqdm). Repository is actively maintained with recent commits and moderate GitHub presence (515 stars). Requires Python 3.10 or later.
License in practice
Licensed under Apache License 2.0 (permissive). You can use, modify, and distribute the package freely in commercial and private projects, provided you include the license notice and document any changes.
Quickstart
pip install kagglehub
import kagglehub
# Authenticate (required for private/consent resources)
kagglehub.login()
# Download a model
kagglehub.model_download('google/bert/tensorFlow2/answer-equivalence-bem')
# Download a dataset
kagglehub.dataset_download('dataset-owner/dataset-name')
Requires Python 3.10 or later. Authentication requires a Kaggle account and API token (generated at https://www.kaggle.com/settings/api).
Verify before relying
- Whether optional dependencies (pandas, hugging-face, polars) are needed for specific use cases or if core functionality works without them
- Performance characteristics when downloading large models or datasets outside the Kaggle notebook environment
- Caching behavior and storage requirements for repeated downloads
Package facts
| License | Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — kagglesdk, packaging, pyyaml, requests, tqdm |
| Maintenance | actively maintained — 66 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,536,225/month — #3,014 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: kagglehub-1.0.2-py3-none-any.whl
Keywords: API, Kaggle
Tags
More Internet packages
Botocore provides low-level, data-driven access…
permissive · top 100 on PyPI
aiobotocoreProvides an async client for AWS services using…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
filelockProvides a platform-independent file locking…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
googleapis-common-protosProvides common Protocol Buffer message…
permissive · top 100 on PyPI
athina-clientA Python SDK for logging and interacting with…
permissive · top 15,000 on PyPI
kaggleCommand-line interface to interact with…
permissive · top 5,000 on PyPI
kagglesdkKagglesdk provides Python bindings to Kaggle's…
permissive · top 5,000 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
datasetsLoads and preprocesses datasets from the…
permissive · top 1,000 on PyPI
keras-hubKerasHub provides Keras 3 implementations of…
permissive · top 15,000 on PyPI
hfA command-line interface for interacting with…
permissive · top 15,000 on PyPI
spacesProvides utilities for working with Hugging…
permissive · top 15,000 on PyPI
wbdataWbdata provides a Python interface to query and…
copyleft · top 5,000 on PyPI
kedro-datasetsKedro-Datasets provides data connectors for…
permissive · top 5,000 on PyPI