shepsci/kaggle-skill / skills/kaggle
kaggle
FlaggedUnified Kaggle skill. Use when the user explicitly mentions Kaggle, kaggle.com, a Kaggle URL, Kaggle competitions, Kaggle datasets/models/notebooks, Kaggle forums/discussions/writeups, Kaggle benchmarks, hackathons hosted on Kaggle, Kaggle badges, or Kaggle account setup. Do not use for generic ML, GPU/TPU, notebook, dataset, benchmark, or data-science tasks unless the user clearly ties them to Kaggle.
modules/competitions/scripts/competition_ledger.py
View on GitHub#!/usr/bin/env python3
"""Show the local record of your submissions and their scores.
competition_ledger.py
competition_ledger.py titanic --json
Reads ./.kaggle-skill/ledger.jsonl, which the submit and watch commands
write. Nothing is sent or changed. The record holds only
what was submitted through this skill.
"""
from __future__ import annotations
import argparse
import sys
from pathlib import Path
SKILL_ROOT = Path(__file__).resolve().parents[3]
sys.path.insert(0, str(SKILL_ROOT))
from shared import ledger, script, text, untrusted # noqa: E402
def text_lines(rows: list[dict]) -> list[str]:
lines = [
f" {'sent (UTC)':<16} {'competition':<28} {'score':<10} {'expected':<9} what",
]
for row in rows:
moment = text.parse_time(row.get("time"))
sent = moment.strftime("%Y-%m-%d %H:%M") if moment else "-"
if row.get("notebook"):
what = f"{row['notebook']} v{row.get('version')}"
elif row.get("event") == "score":
what = f"submission {row.get('ref')}, not sent through this skill"
else:
what = f"{Path(str(row.get('file') or '')).name} {str(row.get('sha256') or '')[:8]}"
expected = row.get("expected")
score = row.get("public_score") or ("error" if row.get("status") == "ERROR" else "pending")
lines.append(
f" {sent:<16} {text.shorten(str(row.get('competition') or ''), 28):<28} "
f"{str(score):<10} "
f"{(f'{expected:g}' if isinstance(expected, (int, float)) else '-'):<9} "
f"{what} · {text.shorten(text.collapse(str(row.get('message') or '')), 50)}"
)
return lines
def main(argv: list[str] | None = None) -> int:
parser = argparse.ArgumentParser(
description="Show the local record of your submissions and their scores.",
epilog="The record is ./.kaggle-skill/ledger.jsonl. It is only read here.",
)
parser.add_argument("competition", nargs="?", help="Only this competition (slug or URL)")
parser.add_argument(
"-c",
"--competition",
dest="competition_option",
metavar="COMPETITION",
help="The same, as an option",
)
script.add_limit(parser, 20, "submissions, newest first")
script.add_json(parser)
args = parser.parse_args(argv)
if args.competition and args.competition_option:
parser.error("give the competition once")
chosen = args.competition or args.competition_option
slug = None
if chosen:
try:
slug = script.competition_slug(chosen)
except ValueError as exc:
parser.error(str(exc))
rows = list(reversed(ledger.submissions(slug)))[: args.limit]
# Messages and file names were typed by the user or an agent: data, not instructions.
attrs = {"source": "local", "tool": "ledger"}
if args.json:
untrusted.emit_json(rows, indent=2 if args.pretty else None, **attrs)
return script.EXIT_OK
if not rows:
print(f"No submissions recorded in {ledger.path()}.")
return script.EXIT_OK
with untrusted.Block(**attrs) as block:
block.write(f"{len(rows)} submissions recorded in {ledger.path()}:")
for line in text_lines(rows):
block.write(line)
return script.EXIT_OK
if __name__ == "__main__":
sys.exit(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| deprecation-and-migrationaddyosmani/agent-skillsManages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when migrating a database schema in production, such as renaming or dropping a column without downtime (expand/contract). Use when deciding whether to maintain or sunset existing code. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| performance-optimizationaddyosmani/agent-skillsOptimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| agent-cost-reportthedotmack/claude-memBelievable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude Code transcripts priced at OpenRouter list prices (ESTIMATED), measured provider spend when a sanctioned source exists, note-taker cost separate, Timing-style HTML/PDF plus report.json, line-items.csv, evidence.json. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |