Skip to main content

Portable Game Notation (PGN) parser

Project description

Description

This package provides a parser for chess game scores in PGN format.

Both the strict export format and many less strict import formats are supported.

Chess variants are not supported.

The game module provides the Game, GameStrictPGN, GameTextPGN, and GameIgnoreCasePGN, classes and the generate_fen_for_position function.

The parser module provides the PGN class and add_token_to_game function.

The PGN.read_games method yields instances of the Game class, or a subclass, generated from a file-like source or string.

The add_token_to_game function searches for the next PGN token in a string and applies it to an instance of the Game class, or a subclass.

The generate_fen_for_position function returns the Forsyth English Notation (FEN) string for the representation of a position in the Game class, or a subclass.

Installation Instructions

Usually this package will be installed by installing ChessTab.

Install the package by typing

python setup.py install

at the command prompt with setup.py in the current directory.

You may need to give the path and version of Python depending on your system’s configuration:

<path to python>/python<version> setup.py install

For example

C:\Python33\python setup.py install

on Microsoft Windows or

python3.3 setup.py install

on Unix-like systems.

Use Python 3.3 or later.

Notes

Project name and package name changed from ‘pgn’ to ‘pgn-read’ prior to upload to PyPI.

The version numbers of pgn-read continue on from pgn.

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

pgn-read-2.0.tar.gz (73.7 kB view details)

Uploaded Source

File details

Details for the file pgn-read-2.0.tar.gz.

File metadata

  • Download URL: pgn-read-2.0.tar.gz
  • Upload date:
  • Size: 73.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.7

File hashes

Hashes for pgn-read-2.0.tar.gz
Algorithm Hash digest
SHA256 a047e717e2e9c909d8621aab06ff8353936fd757a0db803c3de771c0a84c7542
MD5 6c8a15f32aa0faca9ddfccb11fe627c8
BLAKE2b-256 3fca7be458ea8356b47e9470f77fcfcaa2eb5fa6210cc0d60deef4bbe5017b64

See more details on using hashes here.

Supported by

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