kaggle-dataset-pipelines
Lint your Kaggle dataset before you upload it, plus the build scripts behind six public Kaggle datasets.
kaggle-dataset-lint
Kaggle accepts a dataset-metadata.json that is subtly wrong and then shows a broken dataset page. Four examples;
all but the cover crop were found in published datasets:
- Column descriptions on the wrong columns. Kaggle matches schema fields to columns by position, so two swapped fields shift the descriptions without any error.
- Text that disappears. Kaggle's renderer drops unknown HTML tags, so
ng_<source>_mwin a description shows asng__mw. - A cover that shows only its corner. The Kaggle CLI always crops the top-left 560x280 pixels, whatever the image size.
- Garbled text from Windows. The CLI reads
dataset-metadata.jsonwith the system encoding, so on most Windows machines a×in a UTF-8 description reaches Kaggle as two other characters. SetPYTHONUTF8=1before uploading.
pip install kaggle-dataset-lint
kaggle-dataset-lint path/to/my-dataset # the folder you pass to `kaggle datasets create -p`
No dependencies: it is a single standard-library file, so you can also just download
src/kaggle_dataset_lint.py and run python kaggle_dataset_lint.py my-dataset.
Install pyarrow too if you want Parquet columns checked.
my-dataset/dataset-metadata.json: error: [title-length] title is 51 characters; Kaggle allows 6-50
my-dataset/dataset-metadata.json: warning: [html-stripped] description contains <unit>: Kaggle's renderer drops unknown HTML tags, so the text disappears (`ng_<source>_mw` shows as `ng__mw`). Write {unit} or <unit>
my-dataset/dataset-metadata.json: warning: [cover-cropped] dataset-cover-image.png is 1600x800, but the Kaggle CLI always crops the top-left 560x280 pixels for the header and a 280x280 square at x=140 for the thumbnail. Resize it to 560x280, or set the cover in the web UI
my-dataset/dataset-metadata.json: error: [schema-mismatch] readings.csv: schema fields must list every column in file order, or Kaggle attaches the descriptions to the wrong columns (first difference at position 1: schema has 'station', file has 'time')
my-dataset/dataset-metadata.json: warning: [file-undeclared] no resource entry (so no file or column descriptions) for: notes.txt
my-dataset/dataset-metadata.json: warning: [subfolder-skipped] raw/ is skipped by `kaggle datasets create/version` unless you pass --dir-mode zip or tar
2 error(s), 4 warning(s) in 1 dataset(s)
What it checks
| Level | Checks |
|---|---|
| Error: Kaggle rejects it, or the page comes out wrong | title 6-50 characters, subtitle 20-80, exactly one license, id is owner/slug (no INSERT_..._HERE placeholders), valid expectedUpdateFrequency, every declared file exists and is declared once, schema fields list every column in file order (CSV, TSV, Parquet), cover is .png/.jpg/.jpeg/.webp and at least 560x280 |
| Warning: silent problems and incomplete pages | <word> placeholders Kaggle strips, covers the CLI crops to a corner, subfolders kaggle datasets create/version skips, non-ASCII text the CLI would garble because it reads the file with the system encoding (cp1252 on most Windows machines), files and columns without descriptions, missing subtitle, description, tags, sources, update frequency or cover image, slugs kaggle datasets create rejects |
| Note: worth a look, never fails | license names that aren't in Kaggle's documented ids, column types outside Kaggle's best-effort list |
The rules come from the Kaggle CLI source and its
dataset metadata docs. It also reads the
{"info": ...} layout that kaggle datasets metadata downloads.
Options
--strict: exit 1 on warnings as well as errors.--no-files: check only the metadata, not data files or the cover.--ignore cover-missing,keywords-missing: skip findings by code.--format github: print GitHub Actions annotations.
In CI or pre-commit
With the GitHub Action, findings show up as annotations on the metadata file and as a table in the job summary. It runs on the runner's own Python 3.10+ and installs nothing.
# .github/workflows/kaggle-dataset-lint.yml
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: tb91117/kaggle-dataset-pipelines@v0
with:
paths: data/my-dataset # optional: one per line; empty checks every dataset-metadata.json in the repo
strict: "false" # optional: "true" fails on warnings too
ignore: cover-missing # optional: finding codes to skip
The step's errors and warnings outputs hold the counts. Without the Action:
- run: pip install kaggle-dataset-lint==0.4.0
- run: kaggle-dataset-lint --format github data/my-dataset
# .pre-commit-config.yaml
repos:
- repo: https://github.com/tb91117/kaggle-dataset-pipelines
rev: v0.4.0
hooks:
- id: kaggle-dataset-lint
Open-data pipelines
Each pipeline downloads an official public source, builds tidy Parquet/CSV files with typed columns, writes a full
dataset-metadata.json (title, subtitle, description, per-column descriptions, license, keywords) and renders a cover
image. Re-running a pipeline refreshes the dataset, so the Kaggle version stays current with the source. Every build is
tested on small real-data samples and must pass the linter.
Datasets built with this repo
| Dataset on Kaggle | Source | Pipeline |
|---|---|---|
| US Flight Delays & On-Time Performance 2022–2026 | BTS Reporting Carrier On-Time Performance | fetch_bts.py → build_bts.py |
| US Electric Grid Hourly Data (EIA-930) | EIA Hourly Electric Grid Monitor, six-month BALANCE files | fetch_eia930.py → build_eia930.py |
| World Development Indicators 1960–2025 | World Bank WDI bulk CSV | fetch_wdi.py → build_wdi.py |
| San Francisco Street Tree Inventory | DataSF tkzw-k3nq (SODA API) |
fetch_sf_trees.py → build_v2.py trees |
| BTC/USDT 15-min Candles + Indicators 2017–2025 | Binance public market-data API (spot BTCUSDT, 15-minute klines) | build_v2.py binance |
| Query Intent Routing for AI Assistants | Written by the dataset author for an assistant tool-routing prototype | build_v2.py intent |
The last two are rebuilt from the author's own source files, so they have no fetch step.
Quick start
pip install -e ".[pipelines]"
python -I tools/fetch_eia930.py # downloads into datasets/eia930-hourly-grid/source/ (resumable)
python -I tools/build_eia930.py # writes datasets/eia930-hourly-grid/v1/ (data + metadata + cover)
Nothing is uploaded by the build scripts. Publishing is a separate, explicit step:
kaggle datasets version -p datasets/eia930-hourly-grid/v1 -m "Refresh"
python -I tools/push_cover.py datasets/eia930-hourly-grid/v1 <owner>/<slug> # cover with a correct crop
Run on Kaggle instead of locally
Some sources are large (the BTS files are several GB). make_kaggle_pipeline.py assembles fetch + build + cover
into one self-contained Kaggle script kernel, so the download happens on Kaggle's servers:
python -I tools/make_kaggle_pipeline.py wdi none # bts | eia930 | wdi | trees; none = build only
kaggle kernels push -p pipelines/world-bank-wdi-dataset-pipeline
The kernel's output folder is the finished dataset: create or update the Kaggle dataset from it
(dataset page → New version → Notebook output). For eia930, wdi and trees the repo's scripts are embedded
verbatim and run as files with KDP_DATA_ROOT pointing at Kaggle's scratch disk, so a kernel run and a local run
produce the same files.
With private or public, the kernel reads a Kaggle Secret named KAGGLE_API_TOKEN (Notebook → Add-ons → Secrets).
Tools
| Script | What it does |
|---|---|
src/kaggle_dataset_lint.py |
The linter above (kaggle-dataset-lint). |
fetch_*.py |
Resumable downloaders with retries; complete files are skipped on re-run. |
KDP_DATA_ROOT |
Environment variable: where sources are downloaded and datasets are built (default ./datasets). |
build_*.py |
Clean, type and document a source into a Kaggle-ready folder. |
make_covers.py |
One distinct 2:1 cover design per dataset (no title text; Kaggle shows the title). |
push_cover.py |
Uploads metadata + cover with a crop that covers the whole image (the kaggle CLI crops the top-left corner). |
make_kaggle_pipeline.py |
Turns a fetch + build pair into a single Kaggle script kernel. |
make_notebooks.py |
Generates the example notebooks that accompany each dataset. |
profile_csv.py |
Prints a compact column profile of every CSV under a dataset folder. |
Licenses
The code in this repo is MIT-licensed. The data keeps its source license: BTS and EIA data are US government works (public domain), World Bank WDI is CC BY 4.0, and DataSF publishes under ODC-PDDL. Check each source before reuse.
Metadata
Release files for kaggle-dataset-lint 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| kaggle_dataset_lint-0.4.0.tar.gz | 19.0 kB | With provenance | Details for kaggle_dataset_lint-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kaggle_dataset_lint-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for kaggle_dataset_lint-0.4.0-py3-none-any.whl |
Total release size: 32.8 kB
Release files / kaggle_dataset_lint-0.4.0.tar.gz
| Download URL | kaggle_dataset_lint-0.4.0.tar.gz |
|---|---|
| Size | 19.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
abdb9c8e076f56439603009b60c4e9d6f19dcae7bc7572b71ab7718c313c7771
|
|
BLAKE2b-256 checksum How to use checksums |
5cf1d1983896d2de6a8b1aed7b0c536d6ceb52826b4632fb43f837cc869a71be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / kaggle_dataset_lint-0.4.0-py3-none-any.whl
| Download URL | kaggle_dataset_lint-0.4.0-py3-none-any.whl |
|---|---|
| Size | 13.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3dd9ccc34a844418203cafbdaa8ef829e6a51458c6aa571d28c9a1b62a650048
|
|
BLAKE2b-256 checksum How to use checksums |
49cbf0870ae05497904e75821dc94d3985eeb61c5df460822afe082f7ab0856f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logSecurity for kaggle-dataset-lint 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for kaggle_dataset_lint-0.4.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.