Skip to main content

A library for parsing PGN chess notations

Project description

PgnParse

supported python versions current PyPI version CI

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.2.0.tar.gz (27.2 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.2.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pgnparse-0.2.0.tar.gz
  • Upload date:
  • Size: 27.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for pgnparse-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0df2fd45c1af6b7ccfb3c2f2f16ccae28df3659aa25bc65af318044c3db6d252
MD5 2413d1c73174e8fb0a73627b31568aae
BLAKE2b-256 714d9173a0834e412841aae815ca5b21c0d824b3e57c08f8d385665938ea58e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgnparse-0.2.0.tar.gz:

Publisher: publish.yml on ItsDrike/pgnparse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: pgnparse-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for pgnparse-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c92692ff448a79878500502a52c4f8de2cbb97a176ac6c099c29f34615b7af58
MD5 7d392986579649a94f8f96022628757d
BLAKE2b-256 a24a0ca00a18aad448cae483d9e863a653d735962e5b23e959e670dcbb8ea28b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgnparse-0.2.0-py3-none-any.whl:

Publisher: publish.yml on ItsDrike/pgnparse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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