Answers.Body: <p>Java:  <a href="https://github.com/bhlangonijr/chesslib/tree/master/src/main/java/com/github/bhlangonijr/chesslib" rel="nofollow noreferrer">https://github.com/bhlangonijr/chesslib/tree/master/src/main/java/com/github/bhlangonijr/chesslib</a></p>
  
  <p>C++:  <a href="https://github.com/alexmdc/chesslib" rel="nofollow noreferrer">https://github.com/alexmdc/chesslib</a></p>
  
  <p>Python:  <a href="https://pypi.org/project/python-chess/" rel="nofollow noreferrer">https://pypi.org/project/python-chess/</a></p>
  
  <p>C:  <a href="https://sourceforge.net/projects/sankit/" rel="nofollow noreferrer">https://sourceforge.net/projects/sankit/</a></p>
  
  <p>These are all able to return long algebraic notation.  Stockfish is reported to also.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-20T03:27:13.573Z
Answers.LastActivityDate: 2018-07-20T03:27:13.573Z
Answers.UserDisplayName: Mike Jones
Answers.Body: <blockquote>
    <p><a href="https://github.com/niklasf/python-chess" rel="nofollow noreferrer">https://github.com/niklasf/python-chess</a></p>
  </blockquote>
  
  <pre><code>Parses and creates SAN representation of moves.
  
  &gt;&gt;&gt; board = chess.Board()
  &gt;&gt;&gt; board.san(chess.Move(chess.E2, chess.E4))
  'e4'
  &gt;&gt;&gt; board.parse_san('Nf3')
  Move.from_uci('g1f3')
  &gt;&gt;&gt; board.variation_san([chess.Move.from_uci(m) for m in ["e2e4", "e7e5", "g1f3"]])
  '1. e4 e5 2. Nf3'
  </code></pre>
  
  <p>Do you see "g1f3" translates to <code>Nf3</code>?</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-19T14:31:11.377Z
Answers.Text: thanks, I'll take a look and see if I can adapt it to my needs
Answers.UserDisplayName: Cincinnatus
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-19T12:11:09.637Z
Answers.LastActivityDate: 2018-07-19T12:11:09.637Z
Answers.UserDisplayName: SmallChess
Body: <p>I am building a chess board where I have one LED for each column and row, so I can represent moves by iluminating the orogin coordinate (e2) and the destination coordinate (e4)</p>
  
  <p>However chess algebraic notation is simplified and the origin and destination coordinates need additional info to be calculated (like the board and the rules for each piece)</p>
  
  <p>I am looking for some library or function that does this convertion (any language is fine).</p>
  
  <p>Basically I need this function to translate my board coordinates to a chess engine notation and viceversa.</p>
  
Tags: <computer-chess><notation>
Title: Algebraic to coordinate notation converter
ThreadText: # Algebraic to coordinate notation converter
  
  (Asked by: username_0 on 2018-07-19)
  
  I am building a chess board where I have one LED for each column and row, so I can represent moves by iluminating the orogin coordinate (e2) and the destination coordinate (e4)
  
  However chess algebraic notation is simplified and the origin and destination coordinates need additional info to be calculated (like the board and the rules for each piece)
  
  I am looking for some library or function that does this convertion (any language is fine).
  
  Basically I need this function to translate my board coordinates to a chess engine notation and viceversa.
  
  **Tags:** computer-chess, notation
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-07-20. Score: 4 | Accepted answer
  
  Java: <https://github.com/bhlangonijr/chesslib/tree/master/src/main/java/com/github/bhlangonijr/chesslib>
  
  C++: <https://github.com/alexmdc/chesslib>
  
  Python: <https://pypi.org/project/python-chess/>
  
  C: <https://sourceforge.net/projects/sankit/>
  
  These are all able to return long algebraic notation. Stockfish is reported to also.
  
  
  ---
  
  ### Answer by username_2 on 2018-07-19. Score: 3
  
  > <https://github.com/niklasf/python-chess>
  
  ```
  Parses and creates SAN representation of moves.
  
  >>> board = chess.Board()
  >>> board.san(chess.Move(chess.E2, chess.E4))
  'e4'
  >>> board.parse_san('Nf3')
  Move.from_uci('g1f3')
  >>> board.variation_san([chess.Move.from_uci(m) for m in ["e2e4", "e7e5", "g1f3"]])
  '1. e4 e5 2. Nf3'
  
  ```
  
  Do you see "g1f3" translates to `Nf3`?
  
  > **Comments:**
  > **username_0**: thanks, I'll take a look and see if I can adapt it to my needs  
  
  ---
  
  