Answers.Body: <p>Would this be what you are looking for? <strong>PGN-extract</strong> (A command line utility)
  <a href="http://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/" rel="noreferrer">http://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/</a></p>
  
  <p>I can see a flag in the <a href="http://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/help.html" rel="noreferrer">feature doc</a> that might help:</p>
  
  <ul>
  <li><code>-W[cm|epd|halg|lalg|elalg|san|uci]</code> - specify the output format to use<br>
  <code>-Whalg</code> is hyphenated long algebraic.<br>
  <code>-Wlalg</code> is long algebraic<br>
  <code>-Welalg[PNBRQK]</code> is enhanced long algebraic. Use the characters PNBRQK for language</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-11-25T22:40:27.183Z
Answers.Text: The best option for the person who asked is probably `-Wuci` if they want to feed it to an UCI engine.
Answers.UserDisplayName: Vegard
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-09-28T12:27:06.320Z
Answers.LastActivityDate: 2016-11-26T07:09:37.290Z
Answers.LastEditDate: 2016-11-26T07:09:37.290Z
Answers.UserDisplayName: shivsky
Body: <p>I want to read a PGN file and then advance to a certain move number, and feed that to an UCI engine.  Turns out engines work using long algebraic notation, and PGNs are in short algebraic.  What is an easy way to make the conversion?  i.e. from SAN to LAN.</p>
  
  <p>I realize that generating long algebraic notation requires knowledge of the board state &amp; chess rules, so I don't want to write it all again!  Surely something like this must already exist - either a command line program or a module (preferably in python).</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2013-09-28T12:25:31.497Z
Comments.Text: This question appears to be off-topic because it is about programming, not about chess.
Comments.UserDisplayName: Tony Ennis
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2013-09-28T15:07:37.573Z
Comments.Text: AFAIK, the most explicit meta discussion there's been that's pertinent to whether this is on-topic is http://meta.chess.stackexchange.com/q/100/167. The consensus at that point seemed to be that something like this should be considered on-topic. (Note: I'm not arguing one way or the other, so don't take it up with me. But do feel free to contribute to that meta thread.)
Comments.UserDisplayName: ETD
Tags: <programming><pgn><python>
Title: How to convert PGN moves to long algebraic notation (in python)?
ThreadText: # How to convert PGN moves to long algebraic notation (in python)?
  
  (Asked by: username_0 on 2013-09-28)
  
  I want to read a PGN file and then advance to a certain move number, and feed that to an UCI engine. Turns out engines work using long algebraic notation, and PGNs are in short algebraic. What is an easy way to make the conversion? i.e. from SAN to LAN.
  
  I realize that generating long algebraic notation requires knowledge of the board state & chess rules, so I don't want to write it all again! Surely something like this must already exist - either a command line program or a module (preferably in python).
  
  **Tags:** programming, pgn, python
  
  > **Comments:**
  > **username_1**: This question appears to be off-topic because it is about programming, not about chess.  
  > **username_2**: AFAIK, the most explicit meta discussion there's been that's pertinent to whether this is on-topic is http://meta.chess.stackexchange.com/q/100/167. The consensus at that point seemed to be that something like this should be considered on-topic. (Note: I'm not arguing one way or the other, so don't take it up with me. But do feel free to contribute to that meta thread.)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2013-09-28. Score: 10 | Accepted answer
  
  Would this be what you are looking for? **PGN-extract** (A command line utility)
  <http://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/>
  
  I can see a flag in the [feature doc](http://www.cs.kent.ac.uk/people/staff/djb/pgn-extract/help.html) that might help:
  
  * `-W[cm|epd|halg|lalg|elalg|san|uci]` - specify the output format to use  
    `-Whalg` is hyphenated long algebraic.  
    `-Wlalg` is long algebraic  
    `-Welalg[PNBRQK]` is enhanced long algebraic. Use the characters PNBRQK for language
  
  > **Comments:**
  > **username_4**: The best option for the person who asked is probably `-Wuci` if they want to feed it to an UCI engine.  
  
  ---
  
  