#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

#1636 in Parser implementations

Download history 591/week @ 2025-02-12 283/week @ 2025-02-19 457/week @ 2025-02-26 185/week @ 2025-03-05 73/week @ 2025-03-12 112/week @ 2025-03-19 8/week @ 2025-03-26 3/week @ 2025-04-02

259 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