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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pgnparse-0.4.0.tar.gz
Algorithm Hash digest
SHA256 5022ac911948f05689ea171d98638a401b525fc94b3823f560f0440d7546a5d0
MD5 77343b2dd06ad2bb1f84201cab0c3c3d
BLAKE2b-256 380cf8aadfebf55c12301f6561d57d1c989d371b75b164543121ba6230ae2562

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgnparse-0.4.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.4.0-py3-none-any.whl.

File metadata

  • Download URL: pgnparse-0.4.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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 65363eb65fa6b153e753993c10e45a640af14a75ca1bc81b99f44ae3697f4b62
MD5 396202039108e306139c208444dac395
BLAKE2b-256 669c96809798499ef59594286250be23416dc78e5091d843ce12a55ff90cd9e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pgnparse-0.4.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