Skip to main content

TopDownHockey EliteProspects Scraper

By Patrick Bacon, made possible by the work of Marcus Sjölin and Harry Shomer.


This is a package built for scraping two data sources:

  1. The NHL's Play-by-Play Reports, which come in the form of HTML/API reports from the NHL and JSON reports from ESPN.

  2. Elite Prospects, an extremely valuable website which makes hockey data for thousands of leagues available to the public.

This package is strictly built for end users who wish to scrape data for personal use. If you are interested in using Elite Prospects data for professional purposes, I recommend you look into the Elite Prospects API.

While using the scraper, please be mindful of EliteProspects servers.

Installation


You can install the package by entering the following command in terminal:

pip install TopDownHockey_Scraper

If you're interested in using the NHL Play-By-Play scraper, import that module using this function in Python:

import TopDownHockey_Scraper.TopDownHockey_NHL_Scraper as tdhnhlscrape

If you're interested in using the Elite Prospects scraper, import that module using this function in Python:

import TopDownHockey_Scraper.TopDownHockey_EliteProspects_Scraper as tdhepscrape

User-End Functions (NHL Scraper)


scrape_full_schedule(start_date, end_date)

Returns the NHL's schedule from the API for all games for the 2023-2024 NHL season.

Example:

tdhnhlscrape.scrape_full_schedule()


full_scrape(game_id_list, shift = True)

Returns a dataframe containing play-by-play data for a list of game ids.

  • game_id_list: A list of NHL game ids.

Example:

tdhnhlscrape.full_scrape([2023020179, 2023020180, 2023020181])

User-End Functions (Elite Prospects Scraper)


get_skaters(leagues, seasons)

Returns a dataframe containing statistics for all skaters in a target set of league(s) and season(s).

  • leagues: One or multiple leagues. If one league, enter as a string i.e; "nhl". If multiple leagues, enter as a tuple or list i.e; ("nhl", "ahl").
  • seasons: One or multiple leagues. If one league, enter as a string i.e; "2018-2019". If multiple leagues, enter as a tuple or list i.e; ("2018-2019", "2019-2020").

Example:

tdhepscrape.get_skaters(("nhl", "ahl"), ("2018-2019", "2019-2020"))


get_goalies(leagues, seasons)

Returns a dataframe containing statistics for all goalies in a target set of league(s) and season(s).

  • leagues: One or multiple leagues. If one league, enter as a string i.e; "nhl". If multiple leagues, enter as a tuple or list i.e; ("nhl", "ahl").
  • seasons: One or multiple leagues. If one league, enter as a string i.e; "2018-2019". If multiple leagues, enter as a tuple or list i.e; ("2018-2019", "2019-2020").

Example:

tdhepscrape.get_goalies("khl", "2015-2016")


get_player_information(dataframe)

Returns a dataframe containing bio information for all skaters or goalies (or both) within a target dataframe.

  • dataframe: The dataframe returned by one of the previous two commands.

Example:

Say you obtain skater data for the KHL in 2020-2021 and store that as a dataframe called output. You can run this function to get bio information for every player in that league's scrape.

output = tdhepscrape.get_skaters("khl", "2020-2021")

tdhepscrape.get_player_information(output)


add_player_information(dataframe)

Returns a dataframe containing bio information for all skaters or goalies (or both) within a target dataframe as well as the statistics from the original dataframe.

  • dataframe: The dataframe returned by one of the previous two commands.

Example:

Say you obtain skater data for the KHL in 2020-2021 and store that as a dataframe called output. You can run this function to get bio information for every player in that league's scrape.

output = tdhepscrape.get_skaters("khl", "2020-2021")

tdhepscrape.add_player_information(output)

Comments, Questions, and Concerns.


My goal was to make this package as error-proof as possible. I believe I've accounted for every issue that could potentially throw off a scrape, but it's possible I've missed something.

If any issues arise, or you have any questions about the package, please do not hesitate to contact me on Twitter at @TopDownHockey or email me directly at patrick.s.bacon@gmail.com.

Metadata

Release files for TopDownHockey-Scraper 6.1.68

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

Source distribution (sdist)

Source distribution for TopDownHockey-Scraper 6.1.68
File Size Uploaded Provenance Actions
topdownhockey_scraper-6.1.68.tar.gz 212.9 kB Without provenance Details for topdownhockey_scraper-6.1.68.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for TopDownHockey-Scraper 6.1.68
File Interpreter ABI Platform Actions
topdownhockey_scraper-6.1.68-py3-none-any.whl Python 3 none any Details for topdownhockey_scraper-6.1.68-py3-none-any.whl

Total release size: 428.9 kB

Release files / topdownhockey_scraper-6.1.68.tar.gz

Download URL topdownhockey_scraper-6.1.68.tar.gz
Size 212.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1779b5327555432bc2695ea14a69af5a79a3370d551672e62a28cef4a34df94c
BLAKE2b-256 checksum
How to use checksums
f2f567cfaf7efe43f5452756deeb44c36a6f56f3433dd930b1de23bc45abd219
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / topdownhockey_scraper-6.1.68-py3-none-any.whl

Download URL topdownhockey_scraper-6.1.68-py3-none-any.whl
Size 216.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
521b963d8ae05089c63167dd2d7e8c2e2e408ad68c5222b70ab90b48f24c456b
BLAKE2b-256 checksum
How to use checksums
023d879050a541fa3c6f751d46b3d6377aca562cf1823c4f3b7541698592e270
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Security for TopDownHockey-Scraper 6.1.68

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

6.1.68 This release

2 release files No provenance

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