Skip to content

Releases: sportsdataverse/hoopR

hoopR 3.0.0

Choose a tag to compare

@saiemgilani saiemgilani released this 26 Mar 14:45

HTTP Backend Migration

  • Breaking: Replaced httr with httr2 as the HTTP backend for all API requests across the package.
  • Removed httr from package dependencies (Imports).
  • request_with_proxy() now uses httr2 request/retry pipeline instead of rvest::session() with httr config arguments, resolving segfaults on systems with libcurl >= 8.x / curl R package >= 7.0.0.
  • All ESPN, NBA Stats, NBA G-League, NCAA, and KenPom HTTP calls now use shared internal helpers (.retry_request(), .resp_text()) backed by httr2.
  • check_status() now uses httr2::resp_status() instead of httr::status_code().
  • KenPom (kp_*) functions now use httr2 cookie jar authentication via login(), .kp_get_page(), and .kp_request() helpers.

Messaging Migration (usethis → cli)

  • Replaced all usethis::ui_*() messaging calls in database builder and loader functions with cli equivalents.
  • usethis::ui_stop()cli::cli_abort(), usethis::ui_oops()cli::cli_alert_danger(), usethis::ui_todo()cli::cli_ul(), usethis::ui_info()cli::cli_alert_info().
  • Inline markup converted: usethis::ui_value(){.val}, usethis::ui_path(){.file}, usethis::ui_code(){.code}.
  • Moved usethis from Imports to Suggests (retained for usethis::edit_r_environ() documentation references).

Social Branding (Twitter → X)

  • Updated all social media links and badges from Twitter to X across README, pkgdown site, and vignettes.
  • Shields.io badge logo=twitterlogo=x; profile URLs twitter.comx.com.
  • pkgdown navbar icon updated from fa-twitter to fa-x-twitter.

Stability and Test Robustness

  • Hardened API-facing tests against live schema drift and intermittent empty payloads.
  • Added explicit skip-on-empty guards for lineup and NCAA teams tests to avoid false negatives when upstream endpoints return no rows.
  • Updated expected columns for currently active payloads in key NBA endpoints (including nba_playercareerstats(), nba_playerdashptshotdefend(), and nba_playerprofilev2()).
  • Improved nba_playerprofilev2() assertions to validate core columns while tolerating empty optional result sets.

CI and Check Improvements

  • Added workflow-level concurrency and explicit permissions to GitHub Actions workflows.
  • Clarified optional environment variable usage in CI for live API test toggles.
  • Updated package build ignores to exclude local development folders from source checks.

NBA Play-by-Play V3

  • nba_playbyplayv3() function added — dedicated wrapper for the NBA Stats PlayByPlayV3 endpoint.
  • nba_pbp() and nba_pbps() now default to version = "v3" (previously "v2"). Pass version = "v2" to use the previous behavior.
  • .v3_to_v2_format() internal helper added — converts V3 play-by-play data to V2-compatible column format with mapped event types, player resolution, and retained V3 shot coordinate columns (x_legacy, y_legacy, shot_distance, shot_result, is_field_goal, points_total, shot_value).
  • .build_player_roster() internal helper added — retrieves player roster from nba_boxscoretraditionalv3() for name-to-ID resolution during V3-to-V2 conversion.
  • .players_on_court_v3() internal helper rewritten — now uses nba_gamerotation() stint data with interval mapping for robust on-court player determination (replaces previous substitution-parsing approach).
  • nba_pbp() p parameter is now optional (default: NULL) — previously required even when not using progress tracking.
  • Removed stringr::str_match import from NAMESPACE — V3 clock parsing now uses base R regex functions.

NBA Boxscore Summary V3

  • nba_boxscoresummaryv3() function added — returns a named list of 9 data frames: GameSummary, GameInfo, ArenaInfo, Officials, LineScore, InactivePlayers, LastFiveMeetings, OtherStats, AvailableVideo.

New NBA Stats API Endpoint Wrappers

  • nba_commonteamyears() function added — returns team IDs with their active year ranges.
  • nba_dunkscoreleaders() function added — returns dunk tracking data with biomechanics, scores, and style metrics.
  • nba_gravityleaders() function added — returns gravity scores measuring how much defensive attention each player draws.
  • nba_iststandings() function added — returns In-Season Tournament (NBA Cup) standings.
  • nba_scheduleleaguev2int() function added — returns international schedule data with broadcaster information.
  • nba_teamandplayersvsplayers() function added — returns team and player lineup comparison stats (5 datasets).
  • nba_videoeventsasset() function added — returns video event asset data for a given game event.

