Skip to content

maxtixador/scrapernhl

Repository files navigation

ScraperNHL

Python package for scraping and analyzing NHL data with built-in Expected Goals (xG) modeling.

Documentation Python Version License

Features

Data Scraping

  • Teams: NHL team data, rosters, metadata
  • Schedule: Team schedules with game states and scores
  • Standings: League standings
  • Player Stats: Skater and goalie statistics
  • Play-by-Play: Game events with coordinates
  • Draft Data: Historical draft picks
  • Expected Goals (xG): Built-in xG model

Access Methods

  • Python API: pandas/polars support
  • Command-Line Interface: Quick exports
  • Jupyter Notebooks: Interactive examples

Design

  • Modular: Fast imports (~100ms)
  • Flexible Output: CSV, JSON, Parquet, Excel
  • Backward Compatible: Works with existing code
  • Documented: Guides and API reference

Installation

From PyPI (Stable)

pip install scrapernhl

From GitHub (Latest)

Install the development version with the latest features and fixes:

pip install git+https://github.com/maxtixador/scrapernhl.git

Or with uv:

uv pip install git+https://github.com/maxtixador/scrapernhl.git

From Source

git clone https://github.com/maxtixador/scrapernhl.git
cd scrapernhl
pip install -e .

Quick Start

Python API

from scrapernhl import scrapeTeams, scrapeSchedule, scrapeStandings

# Get all NHL teams
teams = scrapeTeams()

# Get team schedule
schedule = scrapeSchedule("MTL", "20252026")

# Get current standings
from datetime import datetime
standings = scrapeStandings(datetime.now().strftime("%Y-%m-%d"))

Command-Line Interface

# Scrape teams
scrapernhl teams --output teams.csv

# Scrape schedule
scrapernhl schedule MTL 20252026 --format json

# Scrape play-by-play with xG
scrapernhl game 2024020001 --with-xg --output game.csv

# Get help
scrapernhl --help

Documentation

Full documentation: maxtixador.github.io/scrapernhl

Examples

Check out the notebooks:

What's New in v0.1.4

  • Modular architecture
  • CLI for all scraping functions
  • Documentation website
  • Faster imports
  • Unit tests
  • Standardized code

See full release notes

Contributing

Contributions welcome - bug reports, features, docs, or code.

License

MIT License - see LICENSE file for details

Author

Max Tixador | Hockey Analytics Enthusiast

Acknowledgments

Built for the hockey analytics community.


Last Updated: January 2026 | Version: 0.1.4