Helper scripts to fix PGN meta-data before importing them to Chess DB.
Works only with Python 3.
Tested only on Linux.
For package description see DESCR.md file.
This program requires following 3-rd party packages: gamerec.
It must be installed in order to run pgn2db and db2pgn programs.
gamerec can be installed from Python Package Index:
Linux: sudo pip install gamerec
Windows: pip install gamerec
Recommended method for installation of this package is from Python Package Index:
Linux: sudo pip3 install normalizePGN
Windows: pip3 install normalizePGN
If you want to install particular version, download source-ball and issue:
Linux: sudo pip3 install normalizePGN-<ver>.tar.gz
Windows: pip3 install normalizePGN-<ver>.tar.gz
Alternatively unpack source-ball and from unpacked folder run command:
Linux: sudo python3 setup.py install
Windows: python setup.py install
Note: More installation options are possible - see documentation of Python distutils
package.
If you have downloaded archive snapshot, first unpack it and from root folder run command:
python3 setup.py sdist
which will create dist
subfolder and create source-ball in it. Then apply method 2 or 3 above.
- Command line utilities:
Linux:<BINDATA>/pgn2db
and<BINDATA>/db2pgn
, where<BINDATA>
is by default/usr/local/bin
Windows:<BINDATA>\Scripts\pgn2db.py
anddb2pgn.py
, where<BINDATA>
is by defaultC:\Python35
or<USER>\AppData\Local\Programs\Python\Python35-32
- Documentation:
Linux:<PREFIX>/share/doc/normalizePGN/*
, where<PREFIX>
is by default/usr/local
Windows:<PREFIX>\Doc\normalizePGN\*
, where<PREFIX>
is by defaultC:\Python35
or<USER>\AppData\Local\Programs\Python\Python35-32
- Example .pgn files fix scripts:
examples
subfolder of above mentioned documentation folder.
To upgrade packages from PyPi use -U option:
[sudo] pip install -U gamerec normalizePGN
.
Installed command line utilities can be used to convert games written in .pgn file to databse (SQLite) file back and forth. Syntax:
pgn2db [-o] <PGNFile> <SQLiteFile>
-o means that <SQLiteFile> will be cleared before adding games
db2pgn [-o] [-s <fields>] <SQLiteFile> <PGNFile>
-o means that <PGNFile> will be overwritten, otherwise games will be appended
-s means that games will be sorted, where <fields> is comma separated list of expressions (as in ORDER BY) to sort by
See also installed example files for instruction how to use this package.