Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@nmodi
Copy link

@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
Collaborator

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
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.

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.

2 participants