ESPN & G-League Functions

  • espn_nba_team_current_roster() function added — returns current team roster from ESPN.
  • espn_mbb_team_current_roster() function added — returns current MBB team roster from ESPN.
  • nbagl_live_pbp() function added — returns live G-League play-by-play data.
  • nbagl_live_boxscore() function added — returns live G-League box score data.

Other Improvements

  • Internal nba_endpoint() registry updated with all V3 boxscore endpoints and boxscoresummaryv3.
  • Removed deprecated qs dependency.
  • Updated GitHub Actions to v4.
  • Cleaned up .Rbuildignore duplicates.
  • Added comprehensive CONTRIBUTING.md with naming conventions and test environment documentation.
  • Moved furrr and future dependencies to Suggests with version requirements for users who want to use parallel features, but not required for core functionality.
  • Add lifecycle dependency and deprecation warnings for unstable functions/endpoints to guide users to maintained alternatives.

Bug Fixes

  • Fixed df_list not initialized before tryCatch in 147 NBA Stats API wrapper functions, preventing crashes on API errors.
  • Fixed nba_data_pbp() plays_df not initialized before tryCatch.
  • Fixed helper-skip.R test guard functions to use proper string comparison (!= "1") instead of numeric comparison (== 0).
  • Fixed nba_dunkscoreleaders() HTTP 400 error caused by empty string parameters.
  • Fixed V3-style data.frame parsing for leader/standings endpoints.
  • Fixed nba_iststandings() nested games column flattening.
  • Fixed %||% import for R < 4.4.0 compatibility.
  • Fixed data not initialized before tryCatch in nba_playbyplayv3() and nba_pbp(), preventing crashes on API errors.
  • Fixed nbagl_pbp() to avoid on-court enrichment dependency failures for G-League game IDs by using the stable core play-by-play path.
  • Fixed NBAGL wrapper defaults for error paths where return objects were not initialized before tryCatch.

Deprecations

  • Deprecated nba_boxscorefourfactorsv2() in favor of nba_boxscorefourfactorsv3() due to unstable/partial V2 API responses.
  • Deprecated nba_boxscoremiscv2() in favor of nba_boxscoremiscv3() due to unstable/partial V2 API responses.
  • Deprecated nba_boxscorescoringv2() in favor of nba_boxscorescoringv3() due to unstable/partial V2 API responses.
  • Deprecated nba_boxscoreusagev2() in favor of nba_boxscoreusagev3() due to unstable/partial V2 API responses.
  • Deprecated nba_boxscoreplayertrackv2() in favor of nba_boxscoreplayertrackv3() due to unstable/partial V2 API responses.
  • Deprecated nba_boxscorehustlev2() in favor of nba_hustlestatsboxscore() due to unstable/partial V2 API responses.
  • Deprecated nba_homepageleaders() in favor of nba_leagueleaders() due to unstable/empty endpoint responses.
  • Deprecated nba_homepagev2() in favor of nba_leagueleaders() due to unstable/empty endpoint responses.
  • Deprecated nba_leaderstiles() in favor of nba_leagueleaders() due to unstable/empty endpoint responses.
  • Deprecated nba_teamgamestreakfinder() in favor of nba_teamgamelogs() due to unstable/empty endpoint responses.
  • Deprecated nba_teamhistoricalleaders() in favor of nba_franchiseleaders() due to unstable/empty endpoint responses.
  • Deprecated nba_videodetails() in favor of nba_videodetailsasset() due to unstable/empty endpoint responses.
  • Deprecated nba_winprobabilitypbp() in favor of nba_playbyplayv3() due to unstable/empty endpoint responses.
  • Deprecated nba_playercareerbycollege() in favor of nba_playercareerbycollegerollup()/nba_leaguedashplayerbiostats() due to unstable/empty endpoint responses.
  • Deprecated nba_playernextngames() in favor of nba_playerprofilev2() due to unstable/empty endpoint responses.
  • Deprecated nba_scoreboard() in favor of nba_scoreboardv3() due to unstable/empty endpoint responses.
  • Deprecated nba_scoreboardv2() in favor of nba_scoreboardv3() due to unstable/partial endpoint responses.

Test Improvements

  • Converted 400+ expect_equal(colnames()) assertions to expect_in() for subset validation, preventing test failures when APIs add new columns.
  • Added tests for all new endpoints with column validation and rate limiting.
  • Added skip_ncaa_mbb_test() and skip_ncaa_wbb_test() helpers.
  • Updated ESPN test expectations for current API responses.
  • Updated NBAGL tests to validate NBA Stats-backed return shapes (nbagl_players() and nbagl_standings() named-list returns, and current schedule/PBP core columns).

hoopR 2.1.0

Choose a tag to compare

