LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

kaggle-datasets

manages Kaggle datasets from the command line

TLDR

Search datasets
$ kaggle datasets list -s "[search term]"
copy
List your own datasets
$ kaggle datasets list -m
copy
List files in a dataset
$ kaggle datasets files [owner/dataset-name]
copy
Download and unzip a dataset into a folder
$ kaggle datasets download [owner/dataset-name] -p [path] --unzip
copy
Download a single file
$ kaggle datasets download [owner/dataset-name] -f [file.csv]
copy
Generate a metadata template for a new dataset
$ kaggle datasets init -p [path]
copy
Create a new public dataset from a folder
$ kaggle datasets create -p [path] --public
copy
Upload a new version
$ kaggle datasets version -p [path] -m "[version notes]"
copy

SYNOPSIS

kaggle datasets subcommand [options]

DESCRIPTION

kaggle datasets manages Kaggle datasets from the command line. Part of the official Kaggle CLI, it allows browsing, downloading, and publishing datasets for machine learning projects.Datasets are referenced as owner/dataset-name, the suffix of the dataset URL on kaggle.com. Publishing requires a dataset-metadata.json file (created by init) with a title, slug and license.

PARAMETERS

-s, --search TERM

Search term (list).
-m, --mine
Show only your datasets (list).
--user USER
Filter by user or organization (list).
--sort-by FIELD
Sort by hottest, votes, updated or active (list).
--file-type TYPE
Filter by all, csv, sqlite, json or bigQuery (list).
--min-size, --max-size BYTES
Filter by dataset size (list).
-v, --csv
Print results in CSV format.
-f, --file NAME
Download only this file (download).
-p, --path PATH
Download destination, or folder with data and metadata (default: current directory).
--unzip
Unzip the downloaded archive and delete the zip (download).
-o, --force
Overwrite existing files (download).
-u, --public
Make a new dataset public; the default is private (create).
-m, --message NOTES
Version notes, required (version).
-r, --dir-mode MODE
Handle subdirectories: skip, zip or tar (create, version).
-t, --keep-tabular
Do not convert tabular files to CSV (create, version).
-d, --delete-old-versions
Delete previous versions (version).
-q, --quiet
Suppress verbose output.

COMMANDS

list

Search and list datasets.
files DATASET
List files in a dataset.
download DATASET
Download dataset files as a zip archive, or a single file with -f.
init
Create a dataset-metadata.json template in a folder.
create
Create a new dataset from a folder containing data files and dataset-metadata.json.
version
Upload a new version of an existing dataset.
metadata DATASET
Download metadata to dataset-metadata.json, or push local edits with --update.
status DATASET
Show the processing status of a dataset.
delete DATASET
Delete a dataset.
topics list|show
Browse discussion topics of a dataset.

INSTALL

nix profile install nixpkgs#kaggle
copy

CAVEATS

Requires Kaggle API credentials (see kaggle config). Older releases took the dataset with -d; current versions accept it as a positional argument. By default subdirectories are skipped on upload unless -r zip or -r tar is given.

SEE ALSO

RESOURCES

Copied to clipboard
Kai