A library for running tournaments
'no-teg' (get-on backwards) is a library for running tournaments. In the beginning it will be simple i.e. setting up and advancing through different tournament styles. Eventually if things go smoothly the library will also compute data on the tournaments and players. Being open-source, I hope that people will add tournament styles and different analysis that are dependent on different games.
pip install no-teg
import no_teg as nt
from no_teg.tourneys import single_elimination
p1 = nt.Player("P1")
p2 = nt.Player("P2")
p3 = nt.Player("P3")
p4 = nt.Player("P4")
MyGame = nt.Game()
MyTourney = single_elimination.Single_Elimination(MyGame)
MyTourney.add_players([p1, p2, p3, p4])
MyTourney.start()
MyTourney.print_matchups()
1: P2 (A) vs P1 (H)
2: P4 (A) vs P3 (H)
# arguments are matchup_id, away_score, home_score, extra stats (see Further Examples on docs page)
MyTourney.input_result(1, 3, 2, [])
MyTourney.input_result(2, 0, 4, [])
MyTourney.print_results()
1: P2 (3) vs P1 (2)
2: P4 (0) vs P3 (4)
# P2 and P3 advance to the finals
MyTourney.print_matchups()
1: P2 (A) vs P1 (H)
2: P4 (A) vs P3 (H)
3: P2 (A) vs P3 (H)
# P2 wins the tournament!
MyTourney.input_result(3, 2, 1, [])
MyTourney.print_results()
1: P2 (3) vs P1 (2)
2: P4 (0) vs P3 (4)
3: P2 (2) vs P3 (1)
- Single_Elimination
- Round_Robin
make
: list available commandsmake develop
: install and build this library and its dependencies usingpip
make build
: build the library usingsetuptools
make lint
: perform static analysis of this library withflake8
andblack
make format
: autoformat this library usingblack
make annotate
: run type checking usingmypy
make test
: run automated tests withpytest
make coverage
: run automated tests withpytest
and collect coverage informationmake dist
: package library for distribution