@saiemgilani saiemgilani released this 26 Nov 04:42
  • load_nba_*() functions now use sportsdataverse-data releases url instead of hoopR-data repository URL
  • load_mbb_*() functions now use sportsdataverse-data releases url instead of hoopR-data repository URL
  • nba_pbp() and nba_pbps() functions add parameter on_court (default TRUE) to return on-court players for each play event, courtesy of @shufinskiy

hoopR 2.0.0

NBA Stats API Live Endpoints

  • nba_live_pbp() function added.
  • nba_live_boxscore() function added.
  • nba_todays_scoreboard() function added.

NBA Boxscore V3 (and V3-styled) Endpoints Added

  • nba_scoreboardv3() function added.
  • nba_boxscoretraditionalv3() function added.
  • nba_boxscoreadvancedv3() function added.
  • nba_boxscoremiscv3() function added.
  • nba_boxscorescoringv3() function added.
  • nba_boxscoreusagev3() function added.
  • nba_boxscorefourfactorsv3() function added.
  • nba_boxscoreplayertrackv3() function added.
  • nba_boxscorematchupsv3() function added.
  • nba_boxscorehustlev2() function added.
  • nba_boxscoredefensivev2() function added.

Other NBA Stats API functions added

  • nba_shotchartlineupdetail() function added.
  • nba_synergyplaytypes() function added.
  • nba_franchiseleaderswrank() function added.
  • nba_videodetailsasset() function added.
  • nba_infographicfanduelplayer() function added.
  • nba_teams() function added.

Other Functions Added

  • ncaa_mbb_teams() function added.

Proxy Capability Added and Other Notes

  • Add rlang dots option for passing httr::use_proxy() option to nba_*() functions
  • Returns documentation added for all working NBA Stats API endpoints and ESPN functions
  • Tests added for all working NBA Stats API endpoints and ESPN functions, over 1000 tests when
    run locally

hoopR 1.9.1

  • Updates under-the-hood urls to the ESPN site API v2 summary endpoints

hoopR 1.9.0

  • Takes care of tidyselect deprecation of data masking for certain tidyr and dplyr functions.
  • Regular minor maintenance on kp_* functions
  • espn_mbb_game_rosters() function added.
  • espn_nba_game_rosters() function added.

hoopR 1.8.1

  • espn_mbb_player_stats() function exported properly.
  • espn_nba_player_stats() function exported properly.
  • Fixing headers for kp_ functions.

hoopR 1.8.0

Choose a tag to compare

@saiemgilani saiemgilani released this 20 Jun 18:12
  • espn_mbb_player_stats() function added.
  • espn_mbb_team_stats() function added.
  • espn_nba_player_stats() function added.
  • espn_nba_team_stats() function added.
  • nba_pbps() function added, courtesy of @papagorgio23.
  • nbagl_players() function added, courtesy of @billyfryer.
  • nbagl_schedule() function added, courtesy of @billyfryer.
  • nbagl_pbp() function added, courtesy of @billyfryer.
  • nbagl_standings() function added, courtesy of @billyfryer.
  • nba_gamerotation() function added.
  • nba_playerindex() function added.
  • nba_playerheadshot() function added.
  • nba_drafthistory() function added.

hoopR 1.5.0

Choose a tag to compare

@saiemgilani saiemgilani released this 10 Nov 15:00
  • hoopR v1.5.0 on the CRAN, third package of the sportsdataverse to make it's way onto CRAN thus far
  • Major documentation update to include names of returned lists of data frames for all exported NBA Stats API, ESPN API, KenPom, NCAA and Data repository functions.

hoopR 1.4.5

Choose a tag to compare

@saiemgilani saiemgilani released this 29 Oct 10:15
e43e0ae
  • Add kp_referee() function

hoopR 1.4.4

Choose a tag to compare

@saiemgilani saiemgilani released this 28 Oct 22:07
  • Remove referee ranks from kp_box() function

hoopR 1.4.3

Choose a tag to compare

@saiemgilani saiemgilani released this 27 Oct 14:34
f30b679
  • Option configs changed to revert to user options

hoopR 1.4.2

Choose a tag to compare

@saiemgilani saiemgilani released this 27 Oct 02:24
7e0ae03
  • Implement additional boxscore function parameters for nba_boxscore(.*) functions

hoopR 1.4.1

Choose a tag to compare

@saiemgilani saiemgilani released this 26 Oct 23:51
386c23d
  • Update teams_links internal dataset for 2022 (need a better solve here)
  • Added nba_teams dataset for working with the NBA Stats API

hoopR 1.4.0

Choose a tag to compare

@saiemgilani saiemgilani released this 19 Oct 14:34
009b3cf