#chess #pgn #parser

rpgn

A crate for parsing PGNs (Portable [Chess] Game Notation)

14 releases (4 breaking)

new 0.8.1 Mar 22, 2025
0.7.1 Mar 7, 2025
0.3.4 Nov 27, 2024
0.2.4 May 23, 2024

#1375 in Parser implementations

Download history 9/week @ 2024-12-03 18/week @ 2024-12-10 372/week @ 2025-02-11 492/week @ 2025-02-18 432/week @ 2025-02-25 157/week @ 2025-03-04 134/week @ 2025-03-11 104/week @ 2025-03-18

840 downloads per month

GPL-3.0 license

67KB
1.5K SLoC

build coverage docs.rs crates.io license

RPGN

Rust Portable Game Notation.

A crate for parsing a PGN, built on shakmaty and pgn-reader.

pgn-reader only allows you to read individual, untyped parts of the PGN, but doesn't actually parse it into something useful. This crate parses a PGN into the Pgn struct. See the docs for more.

Features

  • time enables converting a RPGN date to a time::Date using TryFrom.
  • serde enables Serialize and Deserialize for most types. Types that implement both Display and FromStr (or Into<char> and TryFrom<char> in the case of EcoCategory) use those implementations for Serialize/Deserialize. Other types use the automatic, derived version.

Dependencies

~1.4–2.3MB
~43K SLoC