30 Commits
Author SHA1 Message Date
nprasad2077 ce3641b970 Update README.md 2024-07-10 13:37:24 -05:00
nprasad2077 878f8b549c New REST API Release 2024-06-28 09:48:32 -05:00
nprasad2077 1a3338ca68 Update README.md 2024-06-28 09:48:07 -05:00
nprasad2077 c575b4a74d Update README.md 2024-05-16 15:27:46 -05:00
nprasad2077 c664c9177d Update README.md 2024-05-16 13:47:12 -05:00
Nikhil Prasad a5db9d1110 Update README.md 2023-07-03 14:01:39 -05:00
Nikhil Prasad dc9b0df5be Update README.md
run in postman button
2023-06-23 19:53:48 -05:00
Nikhil Prasad 0dd41194d6 Update README.md 2023-06-23 19:39:13 -05:00
Nikhil Prasad 240449903c Update README.md 2023-06-23 19:33:11 -05:00
Nikhil Prasad ea5b535d50 Update README.md 2023-06-23 19:22:49 -05:00
Nikhil Prasad b38acd64cb Update README.md 2023-06-23 19:20:11 -05:00
Nikhil Prasad 204cc1a00d Merge pull request #15 from nprasad2077/deploy
Deploy
2023-06-23 19:11:52 -05:00
nprasad2077 150bda67ca player name and season totals query; 2023-06-22 21:21:12 -05:00
nprasad2077 395f15683a player lookup changes 2023-06-22 21:06:39 -05:00
nprasad2077 8010111e82 Merge branch 'main' of github.com:nprasad2077/nbaStats into deploy 2023-06-22 20:59:42 -05:00
Nikhil Prasad caa97b109a Update README.md 2023-06-20 11:59:19 -05:00
nprasad2077 030cfcd1d9 updated playoffs limit 2023-05-24 22:00:26 -05:00
nprasad2077 ae1b6a49f8 updated top players limit 2023-05-24 21:54:33 -05:00
nprasad2077 405d3d0356 modify success message 2023-05-24 18:43:59 -05:00
Nikhil Prasad fcfb8eadbe Merge pull request #14 from nprasad2077/dev
Dev
2023-05-11 16:14:02 -05:00
Nikhil Prasad ff8084966a Merge pull request #12 from nprasad2077/dev
Dev
2023-05-10 15:33:30 -05:00
Nikhil Prasad 0e04f29d37 Merge pull request #10 from nprasad2077/dev
Dev
2023-05-08 18:54:16 -05:00
Nikhil Prasad 31ee84dfe8 Merge pull request #8 from nprasad2077/dev
Dev
2023-05-02 02:09:15 -05:00
Nikhil Prasad f7fceb12fa Merge pull request #7 from nprasad2077/dev
Dev
2023-04-27 13:41:43 -05:00
Nikhil Prasad 13132473b1 Merge pull request #6 from nprasad2077/dev
Dev
2023-04-27 11:01:08 -05:00
Nikhil Prasad 45206c38bb Merge pull request #5 from nprasad2077/dev
Dev
2023-04-21 20:28:20 -05:00
Nikhil Prasad 9117807179 Merge pull request #4 from nprasad2077/dev
env changes
2023-04-20 16:18:54 -05:00
Nikhil Prasad 84f449b1e4 Merge pull request #3 from nprasad2077/dev
working on data verification
2023-04-18 21:47:53 -05:00
Nikhil Prasad 01604850ce Merge pull request #2 from nprasad2077/dev
Dev
2023-04-18 16:14:56 -05:00
Nikhil Prasad 00d8fdcf23 Merge pull request #1 from nprasad2077/dev
Dev
2023-04-14 00:15:58 -05:00
4 changed files with 3462 additions and 398 deletions

No files matched your search

