Answers.Body: <p>Python has a pgn parser as part of its chess library.</p>
  <p><a href="https://python-chess.readthedocs.io/en/latest/" rel="nofollow noreferrer">https://python-chess.readthedocs.io/en/latest/</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-04-01T04:22:12.003Z
Answers.Text: Thanks. This is the first page I saw, but unfortunately it solves almost nothing.
Answers.UserDisplayName: Hick Nax
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-04-02T13:53:04.580Z
Answers.Text: why the reject? https://chess.stackexchange.com/review/suggested-edits/18841
Answers.UserDisplayName: BCLC
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-04-03T18:19:59.033Z
Answers.Text: @BCLC    "Any combination of chess and poker. In particular the most popular one currently is https://chokergame.com/" was the suggested edit.  Since this comment had nothing to do with the question, I rejected it.  If this wasn't you suggested edit, I suggest that you take the issue with the site, as it's been acting peculiar lately.
Answers.UserDisplayName: Mike Jones
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-04-06T00:47:32.157Z
Answers.Text: 'Since this comment had nothing to do with the question' --> what question?
Answers.UserDisplayName: BCLC
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-04-01T04:05:13.553Z
Answers.LastActivityDate: 2021-04-01T04:05:13.553Z
Answers.UserDisplayName: Mike Jones
Body: <p>I need help to generate structured data from the PGN file as discs into a list in Python, or similar.</p>
  <p>For example, say that I need to read this PGN file.</p>
  <p>#######################################################</p>
  <p>[Event &quot;Teste_0-1500 c&quot;]
  [Site &quot;HIGGS-PC&quot;]
  [Date &quot;2021.03.13&quot;]
  [Round &quot;1&quot;]
  [White &quot;Cfish1200-modern&quot;]
  [Black &quot;Cmcchess 2.27&quot;]
  [Result &quot;1-0&quot;]
  [ECO &quot;B33&quot;]
  [WhiteElo &quot;1415&quot;]
  [BlackElo &quot;1330&quot;]
  [Annotator &quot;Boson,Higgs&quot;]
  [PlyCount &quot;160&quot;]
  [EventDate &quot;2021.??.??&quot;]</p>
  <ol>
  <li>e4 ({Stockfish 13: (7453kN)} 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4.
  Nc3 c6 5. e3 Nbd7 6. Be2 Bd6 7. O-O O-O 8. Qc2 e5 9. cxd5 cxd5 10. dxe5 Nxe5</li>
  </ol>
  <p>#######################################################</p>
  <p>I want to generate a data structure from the first PGN game to generate a list of discs.</p>
  <p>[{'whiteplayer_name':'Cfish1200-modern', 'whiteplayer_Elo':1415, 'mainline_move_1_white':'e4', 'mainline_move_2_white':'Nf3', 'mainline_move_3_white':'d4',...,etc.}, {'Engine_1_name': 'Stockfish 13', 'move_white_suggested_by_engine_1_for_move_1':'d4', 'move_white_suggested_by_engine_1_for_move_2':'Nf3', 'move_white_suggested_by_engine_1_for_move_3':'Bb5', ... , etc., 'move_white_eval_by_engine_1_for_move_1':15, 'move_white_eval_by_engine_1_for_move_2':29, 'move_white_eval_by_engine_1_for_move_3':37}, {'Engine_2_name': 'Eman 6.94 64-bit SSE41 POPCNT', 'move_white_suggested_by_engine_2_for_move_1':'e4', 'move_white_suggested_by_engine_2_for_move_2':'Nf3', 'move_white_suggested_by_engine_2_for_move_3':'Bb5',...,etc., 'move_white_eval_by_engine_2_for_move_1':27, 'move_white_eval_by_engine_2_for_move_2':30, 'move_white_eval_by_engine_2_for_move_3':32,...,etc.}, etc.]</p>
  <p>The same foes for the Black player and other such games. In total, I have around 600 games, each game analyzed by ~100 engines.  Engines per game are not the same for all games and not the same number of engines per game.  I tried to use chess.pgn, but I am a noob and could only extract the header data and mainline moves.</p>
  
Tags: <database><pgn>
Title: Create a list of discs from PGN file with a lot of comments
ThreadText: # Create a list of discs from PGN file with a lot of comments
  
  (Asked by: username_0 on 2021-03-31)
  
  I need help to generate structured data from the PGN file as discs into a list in Python, or similar.
  
  For example, say that I need to read this PGN file.
  
  #######################################################
  
  [Event "Teste\_0-1500 c"]
  [Site "HIGGS-PC"]
  [Date "2021.03.13"]
  [Round "1"]
  [White "Cfish1200-modern"]
  [Black "Cmcchess 2.27"]
  [Result "1-0"]
  [ECO "B33"]
  [WhiteElo "1415"]
  [BlackElo "1330"]
  [Annotator "Boson,Higgs"]
  [PlyCount "160"]
  [EventDate "2021.??.??"]
  
  1. e4 ({Stockfish 13: (7453kN)} 1. d4 Nf6 2. c4 e6 3. Nf3 d5 4.
     Nc3 c6 5. e3 Nbd7 6. Be2 Bd6 7. O-O O-O 8. Qc2 e5 9. cxd5 cxd5 10. dxe5 Nxe5
  
  #######################################################
  
  I want to generate a data structure from the first PGN game to generate a list of discs.
  
  [{'whiteplayer\_name':'Cfish1200-modern', 'whiteplayer\_Elo':1415, 'mainline\_move\_1\_white':'e4', 'mainline\_move\_2\_white':'Nf3', 'mainline\_move\_3\_white':'d4',...,etc.}, {'Engine\_1\_name': 'Stockfish 13', 'move\_white\_suggested\_by\_engine\_1\_for\_move\_1':'d4', 'move\_white\_suggested\_by\_engine\_1\_for\_move\_2':'Nf3', 'move\_white\_suggested\_by\_engine\_1\_for\_move\_3':'Bb5', ... , etc., 'move\_white\_eval\_by\_engine\_1\_for\_move\_1':15, 'move\_white\_eval\_by\_engine\_1\_for\_move\_2':29, 'move\_white\_eval\_by\_engine\_1\_for\_move\_3':37}, {'Engine\_2\_name': 'Eman 6.94 64-bit SSE41 POPCNT', 'move\_white\_suggested\_by\_engine\_2\_for\_move\_1':'e4', 'move\_white\_suggested\_by\_engine\_2\_for\_move\_2':'Nf3', 'move\_white\_suggested\_by\_engine\_2\_for\_move\_3':'Bb5',...,etc., 'move\_white\_eval\_by\_engine\_2\_for\_move\_1':27, 'move\_white\_eval\_by\_engine\_2\_for\_move\_2':30, 'move\_white\_eval\_by\_engine\_2\_for\_move\_3':32,...,etc.}, etc.]
  
  The same foes for the Black player and other such games. In total, I have around 600 games, each game analyzed by ~100 engines. Engines per game are not the same for all games and not the same number of engines per game. I tried to use chess.pgn, but I am a noob and could only extract the header data and mainline moves.
  
  **Tags:** database, pgn
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-04-01. Score: 2
  
  Python has a pgn parser as part of its chess library.
  
  <https://python-chess.readthedocs.io/en/latest/>
  
  > **Comments:**
  > **username_0**: Thanks. This is the first page I saw, but unfortunately it solves almost nothing.  
  > **username_2**: why the reject? https://chess.stackexchange.com/review/suggested-edits/18841  
  > **username_1**: @username_2    "Any combination of chess and poker. In particular the most popular one currently is https://chokergame.com/" was the suggested edit.  Since this comment had nothing to do with the question, I rejected it.  If this wasn't you suggested edit, I suggest that you take the issue with the site, as it's been acting peculiar lately.  
  > **username_2**: 'Since this comment had nothing to do with the question' --> what question?  
  
  ---
  
  