Skip to main content

A package to download datasets from Kaggle.

Project description

KaggleDownloader

KaggleDownloader is a Python package designed to simplify the process of downloading and extracting datasets from Kaggle. With this package, you can search for datasets by theme, authenticate your Kaggle account, download any available dataset, and extract the contents of zip files, all with a simple interface.

Features

  • Authenticate with Kaggle: Easily authenticate using your Kaggle API credentials.
  • Search for Datasets: Search for datasets on Kaggle based on specific themes.
  • Download Datasets: Download any dataset from Kaggle using its slug.
  • Extract Zip Files: Extract the contents of zip files downloaded from Kaggle.
  • Directory Management: Automatically create directories to store datasets if they don't exist.

Installation

First, install the package using Poetry. Make sure you have Poetry installed.

poetry install

Usage

You can use KaggleDownloader through the command line. Here’s an example:

python -m kaggle_downloader <dataset_slug> --path <download_path>

Replace <dataset_slug> with the identifier of the Kaggle dataset and <download_path> with the location where you want the dataset to be saved.

Example:

python -m kaggle_downloader zynicide/wine-reviews --path ./datasets

Methods

Authentication

The method authenticate_kaggle() allows you to authenticate with your Kaggle account by providing the path to your kaggle.json file, which contains your API credentials.

Searching for Datasets

The method search_datasets(dataset_theme) allows you to search for datasets on Kaggle related to a specific theme.

Downloading Datasets

The method download_dataset(dataset_slug, path) allows you to download a dataset by providing its Kaggle slug and specifying the location to save it.

Extracting Zip Files

The method extract_zip(zip_path, extract_to) enables you to extract the contents of a zip file. If the file is not a valid zip or doesn’t exist, an error is raised.

Contributing

Feel free to contribute to this project by submitting issues, feature requests, or pull requests on GitHub.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Author

Mariano Gobea Alcoba
Email: gobeamariano@gmail.com

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_downloader_package-0.1.2.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file kaggle_downloader_package-0.1.2.tar.gz.

File metadata

  • Download URL: kaggle_downloader_package-0.1.2.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.3 Darwin/23.5.0

File hashes

Hashes for kaggle_downloader_package-0.1.2.tar.gz
Algorithm Hash digest
SHA256 97c92c3ea22a03d1305ff81a3dcd64cae49a21b32c3cde0df925b51ee6d42175
MD5 0015a59374d923c4a6a5c79c48b36b0c
BLAKE2b-256 2e0d1b002061a7623b2900f34942affa5f4a5b0aa15cfc96df9ff73f7ee682eb

See more details on using hashes here.

File details

Details for the file kaggle_downloader_package-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for kaggle_downloader_package-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 360298b1a0d5d2417df7f870459a7c614d552ab0d46ec142e516b39e5a5a201e
MD5 52ca3f6c9b46184072870b1265d778cf
BLAKE2b-256 96a9bebcb2ff3e5181a497c5c688b67b7bc61482197cdc369e267ea8c3f61145

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