Skip to main content

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.

The movetext_parser module provides classes which expect movetext but do not expect it to represent a game.

The tagpair_parser module provides classes which take just enough notice of movetext to correctly spot PGN Tag Pairs and Game Termination Markers.

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.

Release files for pgn-read 2.7.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pgn-read 2.7.3
File Size Uploaded
pgn_read-2.7.3.tar.gz 64.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pgn-read 2.7.3
File Interpreter ABI Platform
pgn_read-2.7.3-py3-none-any.whl Python 3 none any Details

Total release size: 144.4 kB

Release files / pgn_read-2.7.3.tar.gz

Download URL pgn_read-2.7.3.tar.gz
Size 64.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8e70ce96f6db3edfe36dde7211f0d5b405f8e30304e921aca7646c5aacc99635
BLAKE2b-256 checksum
How to use checksums
700d7e505e6761265173bf5cc4515115f248e7c485563ef433747f9050d9d73e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / pgn_read-2.7.3-py3-none-any.whl

Download URL pgn_read-2.7.3-py3-none-any.whl
Size 80.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
be4c665b1e4bc5449165c82efb864e1f11ab5a05a52b17662d8753f66a43f413
BLAKE2b-256 checksum
How to use checksums
77eb02dbd45d1200b0cc39d409ca4da52297fc493760a569924c927e206132ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release history Release notifications | RSS feed

This release

2.7.3 This release

2 release files

2.7

2 release files

2.6

2 release files

2.5

2 release files

2.4

2 release files

2.3.1

2 release files

2.3

2 release files

2.2

2 release files

2.1.4

2 release files

2.1.3

2 release files

2.1.1

1 release file

2.1

1 release file

2.0.2

1 release file

2.0.1

1 release file

2.0

1 release file

1.3.2

1 release file

1.3.1

1 release file

1.3

1 release file

1.2.4

1 release file

1.2.3

1 release file

1.2.2

1 release file

1.2.1

1 release file

1.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page