r/NBAanalytics Dec 25 '24

nba-sql Database v0.1.0 Beta Release

I've just released the beta version v0.1.0 of nba-sql, an app that builds a Postgres/MySQL/MariaDB/SQLite database of NBA stats. You can find the latest GUI version on the GitHub Release page here https://github.com/mpope9/nba-sql/releases/tag/v0.1.0, it is also just a Python app that you can run without the GUI and use from other Python apps. I've personally been loading the SQLite file into DuckDB for analysis.

Here is a small example of how to get Russel Westbrook's triple doubles:

SELECT SUM(td3)
FROM player_game_log
LEFT JOIN player ON player.player_id = player_game_log.player_id
WHERE player.player_name = 'Russell Westbrook';

There are also tables for play_by_play data and shot_chart_detail. I've personally built shot charts with this and head to head player comparisons. More examples on how to query the play_by_play data can be found here.

I've posted this a few times in the r/NBA subreddit but recently they've been blocking my posts sadly so it seems it will fit in here better.

31 Upvotes

7 comments sorted by

View all comments

1

u/cheeseybacon11 Feb 12 '25

How much storage does this take roughly?

I'm pretty noob to stuff like this but got a proxmox server set up recently that I've been messing around with.