Skip to main content

A small example package

Project description

TopDownHockey EliteProspects Scraper

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


This is a package built for scraping 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 this 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

Then import the module using this function:

import TopDownHockey_Scraper.TopDownHockey_EliteProspects_Scraper as tdhepscrape

User-End Functions


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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

TopDownHockey_Scraper-0.0.12.tar.gz (10.1 kB view details)

Uploaded Source

Built Distributions

TopDownHockey_Scraper-0.0.12-py3.9.egg (15.5 kB view details)

Uploaded Source

TopDownHockey_Scraper-0.0.12-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file TopDownHockey_Scraper-0.0.12.tar.gz.

File metadata

  • Download URL: TopDownHockey_Scraper-0.0.12.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for TopDownHockey_Scraper-0.0.12.tar.gz
Algorithm Hash digest
SHA256 47ffd0191e0693c177d32ad3c0a641bb923d9f90163efa08800dce2109f365f4
MD5 f2f831e442c88fbab3075b681e41d824
BLAKE2b-256 7b95cc0d221e8f1739dce585bf61e0177f38ff8150822d4a7d6fa6808405dd9c

See more details on using hashes here.

File details

Details for the file TopDownHockey_Scraper-0.0.12-py3.9.egg.

File metadata

  • Download URL: TopDownHockey_Scraper-0.0.12-py3.9.egg
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for TopDownHockey_Scraper-0.0.12-py3.9.egg
Algorithm Hash digest
SHA256 69bc5ef3e192c264cd77a7884a650869e64c26bc78706cf6b65e4b2cd49807fd
MD5 8bdd16cc2c441850c8b06298df5df87c
BLAKE2b-256 3c8f7493ca61e3bc00524e7dd05ab049a150a6f58c7dab9a80c426fe0254f785

See more details on using hashes here.

File details

Details for the file TopDownHockey_Scraper-0.0.12-py3-none-any.whl.

File metadata

  • Download URL: TopDownHockey_Scraper-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for TopDownHockey_Scraper-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 b867d45c19e44d005839db998dfc923dd8ae871b8ad1b429fd4f8ad933354049
MD5 576a2f378f06d00e38063740a1d797f0
BLAKE2b-256 7d5cd2d629f4256aa8d83634fda144f60a2e9fc14b68baf1dd21134ff626ddf2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page