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
Built Distribution
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2773c4a815c90619261deb07d6b568bd1b17598ed0b8c06d520b16c9ccaa00fc |
|
MD5 | 1d2e846e8eb5b7e0a99783d4e993d8a4 |
|
BLAKE2b-256 | 9744478c288b6d37986afbcddbd0b2a9d5d4ca3b22dccb0bd227c7811104919e |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e3ce850b063b01d437a28e3e4b079c7997ed88ce0a0f808274b15a5f09a16b4 |
|
MD5 | 4341a894168729b0ac9ec0b157c5d593 |
|
BLAKE2b-256 | 8dc4da53ecf1de50b99f8205e679ea2ab3d678f779ad9cf6d0aa7d86c10fa2f9 |