A library for scraping box score and schedule data from Basketball Reference
Project description
# Basketball Reference Web Scraper
[Basketball Reference](http://www.basketball-reference.com) is a great site (especially for a basketball stats nut like me), and hopefully they don't get too pissed off at me for creating this.
Basically, I created this repository as a utility for another project where I'm trying to estimate an NBA player's productivity as it relates to daily fantasy sports. For that project, I need box score and scheduling information, which is provided by this utility.
## Getting Box Scores
There are two methods that return box scores for a given date:
### Methods located in `web_scrapers.py`
* `return_box_scores_for_date(date)`
* Returns a list of Box Score objects
* `return_json_encoded_box_scores_for_date(date)`
* Returns a JSON object representation of a list of Box Score objects
## Getting Season Schedule Information
There are also two methods that return scheduling information for a given season start year (note that the NBA season generally spans two calendar years):
### Methods located in `web_scrapers.py`
* `return_schedule(season_start_year)`
* Returns a Schedule object
* `return_json_encoded_schedule(season_start_year)`
* Returns a JSON representation of a Schedule object
## Writing to CSV
I also created utility methods that write box score and season data to csv. They are located in `csv_writers.py`.
[Basketball Reference](http://www.basketball-reference.com) is a great site (especially for a basketball stats nut like me), and hopefully they don't get too pissed off at me for creating this.
Basically, I created this repository as a utility for another project where I'm trying to estimate an NBA player's productivity as it relates to daily fantasy sports. For that project, I need box score and scheduling information, which is provided by this utility.
## Getting Box Scores
There are two methods that return box scores for a given date:
### Methods located in `web_scrapers.py`
* `return_box_scores_for_date(date)`
* Returns a list of Box Score objects
* `return_json_encoded_box_scores_for_date(date)`
* Returns a JSON object representation of a list of Box Score objects
## Getting Season Schedule Information
There are also two methods that return scheduling information for a given season start year (note that the NBA season generally spans two calendar years):
### Methods located in `web_scrapers.py`
* `return_schedule(season_start_year)`
* Returns a Schedule object
* `return_json_encoded_schedule(season_start_year)`
* Returns a JSON representation of a Schedule object
## Writing to CSV
I also created utility methods that write box score and season data to csv. They are located in `csv_writers.py`.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for basketball_reference_web_scraper-1.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5e8433cfafdd8b9b4d226e58c52950869b1de24d920a84206f253d05bb295d5 |
|
MD5 | 68815ca53a9bcf56152c8ab272f68f13 |
|
BLAKE2b-256 | c1080112cd4cec7ae8431fb8c9b3b3027ddabd9ce5ca065df3b3cdc75280030c |