Getting started with DuckDB for hockey data
Why a single-file analytical database is the fastest way to start your hockey data stack.
CSV / JSON / Parquet
- Scraped events
- Downloads
DuckDB
- read_csv / read_json
- SQL over files
Views & tables
- silver views
- gold marts
Notebook / BI / AI
- pandas
- Claude
The 30-second version
- DuckDB is a fast, zero-setup analytical database that runs inside your notebook.
- It queries CSV/JSON/Parquet directly — no server, no ingestion ceremony.
- Perfect for the bronze → silver → gold pattern before you ever touch the cloud.
Why DuckDB first
Most people think building a data stack means standing up a warehouse and a pile of infrastructure. DuckDB flips that: it is a single-file analytical database that runs in-process, so you can query gigabytes of hockey data straight from your laptop or notebook with plain SQL — no server to run, no accounts to create.
Query files without importing them
DuckDB reads CSV, JSON and Parquet directly. You can point a `SELECT` at a scraped play-by-play file and start exploring immediately, then wrap the good queries as views. That means your "ingestion" step is often just organizing files, and your modeling is just SQL.
Grow into the same pattern
The bronze → silver → gold layering you would use in a cloud warehouse works identically in DuckDB: raw files are bronze, cleaning views are silver, and materialized analysis tables are gold. When you outgrow the laptop, MotherDuck runs the same DuckDB SQL in the cloud — so nothing you learn here is wasted.
Build it yourself
- 1Install once: `pip install duckdb` (or use the CLI).
- 2Query a file directly: `SELECT * FROM read_csv('shots.csv') LIMIT 5;`
- 3Create a silver view that cleans and types the raw events.
- 4Materialize a gold table (e.g. shots with an xG estimate) with CREATE TABLE AS.
- 5Read it into pandas or hand it to an AI tool.
Key terms
Newsletter
Weekly hockey analytics
Data-driven takes on performance, scouting, and team strategy. No fluff — just the numbers that matter.
No spam. Unsubscribe anytime.