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.5.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

hoopstats-0.1.5-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hoopstats-0.1.5.tar.gz
  • Upload date:
  • Size: 8.3 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.5.tar.gz
Algorithm Hash digest
SHA256 2214debb12bc6c3d7857a8d6076d2132df449e3acfd1b9721dd0c736207545df
MD5 f7b93bba5d7f804e02d2cdde03433602
BLAKE2b-256 ba3f9422757a13b3515e8d805bc677302003368a73e01cd2d1a3c8907caa82da

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hoopstats-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 10.7 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 3a39fe581e9260246d220191e36aacaf3cae7c72fd57da64b7c0452bebb6ca61
MD5 6dd9ea665fab31c2c10e2219b321c540
BLAKE2b-256 a80fdc876127eb20478a2830893ef84c55ec197f3d4f8cb418819e2b4b3497d3

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