#chess #pgn #parser

rpgn

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

14 releases (4 breaking)

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

#1688 in Parser implementations

Download history 715/week @ 2025-02-13 214/week @ 2025-02-20 407/week @ 2025-02-27 212/week @ 2025-03-06 41/week @ 2025-03-13 113/week @ 2025-03-20 8/week @ 2025-03-27 2/week @ 2025-04-03

123 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
~42K SLoC