Import players and game pairings from pgn

In this article you will learn how to import players and games from a pgn file. The practical use for this feature is to quickly import players and pairings from your pairing system. Most pairing systems can create a pgn file with the games for a round, and this pgn file can easily be imported so that the players and games are created in Clono without manual input.

Example use case
1. Create your tournament and groups in the admin panel the regular way.

2. Go to the games section. Make sure that you select the group that you want to import the players and games to, and click the button "Import pairings from pgn".

3. Select the pgn file and run the import. The success message will inform you of which players and games that was imported.

4. Check that everything looks correct, and you are ready to run the games!

Detailed description of how the pgn import works
All valid PGNs should include the Seven Tag Roster (STR) (see http://www.saremba.de/chessgml/standards/pgn/pgn-complete.htm#c8.1.1) consisting of:
- Event (the name of the tournament or match event)
- Site (the location of the event)
- Date (the starting date of the game)
- Round (the playing round ordinal of the game)
- White (the player of the white pieces)
- Black (the player of the black pieces)
- Result

For the Clono PGN import, only the Event, Round, White and Black tags are mandatory.
The contents of the Event tag do not matter, but the tag is used to identify the start of a new game in the PGN file.

Optional tags whose contents will also be imported include:
- Group (1)
- WhiteElo (2)
- BlackElo (2)
- WhiteTitle
- BlackTitle
- WhiteTeam
- BlackTeam
- Table (3)

(1) If the PGN doesn't include the Group tag, or the Group tag specifies a group name that does not exist in the tournament you're importing the PGN to, the group that you selected in the Admin panel will be used.)

(2) Elo specified in the PGN will be used as the player's international and national rating.

(3) If the Table tag is not specified, the import will attempt to determine the table based on the Round tag, following the convention that the rounds will be specified as <round>.<table> or <round>.<team table>.<player table>. When a team table number is specified, Clono sets the table number to <team table> * 10 + <player table>. For example:

i) [Round "1.3"] will be interpreted as round 1, table 3.
     
ii) [Round "2"], [Table "4"] will be interpreted as round 2, table 4.
     
iii) [Round "2.3.1"] will be interpreted as round 2, team table 3, player table 1, which will be imported as round 2, table 31.
     
iv) [Round "2"], [Table "1.3"] will be interpreted as round 2, team table 1, player table 3, which will be imported as round 2, table 13.