#algebraic #chess #notation #standard #san #data-structures

san-rs

A library for parsing standard algebraic notation (SAN)

4 releases (2 breaking)

0.3.1 Feb 6, 2021
0.3.0 Jul 12, 2019
0.2.0 Jul 9, 2019
0.1.0 Jul 8, 2019

#1630 in Game dev

GPL-3.0-only

22KB
573 lines

libsan-rs

Rust implementation for parsing standard algebraic notation in chess inspired by standard-algebraic-notation.

Usage

Add this to your Cargo.toml:

[dependencies]
san-rs = "0"

Short example usage:

use san_rs::*;

fn main() {
    // parse input string:
    let move_data = Move::parse("Re4").unwrap(); // -> data struct

    // convert back to string:
    let san_string = move_data.compile(); // -> "Re4"
}

lib.rs:

Module for parsing standard algebraic notation in chess. Supports parsing SAN strings into usable data structures, as well as converting the data structures back to string.

Dependencies

~2.2–3MB
~54K SLoC