Skip to content
visuxlsPublic

About

Analyze NHL forward career production by draft pick (2008–2022), with charts and CSV exports.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

NHL Draft Analysis

Analyze how NHL forwards drafted between 2008 and 2022 have produced at the NHL level, broken down by overall draft pick. The project computes average career points per season for each pick and can print tables, export CSVs, and generate charts.

What it measures

  • Draft cohort: Forwards selected in drafts from 2008 through 2022
  • Production window: NHL seasons from each player's draft year through 2021–22
  • Metric: Average career points per season (total points divided by eligible NHL seasons)
  • Rounds: First round (picks 1–30) and second round (picks 31–60)

Only forwards (LW, RW, C, and related position labels) are included in the round-level averages. Defensemen and goalies are excluded from those summaries.

Results

First round (picks 1–30)

First-round forward career points by draft pick

Second round (picks 31–60)

Second-round forward career points by draft pick

Requirements

  • Python 3.13+
  • uv (recommended) or pip

Setup

git clone https://github.com/<your-username>/nhl-draft.git
cd nhl-draft
uv sync

Or with pip:

python -m venv .venv
source .venv/bin/activate
pip install -e .

Usage

The project installs a nhl-draft CLI with three subcommands.

Run analysis (console + CSV)

First round (default):

uv run nhl-draft analyze

Second round:

uv run nhl-draft analyze --round 2

Results are printed to the terminal and written to:

  • data/first_round_points_by_pick.csv
  • data/second_round_points_by_pick.csv

List players at a specific pick

uv run nhl-draft pick 1

Generate charts

First round:

uv run nhl-draft graph

Second round:

uv run nhl-draft graph --round 2

To chart from existing CSV output without recomputing:

uv run nhl-draft graph --use-cached-csv

Charts are saved to graphs/ as PNG files.

Development

uv sync --dev
uv run ruff check src tests
uv run pytest

Project structure

nhl-draft/
├── src/nhl_draft/
│   ├── analysis.py   # Core analysis logic
│   ├── charts.py     # Chart generation
│   ├── cli.py        # CLI entry point
│   └── paths.py      # Data file locations
├── tests/
├── data/
│   ├── nhldraft.csv
│   ├── skaters_2008_to_2024.csv
│   └── *.csv
├── graphs/
│   └── *.png
├── pyproject.toml
└── LICENSE

Data sources

  • Draft data: data/nhldraft.csv
  • Player stats: data/skaters_2008_to_2024.csv from MoneyPuck.com

See data/README.md for file details and attribution requirements.

Notes

  • Player names are matched between draft and stats datasets with normalization for accents, apostrophes, and common first-name variants (e.g. Matt/Matthew).
  • Pre-generated CSV files in data/ and PNG charts in graphs/ are included so you can view results without rerunning the analysis.

License

MIT — see LICENSE.

About

Analyze NHL forward career production by draft pick (2008–2022), with charts and CSV exports.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages