Skip to main content

kag - fresh Kaggle competition workspaces from your terminal

PyPI Python Versions

kag is a Textual TUI inspired by try, built for Kaggle workflows.

It helps you go from "I want to work on this competition" to a ready folder with data, notebook, notes, and editor open.

Demo

Asciinema walkthrough placeholder: docs/demo-placeholder.md

Planned recording file path: docs/demo.cast

What kag does

  • Shows a searchable competition picker with sections:
    • Your notebooks (local projects in KAG_PATH)
    • Joined competitions
    • All competitions
  • Uses paginated loading for competitions (20 per page) and auto-loads more when you reach the end.
  • Scaffolds a project folder:
    • data/ (download + extract)
    • <competition>.ipynb
    • notes.md
    • .venv (optional)
    • git init (optional)
  • Checks competition access before download and opens browser tabs for overview + rules when acceptance is needed.
  • Enriches notes.md from Kaggle competition content (Overview, Evaluation, Data, Code, Rules).

Installation

kag is published on PyPI and installs as a global terminal command.

uv tool install kag

Alternative: pipx

pipx install kag

Fallback: pip

python -m pip install kag

Validate your install:

kag --version
kag --doctor

For development from this repository:

uv sync
uv run kag --doctor

Maintainer release planning lives in docs/release.md.

Setup guide

1. Install kag

uv tool install kag

2. Install and authenticate Kaggle CLI

  • Python 3.11+
  • Kaggle CLI 2.x installed and authenticated. kag uses whatever login the Kaggle CLI uses:
    • Recommended: kaggle auth login (browser sign-in, credentials cached in ~/.kaggle/credentials.json)
    • API token: KAGGLE_API_TOKEN, or the token saved to ~/.kaggle/access_token
    • Legacy: KAGGLE_USERNAME + KAGGLE_KEY, or ~/.kaggle/kaggle.json containing username and key
uv tool install kaggle
kaggle auth login
kaggle --version

3. Verify your environment

kag --doctor

Fix any FAIL rows before starting a competition workspace.

4. Choose where projects are created

By default, kag creates projects in ~/Kaggle. Override it with KAG_PATH:

export KAG_PATH=~/Kaggle

Optional persistent config lives at ~/.kag_config.toml:

kag_path = "/Users/you/Kaggle"
default_editor = "code"
auto_venv = true
auto_git = true

5. Start using kag

kag
kag titanic

Optional shell integration lets kag automatically cd into the selected project directory:

eval "$(kag --init)"

Quick start

kag                  # open TUI
kag titanic          # open TUI with initial search query
kag --doctor         # environment checks
kag --version        # show installed version
kag --help           # show CLI help

Usage

kag                  # open TUI
kag titanic          # open TUI with initial search query
kag --doctor         # environment checks
kag --doctor --json  # machine-readable checks
kag --version        # show installed version
kag --init           # print optional shell integration
kag --help           # show CLI help

kag --help prints usage information without requiring Kaggle CLI authentication.

How it works

  1. Open picker (kag)
  2. Search and select competition or local project
  3. If needed, choose download and editor
  4. kag verifies competition access before download
  5. Project is scaffolded and opened
  6. If --init hook is installed, your shell cds into the project

Search behavior

Search is currently case-insensitive substring filtering over competition slug/title and local project names.

Troubleshooting

Run:

kag --doctor

It checks:

  • kag on PATH
  • kaggle CLI + auth status
  • API probe (kaggle competitions list --page-size 1)
  • shell hook presence
  • writable directories
  • detected editors

If you pick Jupyter Lab (or another editor) when creating a project, its output is written to .kag/logs/<editor>.log inside the project. On a headless or SSH session, find the Jupyter server URL and token there, or run jupyter server list.

Current limitations

  • Competition join/terms acceptance is browser-assisted (not a direct Kaggle CLI command).
  • Notes extraction depends on Kaggle page APIs/content shape and may vary by competition.
  • Search is substring-based (not fuzzy-ranked yet).

License

MIT

Metadata

Release files for kag 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kag 0.1.1
File Size Uploaded Provenance Actions
kag-0.1.1.tar.gz 62.2 kB With provenance Details for kag-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kag 0.1.1
File Interpreter ABI Platform Actions
kag-0.1.1-py3-none-any.whl Python 3 none any Details for kag-0.1.1-py3-none-any.whl

Total release size: 95.8 kB

Release files / kag-0.1.1.tar.gz

Download URL kag-0.1.1.tar.gz
Size 62.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5993511b0670e51837025aa09b2aaaa0201c0526dacdd8118a59972c85a3523b
BLAKE2b-256 checksum
How to use checksums
f0ab4413320f639b4d6bae4724df3982e5190579424331a4c3f5a60ce6f735a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 4, 2026.

Transparency log

Release files / kag-0.1.1-py3-none-any.whl

Download URL kag-0.1.1-py3-none-any.whl
Size 33.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
030cc8d09b9686184de17e34a5565d5513f0a85b9c417ab8bf8d42f60f480370
BLAKE2b-256 checksum
How to use checksums
aa2b562f387135ab74490e7df8a06b8c5e63948e1f33c957e14042c47c743a48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 4, 2026.

Transparency log

Security for kag 0.1.1

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.

Select from 2 files

Attestation for kag-0.1.1.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 Oct 4, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page