Skip to content

feat: add wnba live endpoint#555

Open
nmodi wants to merge 3 commits intoswar:masterfrom
nmodi:master
Open

feat: add wnba live endpoint#555
nmodi wants to merge 3 commits intoswar:masterfrom
nmodi:master

Conversation

@nmodi
Copy link
Copy Markdown

@nmodi nmodi commented Jul 25, 2025

Added boxscore endpoint for Live WNBA data.

My initial approach was to simply create a new WNBALiveHTTP class and switch which LiveNBAHTTP class to use (in the existing endpoint) based on gameID, but this seemed to conflict with the pattern used in the rest of the repo. Another issue with my initial approach is that there would be an inconsistency with the Scoreboard endpoint which does not rely on a gameId, unless we required a league parameter be passed in.

Instead, I created a new endpoint within a wnba package. I added only the boxscore endpoint to start, for approval on this design. I'm also happy to switch back to the initial approach or discuss on this.

Please let me know if I missed anything!

@rsforbes
Copy link
Copy Markdown
Contributor

rsforbes commented Sep 3, 2025

@nmodi - Great PR. Looking through the code, it appears that only the base_url and host header are actual differences from the live/nba endpoint. Can you confirm?

I'm curious on your opinion of two approaches in order to avoid duplicating the code.

  1. We could abstract the live/nba code into some abstract base classes and over-ride functionality where there are actual differences.

example:

Live_ABC
|-- Live_NBA 
|-- Live_WNBA 
  1. Keep one code base and reuse the LeagueID parameter.
class LeagueID:
    nba = "00"
    aba = "01"
    wnba = "10"
    summer_league = "15"
    g_league = "20"

    default = nba

Pros and cons for both. thoughts?

@nmodi
Copy link
Copy Markdown
Author

nmodi commented Sep 15, 2025

@rsforbes,

"it appears that only the base_url and host header are actual differences from the live/nba endpoint"

Yes, this is correct.

If we want to reduce code duplication, I would lean towards the second option. Most of the code would be identical; the only difference would be to use a different HTTP object.

@swar
Copy link
Copy Markdown
Owner

swar commented Jan 9, 2026

If the code is similar enough then I think using the LeagueID parameter might be a better and cleaner approach for long term maintenance. My opinion is that we should only do the more abstracted / code heavy approach if we have a need and can't accomplish it with the easier approach.

@nmodi nmodi marked this pull request as ready for review March 23, 2026 22:10
@nmodi nmodi requested a review from swar as a code owner March 23, 2026 22:10
@nmodi
Copy link
Copy Markdown
Author

nmodi commented Mar 23, 2026

Hello, I've updated the PR per the previous discussions. I apologize for the lengthy delay. The new changes are simpler with less duplicated code.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants