eliteprospect_scraper
Package to scrape ice hockey data from eliteprospect.com.
My aim is to keep the package up-to-date so that it works also when the webpage structure is changing. If something is not working please reach out so that we can fix it.
Please only use collected data for personal use - there are real APIs for professional usage of eliteprospects data.
Getting started
Install the package with pip
pip install eliteprospect_scraper
Import module
import eliteprospect.eliteprospect_scraper as ep
Show function descriptions with
help(ep)
Functions
Descriptions of the functions in the package.
getPlayers(league, year)
Get all players for a specific year and league from the page with structure 'https://www.eliteprospects.com/league/' + league + '/stats/' + year Example: https://www.eliteprospects.com/league/shl/stats/2016-2017
The function takes input parameters league and year
- League: valid league from eliteprospects
- year: valid combination of year in format 2015-2016, 2016-2017 etc.
Example:
getPlayers('shl', '2015-2016')
The page contains pagination, and the function loops over 10 pages. This is typically enough to extract all players.
getGoalies(league, year)
Same as getPlayers, but returns dataframe with goalies.
getPlayerMetadata(dfplayers)
Create dataframe with metadata by players.
Input is dataframe created with function getPlayers
getPlayerStats(playerlinks)
Create dataframe with all statistics from playerpages.
Takes a series of playerlinks as input. Playerlinks are also included in return output from getPlayerMetadata
ep.getPlayerStats(["https://eliteprospects.com/player/2050/mattias-ritola"])
dataprep_players(playerstats, league_mapping, players):
dataprep_players(playerstats, league_mapping, players)
Takes series of playerlinks to eliteprospect-profiles,
Return dataframe with stats by player and season
Example Notebook
See this notebook for examples of how to use the package, and in what order you can run the functions.
eliteprospect_scraper
Package to scrape hockey data from eliteprospect
[1.2] - 2024-09-12
Added
- New function getGoalies(), to extract also Goaltender links similar to getPlayers().
Fixed
- The getPlayers() now accepts input league "Hockeyallsvenskan" (swedish 2nd league) instead of "Allsvenskan". Allsvenskan is a legacy name used before 2012 season.
Metadata
Release files for eliteprospect-scraper 1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| eliteprospect_scraper-1.2-py3-none-any.whl | Python 3 | none | any | Details for eliteprospect_scraper-1.2-py3-none-any.whl |
Release files / eliteprospect_scraper-1.2-py3-none-any.whl
| Download URL | eliteprospect_scraper-1.2-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
54e3723156c9330d38c9240a5305042a411fcc0f48aa7a1f5b9f1411fe5fe8c0
|
|
BLAKE2b-256 checksum How to use checksums |
0743d26bea3a73a13fec27c660055b368370ff0338d3546b88124c2e815da5eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Security for eliteprospect-scraper 1.2
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.