Skip to main content

A library for parsing PGN chess notations

Project description

PyPGN

This is a simple library capable of parsing chess PGNs, following the standard definition. It includes classes that form an Abstract Syntax Tree, fully representing the parsed PGN with code. These classes also include __str__ implementations that allow seamless conversion back to regular (normalized) PGN strings.

A unique feature of this library is the flatten function for a list of moves. This function allows for the flattening of a list of moves, recursively stripping away all of the variations in a chess game and returning full standalone lists for each variation.

The parsing is handled using the Lark library, which is therefore a dependecy of this library. Lark allows specifying a formal EBNF-like grammar definition, which it then uses to tokenize the given input. This token tree is then used to produce the AST.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pgnparse-0.1.0.tar.gz (17.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pgnparse-0.1.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file pgnparse-0.1.0.tar.gz.

File metadata

  • Download URL: pgnparse-0.1.0.tar.gz
  • Upload date:
  • Size: 17.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.15

File hashes

Hashes for pgnparse-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7121e3c4b22c8b3c882acfe922a9c5bc6c25a5470a625b71ddb471fe091d4ef4
MD5 96c1581c2b1d13ba7c04b36606b9c97d
BLAKE2b-256 1da36c5c40150e3bfbd06a1c520d6020bcd2ce95dc95b73f99dc59d9eaddfd25

See more details on using hashes here.

File details

Details for the file pgnparse-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pgnparse-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.15

File hashes

Hashes for pgnparse-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3a0ec0929ac2e5e9600a3303af0828d273694edb19529d6ddae3b155ef45e1bb
MD5 b923c1f78ed42678a66d98cb2691fca2
BLAKE2b-256 8f0f87897ace88fdce5f3d4c2f4585318d0e4c1b5e2447fda95443b3e3b9e5fb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page