Skip to main content

Unofficial audl api

Project description

AUDL API

Unofficial AUDL api for python users

What it does:

  • Fetch Data directly from audl website
  • Update database from Web Scrapping using workflow

Table of Contents

Requirements

Download package with pip install audl

  1. Install requirements pip install -r requirements
  2. Having sqlite3: sudo apt install sqlite3

Features

AUDL Stats

Usage

How to get player profile

from audl.stats.endpoints.playerprofile import PlayerProfile

# Fetching dataframe from https://theaudl.com/league/players/cbrock
player = PlayerProfile('cbrock')
reg = player.get_regular_seasons_career()
playoffs = player.get_playoffs_career()
games = player.get_season_games_stats(2019)

How to get Team Stats

image

Season=['career', 2022, ..., 2012] Per=['total', 'game'] Team=['team', 'opponent']

from audl.stats.endpoints.teamstats import TeamStats

# fetching from: https://theaudl.com/stats/team
team_stats = TeamStats('career', 'game', 'opponent') # TeamStats(season, per, team)
df = team_stats.get_table()

How to get Player Stats

image

Season=['career', 2022, ..., 2012] Per=['total', 'game', 'points', 'possessions', 'minutes']

from audl.stats.endpoints.playerstats import PlayerStats

# from https://theaudl.com/stats/player-stats
playerstats = PlayerStats('career', 'total', 'breeze').fetch_table()  # PlayerStats(season, per, team)

How to fetch season schedule

from audl.stats.endpoints.seasonschedule import SeasonSchedule, TeamSeasonSchedule, AllSchedule, TeamSeasonAgainstOpponentSchedule

# Fetch complete season schedule from https://theaudl.com/league/game-search

df = SeasonSchedule(2022).get_schedule()
df = TeamSeasonSchedule(2022, 'royal').get_schedule()
df = AllSchedule().get_schedule()
df = TeamSeasonAgainstOpponentSchedule(2022, 'royal', 'rush').get_schedule()

How to get game statistics

from audl.stats.endpoints.gamestatsboxscores import GameStatsBoxScores
from audl.stats.endpoints.gamestatsrosters import GamesStatsRosters
from audl.stats.endpoints.gamestatslineups import GameStatsLineups
from audl.stats.endpoints.gamestatsteamstats import GameStatsTeamStats

# Fetching Box Scores from https://theaudl.com/stats/game/2021-06-05-RAL-ATL
box_scores = GameStatsBoxScores("2021-06-05-RAL-ATL").get_box_scores()

# Fetching Roster Metadata
rosters = GamesStatsRosters("2021-06-05-RAL-ATL")
roster_home = rosters.get_roster_home_metadata()
roster_away = rosters.get_roster_away_metadata()

# Fetching Lineups Points by Points
lineups = GameStatsLineups("2021-07-16-DAL-SEA")
lineup_home = lineups.get_home_points_by_points_lineups())
lineup_away = lineups.get_away_points_by_points_lineups())

# Fetching Team Stats
team_stats = GameStatsTeamStats("2021-07-16-DAL-SEA").get_team_stats()

Exploration

  • Proportion of touches per player on offensive points
  • Proportion of passes to teamates for each players (see connection)
  • Who is the best in the rain? (player efficiency vs temperature)
  • Most likely player to blow up

Tree

How to contribute

Ressources

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

audl-0.0.4.tar.gz (48.2 kB view hashes)

Uploaded Source

Built Distribution

audl-0.0.4-py3-none-any.whl (51.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page