GithubHelp home page GithubHelp logo

alejandrogobu / nba_data_modeling Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 3.0 6.09 MB

Using the official NBA API, this repo explains how to ingest, store, transform, and serve insights

Python 100.00%

nba_data_modeling's Introduction

NBA

This repository provides a comprehensive guide on extracting, storing, transforming, and serving data from the official NBA API.

Overview

This ongoingproject aims to provide a holistic approach to NBA data analysis. Current offerings include:

  • Data Extraction:
    • Retrieval of data from the NBA API through Python scripts.
    • Conversion of this data to .csv format.
  • Data Storage:
    • Utilizing SnowSQL to persist .csv data as tables in Snowflake.

Prerequisites

Ensure the following are set up on your system before diving in:

  • Python: This project uses Python 3.11, but other versions might work.
  • NBA API Package: Install the required Python package using pip:
pip install nba_api

Data Ingestion

Run the Python scripts located in the extract directory in your terminal or code editor of choice. These scripts will ingest data from various NBA API endpoints and save them as CSV files. Once executed, you will find the following CSV files in your extract folder:

  • common_player_info.csv: Information on each player from the 2022 NBA season.
  • games.csv: Statistics from each game played during the 2022 NBA season.
  • player_game_logs.csv: Detailed statistics per player per game from the 2022 NBA season.
  • player_salaries_output.csv: Salaries data for each player during the 2022 NBA season.
  • team_game_logs.csv: Game statistics for each team from the 2022 NBA season.
  • team_salaries.csv: Salary information for each team during the 2022 NBA season.
  • team_year_by_year_stats.csv: Year-by-year statistics for each team during the 2022 NBA season.
  • teams.csv: Information about each team from the 2022 NBA season.

Note: If you get stuck, you can download the nba_compressed_CSVs and more on to the next step - Data Storage

Data Storage

  1. Refer to the provided code in the storage file.
  2. For a more in-depth guide, check out Phil Dakin's SnowSQL tutorial. Use SnowSQL to store data as tables in Snowflake. You can reference the code in the storage file I provided or you can follow along with Phil Dakin's excellent SnowSQL tutorial.

Data Modeling

Model your data using Paradime.io or your preferred dbt platform/IDE:

  1. Execute the SQL files located in the Models directory:

nba_data_modeling's People

Contributors

jpooksy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.