Skip to main content

Sportsbox

Project description

sportsbox

Discord bot and independent helper functions displaying sports news and convenient stats.

Build Status codecov PyPI docs

Overview

This Discord bot allows users to view NBA and NFL news, scores, and stats on their servers with intuitive commands. The commands are named after the key words I always search with. I always found it annoying to constantly search up stats for a game I was monitoring while studying and I was too lazy to install official apps too. This alleviates the inconvenience of always having to manually search up stats or open one's phone while working or playing games with friends as Discord is usually always open on someone's computer.


Installation

pip install sports-box

Usage

from sportsbox import showUpcomingGames, getPlayer, playerStats, playerNextNGames, getTeam, getScores, getNBANews, getNFLNews

#Get basic player information and career regular season stats returned as dataframes
player_info_df = getPlayer("Lebron James")
player_stats_df = playerStats("Lebron James")

#Show upcoming next N games for a player as a matplotlib plot
showUpcomingGames("Lebron James", 3)

#Get upcoming next N games with more details for a player returned as a dataframe
player_games_df = playerNextNGames("Lebron James", "3")

#Get basic team information returned as dataframe
team_info_df = getTeam("mil")

#Get today's NBA box scores returned as a list of Game objects
today_scores = getScores()

#Get 5 recent NBA or NFL articles returned as set of Article objects
nbanews = getNBANews()
nflnews = getNFLNews()

Game class attributes

Attribute Variable Value
gameStatus 1 not started, 2 in progress, 3 finished
gameStatusText start time (ET), Qx and time remaining, FINAL
homeTeam EX: LAL
hWins home team wins
hLosses home team losses
hScore home team's current score
awayTeam EX: LAC
aWins away team wins
aLosses away team losses
aScore away team's current score

Article class attributes

Attribute Variable Value
headline headline of the ESPN article
description description of the ESPN article
link link to ESPN article

Invite as Discord bot (NOTE: currently not hosted on server yet!)

Invite sportsbox to your Discord server!

Commands

!nbanews - Shows 5 random recent NBA news articles

!nflnews - Shows 5 random recent NFL news articles

!nbascores - Shows today's NBA box scores


Development

Read CONTRIBUTING.md file


Upcoming Features

  • Bot command to post a random trending sports highlight

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

sports-box-0.1.2.tar.gz (2.3 MB view details)

Uploaded Source

File details

Details for the file sports-box-0.1.2.tar.gz.

File metadata

  • Download URL: sports-box-0.1.2.tar.gz
  • Upload date:
  • Size: 2.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for sports-box-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b25a6e762a84bb3faf2713fbdb1af9d1a08b9fd806fce65e4ba39ff89f8e7443
MD5 f617d1008b1f32a441118156bdf8a2bf
BLAKE2b-256 2fe16aa318f8bc432160e47748f1085a73dbb21b8366358bd6bf887b5ea2b1fa

See more details on using hashes here.

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