Package: scorebox-consoles
ScoreBox ConsolesPython interface for scoreboard consoles manufactured by Daktronics and Colorado Time SystemsSupported ConsolesDaktronics All Sport 5000:basketball: Basketball:football: Football:volleyball: Volleyball:water_polo: Water Polo:wrestling: WrestlingColorado Time Systems System 6:water_polo: Water PoloInstallationpip install scorebox-consolesUsagefromconsoles.sportsimportBasketballif__name__=='__main__':basketball=Basketball('COM1')game_state=basketball.export()Calls to sport classes must be protected by anif __name__ == '__main__'because the serial connection is read in a seperate processConnecting a ConsoleConsoles are connected with a Serial to USB cable.Daktronics All Sport 5000- Connect to the port labeled I/O Port (J6) with a DB25 to DB9 Serial connectorColorado Time Systems System 6- Tap into the 1/4" Scoreboard Out plug and connect the tip to pin 2 of a Serial DB9 connector and the shoe to pin 5.APISport classes take a serial port string as an argument and expose anexportmethod that returns the current game state.  All sport classes also feature anon_updatemethod that is designed to be reimplemented.  It is called everytime the state of the game changes, depending on the settings of the console, this can work out to be 10 times per second or faster.on_updatemust take a single variable, a Python dictionary that corresponds to the game state values described below for each sport.fromconsoles.sportsimportFootballdefdo_something(game_state):# Do something useful with the parse score console information# For example:home=game_state['home_score']visitor=game_state['visitor_score']ifhome>visitor:print(f'The Home Team leads{home}to{visitor}.')elifvisitor>home:print(f'The Visiting Team leads{visitor}to{home}.')else:print(f'The teams are tied at{home}')if__name__=='__main__':football=Football('COM1')football.on_update=do_something:basketball: BasketballKeyTypeDescription{home/visitor}_scoreintTeam Score{home/visitor}_timeoutsintTeam Timeouts Remaining{home/visitor}_foulsintTeam Fouls{home/visitor}_possesionboolTeam Possesion Status{home/visitor}_bonusboolTeam Bonus (1-on-1) Status{home/visitor}_double_bonusboolTeam Double Bonus (2 shots) StatusclockstrMain Clock Time (excludes timeout time), Tenths shown under 1 minute if configured in console settingsshotstrShot Clock Time, Tenths shown under 5 seconds if configured in console settingsperiodstrGame Period:football: FootballKeyTypeDescription{home/visitor}_scoreintTeam Score{home/visitor}_timeoutsintTeam Timeouts Remaining{home/visitor}_possesionboolTeam Possesion StatusclockstrMain Clock TimeplaystrPlay Clock TimequarterstrGame QuarterdownstrDown Number (includes ordination [ex.1ST])to_gointYards For First Downball_onintBall Location on the Field (does not include side of field)flagboolFlag Status (only updated on console button push):volleyball: VolleyballKeyTypeDescription{home/visitor}_scoreintTeam Score in Current Game{home/visitor}_setsintTeam Sets Woncurrent_setintGame Set:water_polo: Water PoloKeyTypeDescription{home/visitor}_scoreintTeam ScoreclockstrMain Clock TimeshotstrShot Clock TimeperiodstrGame PeriodWater Polo is supported on both Daktronics and Colorado Time Systems consoles: for Daktronics callWaterPoloDaktronics, for Colorado Time Systems callWaterPolo:wrestling: WrestlingKeyTypeDescription{home/visitor}_team_scoreintTeam Score{home/visitor}_match_scoreintMatch ScoreclockstrMain Clock TimeperiodstrMatch Period