How to convert PGN moves to long algebraic notation (in python)? 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 &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).
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 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