pairstately - Pair players for the next round of a swiss tournament




--man A man page
--help This help message



The scripts in script_files/ need to be installed somewhere so that they can be run in the directory in which pairing of each round is done.


The scripts assume that there is a directory in which a configuration file, called league.yaml, with data about the players exists. Also in the directory is a subdirectory called 'comp'. The rounds are paired in subdirectories, named 1,2,3,.. of this directory, 'comp'. Files named:

brackets.yaml pairing.yaml round.yaml matches.yaml player.yaml tourney.yaml

are left in these subdirectories after pairing. Don't delete these, as they are what allows data to be carried over from round to round.

Scores are in the file 'scores.yaml' in these subdirectories.


Do NOT use tabs in these YAML files. The level of indentation is significant. Follow the examples closely. The first, league.yaml has lines of the form:

member: - id: 1 name: Laver, Rod rating: 2810 title: Grandmaster - id: 2 name: Sampras, Pete rating: 2800 title: Unknown - id: 3 name: McEnroe, John rating: 2780 title: Unknown

You can use your own scoring scheme, and colors (called, roles). You can add your own data to the member records. A pairing number is generated for the players, so don't include a pairing number, unless this is a player introduced into the tournament after the first round. The new id (ie pairing number) is added to league.yaml. This is a bit tricky. I am working with names here (eg with the absentees and the pairings left in round.yaml). TODO Configuration of your own scoring scheme looks like it is broken. The score files: 1.yaml, etc, are of the form:

1: - 'Laver, Rod': Loss - 'Sampras, Pete': Win 2: - 'McEnroe, John': Bye

Alternatively, you can use number scores, and '=' etc. The old form of a mapping of names to results is still OK, but I will probably stop supporting it. First is the name of the player. (Every name will have to be unique.) Second is the result for that player.

eg 'Laver, Rod': Loss

I was using score files of the form:

1: 0 2: 1 3: 0.5

The use of pairing numbers rather than names has some advantages.


Starting with an empty main directory, create league.yaml, and an empty subdirectory for the first round. Run the script, 'pairstately' in the empty round subdirectory. A log of the pairing is printed and 'round.yaml' in the directory contains the matches. After the games in the round are complete, in the scores subdirectory, enter the scores for the players in the file, '1.yaml', or whatever the round is. Then you can run 'crosstable' or 'pairingtable' in the original directory above the subdirectory, to get current standings. If there is a next round, make another empty subdirectory, named after it and continue as before.