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
This package is available on PyPI so can be installed by typing
python -m pip install –user pgn-read
at the command prompt.
See Python and pip documentation for alternatives and platform-specific points.
Tests
Tests are available at the repository in the pgn_read.core.tests sub-package.
Copy the tests directory and run tests by typing, for example,
python -m pgn_read.core.tests.test_squares
at the command prompt with setup.py in the current directory.
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.
The pgn_read.core.tests sub-package was removed from the distribution created by setup when the repository was created.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pgn-read-2.3.1.tar.gz
.
File metadata
- Download URL: pgn-read-2.3.1.tar.gz
- Upload date:
- Size: 50.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c1890a83f976917269193463f1aecd0f3af2dc2958c3f18aef28bad0aad987f |
|
MD5 | c2ef90b57487ad9cd9033d0686a3a069 |
|
BLAKE2b-256 | 9d584373b43438912fef8d328128e6fa62adffdb6ddfa2b3137a74fdcb12e99b |
File details
Details for the file pgn_read-2.3.1-py3-none-any.whl
.
File metadata
- Download URL: pgn_read-2.3.1-py3-none-any.whl
- Upload date:
- Size: 53.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3d7ae44f68d714c9f8a1594daed5a0fe361c60575d6fd59a01943011d46da04 |
|
MD5 | fdf4e7a039be47b3d397c1f06179e0b3 |
|
BLAKE2b-256 | 9c6bd4b8cb151251d4d8a486a67a4b16784fb63da54532f15458ba023817f2d8 |