Skip to main content

Python Hockey Data Scraper

Project description

EdgingHockeyScraper

im https://pypi.python.org/pypi/edginghockeyscraper

Install

pip install edginghockeyscraper

Python Hockey Data Scraper

Features

  • Python Hockey Data Scraper with following features:

    • Caching Requests to quickly fetch data
    • Parallel Processing to speed up data fetch from NHL API
  • Get League schedule for year - Usageschedule = edginghockeyscraper.get_league_schedule(2024)

  • Get Game boxscore

    • boxscore = edginghockeyscraper.get_boxscore(2024020345)
  • Get Game playByPlay

    • playByPlay = edginghockeyscraper.get_play_by_play(2024020345)
  • Get Season boxscores

    • boxscoreSeason = edginghockeyscraper.get_boxscore_season(2024)
  • Get Season playByPlay

    • playByPlaySeason = edginghockeyscraper.get_play_by_play_season(2024)

Filter Season data by PreSeason, Regular, PostSeason gametypes

  • e.g.
    • games = edginghockeyscraper.get_league_schedule(2024, {GameType.REG})
    • boxscoreSeason = edginghockeyscraper.get_boxscore_season(2024, {GameType.REG})

Utilize requests-cache for fast repeated request calls

  • First Call:

    %%time
    edginghockeyscraper.get_boxscore_season(2024, cache= True)
    

    CPU times: user 583 ms, sys: 318 ms, total: 901 ms Wall time: 1min 18s

  • Second Call:

    • CPU times: user 374 ms, sys: 141 ms, total: 515 ms Wall time: 1.31 s

    A 60x speedup!

Utilize multiprocessing to improve request speed

Benchmark using 2024 Macbook Air Apple M3 16GB

  1. No Parallel getBoxscoreSeason: CPU times: user 15.6 s, sys: 3.55 s, total: 19.1 s Wall time: 8min 49s

  2. Parallel getBoxscoreSeason: CPU times: user 583 ms, sys: 318 ms, total: 901 ms Wall time: 1min 18s

    A ~7x Speedup! (this is an 8-core CPU - you can expect roughly a <# cpu-cores> speedup)

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

edginghockeyscraper-0.1.6.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

edginghockeyscraper-0.1.6-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file edginghockeyscraper-0.1.6.tar.gz.

File metadata

  • Download URL: edginghockeyscraper-0.1.6.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for edginghockeyscraper-0.1.6.tar.gz
Algorithm Hash digest
SHA256 4684639fad74cf8076c020df5e3194ce4b9add7cfc3cb88be9c2a02b79bbc2f9
MD5 2ab82d64a40656925064934a6c08cbe1
BLAKE2b-256 caa27d946475a7c0afe305afb0979d3a972f71b71eea319f25ec2b3e814488fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for edginghockeyscraper-0.1.6.tar.gz:

Publisher: python-publish.yml on austinegri/edginghockeyscraper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file edginghockeyscraper-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for edginghockeyscraper-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a30d5b2777030aefb3fad34dcff4c486dd9e473aec261c6646d284165ca658b3
MD5 ad5755441ce0afc6d97bb6b2b43e7132
BLAKE2b-256 0d70961ec78217d259f000bab5d5c9e89209be8ab3deea26bc7471cdcfacbf3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for edginghockeyscraper-0.1.6-py3-none-any.whl:

Publisher: python-publish.yml on austinegri/edginghockeyscraper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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