+3449 -385
View File
File diff suppressed because it is too large. Load diff
@@ -27,7 +27,7 @@ from nba_data.models import PlayerPlayoffAdvancedData
# Change LAC to SDC for 1984 and prior. # Change LAC to SDC for 1984 and prior.
teams = ['HOU' ,'PHI', 'BOS', 'NYK', 'BRK', 'TOR', 'MEM', 'NOP', 'DAL', 'SAS', 'DEN', 'MIN', 'OKC', 'UTA', 'POR', 'MIL', 'CLE', 'CHI', 'IND', 'DET', 'SAC', 'PHO', 'GSW', 'LAC', 'LAL', 'MIA', 'ATL', 'WAS', 'ORL', 'CHA'] teams = ['ATL', 'BOS', 'BRK', 'CHI', 'CHO', 'CLE', 'DAL', 'DEN', 'DET', 'GSW', 'HOU', 'IND', 'LAC', 'LAL', 'MEM', 'MIA', 'MIL', 'MIN', 'NOP', 'NYK', 'OKC', 'ORL', 'PHI', 'PHO', 'POR', 'SAC', 'SAS', 'TOR', 'UTA', 'WAS']
single_team = ['GSW'] single_team = ['GSW']
+4 -4
View File
@@ -12,10 +12,10 @@ django.setup()
from nba_data.models import PlayerShotChartData from nba_data.models import PlayerShotChartData
player_name = 'LeBron James' player_name = 'James Harden'
season = 2014 season = 2010
# team = 'LAL' # You might want to find a way to get this from the webpage # team = 'LAL' # You might want to find a way to get this from the webpage
url = 'https://www.basketball-reference.com/players/j/jamesle01/shooting/' + \ url = 'https://www.basketball-reference.com/players/h/hardeja01/shooting/' + \
str(season) str(season)
response = requests.get(url) response = requests.get(url)
@@ -110,4 +110,4 @@ try:
except Exception as e: except Exception as e:
print(f"Error inserting data into database: {e}") print(f"Error inserting data into database: {e}")
print('success') print(f"success {player_name} {season}")
+8 -8
View File
@@ -30,22 +30,22 @@ class PlayerDataByTeamList(generics.ListAPIView):
return PlayerData.objects.filter(team=team) return PlayerData.objects.filter(team=team)
# Fetch player data by season # Fetch player totals data by season
class PlayerDataBySeasonList(generics.ListAPIView): class PlayerDataBySeasonList(generics.ListAPIView):
serializer_class = PlayerDataSerializer serializer_class = PlayerTotalsDataSerializer
def get_queryset(self): def get_queryset(self):
season = self.kwargs['season'] season = self.kwargs['season']
return PlayerData.objects.filter(season=season) return PlayerTotalsData.objects.filter(season=season)
# Fetch player data by player name # Fetch player totals data by player name
class PlayerDataByNameList(generics.ListAPIView): class PlayerDataByNameList(generics.ListAPIView):
serializer_class = PlayerDataSerializer serializer_class = PlayerTotalsDataSerializer
def get_queryset(self): def get_queryset(self):
name = self.kwargs['name'] name = self.kwargs['name']
return PlayerData.objects.filter(name__icontains=name) return PlayerTotalsData.objects.filter(player_name__icontains=name)
# Fetch Top 20 players by PTS DESC for the season specified. # Fetch Top 20 players by PTS DESC for the season specified.
@@ -62,7 +62,7 @@ class TopScorersbySeasonTotalsList(generics.ListAPIView):
def get_queryset(self): def get_queryset(self):
season = self.kwargs['season'] season = self.kwargs['season']
return PlayerTotalsData.objects.filter(season=season).order_by('-PTS')[:20] return PlayerTotalsData.objects.filter(season=season).order_by('-PTS')[:200]
# Fetch and calculate the average 3P made, 3P attemps, 2P made, 2P attempts for all players in each season. # Fetch and calculate the average 3P made, 3P attemps, 2P made, 2P attempts for all players in each season.
@@ -631,7 +631,7 @@ class TopScorersbySeasonListPlayoffs(generics.ListAPIView):
def get_queryset(self): def get_queryset(self):
season = self.kwargs['season'] season = self.kwargs['season']
return PlayerPlayoffTotalsData.objects.filter(season=season).order_by('-PTS')[:20] return PlayerPlayoffTotalsData.objects.filter(season=season).order_by('-PTS')[:200]
class TopAssistsBySeasonListPlayoffs(generics.ListAPIView): class TopAssistsBySeasonListPlayoffs(generics.ListAPIView):