It sorts games by tags and add eco, opening and variation.
Project description
pgnhelper
An application to process pgn file.
Installation
pip install pgnhelper
Features
- Sort games by eco tag from script.
"""
sample.py
pip install pgnhelper
"""
from pgnhelper import pgnhelper
a = pgnhelper.PgnHelper(
'sort',
inpgnfn='mygames.pgn',
outpgnfn='out.pgn',
sort_tag='eco',
sort_direction='hightolow')
a.start()
- Sort games from command line.
python -m pgnhelper.pgnhelper sort --inpgnfn "c:/chess/mygames.pgn" --outpgnfn "out.pgn" --sort-tag eco --sort-direction hightolow
- Add ECO, ECOT, Opening, OpeningT, Variation and VariationT to the game. The T in ECOT, OpeningT and VariationT refers to Transposition. ECO code will be based on the first 4 plies of the game while ECOT will be the ECO after 4 plies of the game with a maximum of 24 plies.
python -m pgnhelper.pgnhelper addeco --inpgnfn mygames.pgn --inecopgnfn eco.pgn --outpgnfn eco_mygames.pgn
Example output where the game started as English and has transposed into QGD.
[Event "FEOBOS, Rank 00003"]
[Site "Trier"]
[Date "2017.01.29"]
[Round "20"]
[White "FEOBOS"]
[Black "FEOBOS"]
[Result "1/2-1/2"]
[BlackElo "3000"]
[ECO "A17"]
[ECOT "D41"]
[Opening "English"]
[OpeningT "QGD"]
[PlyCount "20"]
[Source "Frank Quisinsky"]
[VariationT "Semi-Tarrasch with e3"]
[WhiteElo "3000"]
1. c4 Nf6 2. Nc3 e6 3. Nf3 d5 4. d4 c5 5. cxd5 Nxd5 6. e3 Be7 7. Bc4 cxd4 8. exd4 Nc6 9. O-O O-O 10. Re1 Qd6 1/2-1/2
Help
python -m pgnhelper.pgnhelper --help
python -m pgnhelper.pgnhelper sort --help
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
pgnhelper-0.1.0.tar.gz
(17.0 kB
view hashes)
Built Distribution
pgnhelper-0.1.0-py3-none-any.whl
(16.9 kB
view hashes)
Close
Hashes for pgnhelper-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8a7ad8ff57eb2f2cba1257a0856dad0a7f91165340c8ea709c7ad6c33ee9cda |
|
MD5 | 06cf992b6add434314fae168fffb6632 |
|
BLAKE2b-256 | f5a694948347a9c8d03baa3eb43c726269f2b2fe6cdc3d3340c16b6832139ebf |