Skip to main content

A Python package for scraping NBA data from Basketball Reference.

Project description

HoopStats

hoopstats can be accessed here on PyPi.

This project serves as a proof of concept (POC) for web scraping NBA data from Basketball Reference. The primary motivation is to explore the intersection of data science and software engineering by building a reliable NBA-focused Python package. The long-term objective of this project is to evolve into the backend of a full-stack application, providing users with seamless access to NBA statistics through an intuitive and user-friendly interface.

Table of Contents

Features

  • Scrape NBA player statistics from Basketball Reference
  • Access detailed game logs and player splits
  • Convenient API for querying player and game data

Installation

To install HoopStats, you can use pip:

pip install hoopstats

Usage

Here's a basic example of how to use HoopStats:

from hoopstats import PlayerScraper

# Initialize the scraper with player names
player_scraper = PlayerScraper(first_name="Lonzo", last_name="Ball")

# Access the player's data
print(player_scraper.url)

# Access the player's game log stats, based on a given year
print(player_scraper.get_game_log_by_year(2024))

To review full functionality of the code, look under the services folder.

Testing

To run the tests for HoopStats, use the following command:

pytest --cov=.

Make sure to add tests for any new features or bug fixes.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

Author: Calvin Min (2024)

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

hoopstats-0.1.4.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

hoopstats-0.1.4-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file hoopstats-0.1.4.tar.gz.

File metadata

  • Download URL: hoopstats-0.1.4.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.9 Darwin/23.6.0

File hashes

Hashes for hoopstats-0.1.4.tar.gz
Algorithm Hash digest
SHA256 2773c4a815c90619261deb07d6b568bd1b17598ed0b8c06d520b16c9ccaa00fc
MD5 1d2e846e8eb5b7e0a99783d4e993d8a4
BLAKE2b-256 9744478c288b6d37986afbcddbd0b2a9d5d4ca3b22dccb0bd227c7811104919e

See more details on using hashes here.

File details

Details for the file hoopstats-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: hoopstats-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.9 Darwin/23.6.0

File hashes

Hashes for hoopstats-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 5e3ce850b063b01d437a28e3e4b079c7997ed88ce0a0f808274b15a5f09a16b4
MD5 4341a894168729b0ac9ec0b157c5d593
BLAKE2b-256 8dc4da53ecf1de50b99f8205e679ea2ab3d678f779ad9cf6d0aa7d86c10fa2f9

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