Skip to content

RogerMarsh/pgn-read

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

===================================
Portable Game Notation (PGN) parser
===================================

.. contents::


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.


.. _Python: https://python.org
.. _pip: https://packaging.python.org/installing
.. _PGN: https://www.chessclub.com/help/PGN-spec
.. _repository: https://github.com/RogerMarsh/pgn-read

About

Portable Game Notation (PGN) parser

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages