Git Product home page Git Product logo

playersapi's Introduction

PlayerAPI

NBA Player API

Data source

Data is downloaded from Kaggle as csv and stored in nbaplayerdb in MySql

Install MySql

Use a docker instance in wsl or Linux or windows docker desktop and install an instance of mysql Connect to the instance using MySql workbench

Steps to transform data from csv to mysql nbaplayerdb

  1. crate the database nbaplayerdb create database nbaplayerdb;
  2. right click on nbaplayerdb and select table data import wizard
  3. browse the file path and select the file
  4. the table will be created with the same name as file name and data will auto imported to that table

REST API in ASP Dotnet Core to get information about NBA Players

Run the asp dotnet core application using visual studio as IIS Profile or command line by

  1. Move inside directory PlayerAPI using cd ./PlayerAPI
  2. run dotnet run --launch-profile "NBAPlayerApi" it will run at localhost 7118 as this port is configured inside Properties/launchSetting.json

or run it in docker container use the localhost:port of the server running for the api call, eg web api is running on localhost:44384 in IIS Profile using visual studio

Add the MySql connection string in appsetting.json for local setup or use key vault if needed or secret.json file

REST end points

https://localhost:44384/api/players/{playerId} -> fetches the player data for that particular Id

https://localhost:44384/api/players -> fetches all players data (this is time intensive and memory expensive when data set is large)

https://localhost:44384/api/players/stream -> fetches all players data as async stream this is efficient

EfCore with MySql is used as ORM for CRUD operation

playersapi's People

Contributors

allen-turing avatar

Watchers

 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.