PgnHelper

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

Ferdy
Posts: 4851
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

PgnHelper

Post by Ferdy »

Sorts games; add eco, opening and variations; and generate round-robin tables from pgn file.

https://github.com/fsmosca/pgnhelper

https://pypi.org/project/pgnhelper/

Sample Installation

Code: Select all

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\WINDOWS\system32> cd f:\
PS F:\> python -V
Python 3.9.1

PS F:\> pip install pgnhelper
Successfully installed pgnhelper-0.3.0

PS F:\> pgnhelper -v
0.3.0

PS F:\> pgnhelper -h
usage: pgnhelper [-h] [-v] {sort,addeco,roundrobin} ...

positional arguments:
  {sort,addeco,roundrobin}
    sort                Sort the games from the given pgn file based on the given game tags. e.g. pgnhelper sort
                        mygames.pgn --outpgnfn out.pgn --sort-tag opening --sort-direction hightolow
    addeco              Add eco and ecot codes, opening and variation names to the input pgn file. The eco, opening
                        etc. are from the given input file eco.pgn. e.g. pgnhelper addeco --inpgnfn mygames.pgn
                        --inecopgnfn eco.pgn --outpgnfn out.pgn
    roundrobin          Generate round-robin table results from the input pgn file. The output can be html, csv and
                        txt. e.g. pgnhelper roundrobin --inpgnfn candidates.pgn --output candidates.html

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  
PS F:\> pgnhelper roundrobin -h

usage: pgnhelper roundrobin [-h] --inpgnfn INPGNFN --output OUTPUT [--win-point WIN_POINT] [--draw-point DRAW_POINT]
                            [--table-color TABLE_COLOR]

optional arguments:
  -h, --help            show this help message and exit
  --inpgnfn INPGNFN     Write the input pgn filename, required.
  --output OUTPUT       Write the output filename, required, can be .html, .csv or .txt. e.g --output tata_steel.html
  --win-point WIN_POINT
                        The point when the players wins, default=1.0
  --draw-point DRAW_POINT
                        The point when the players draws, default=0.5
  --table-color TABLE_COLOR
                        Write table color not required. [default="blue_light" value=("yellow_light", "grey_light",
                        "orange_light", "green_light", "red_light", "yellow_dark", "grey_dark", "blue_dark",
                        "orange_dark", "green_dark", "red_dark")]
                        
PS F:\> pgnhelper roundrobin --inpgnfn "Palma1971.pgn" --output "Palma1971.html"
Image
Frank Quisinsky
Posts: 7214
Joined: Wed Nov 18, 2009 7:16 pm
Location: Gutweiler, Germany
Full name: Frank Quisinsky

Re: PgnHelper

Post by Frank Quisinsky »

Hi Ferdi,

oh, I lost time in unnecessary discussions!
Tomorrow with full power I have to looking.

For the moment, thank you again!

Best
Frank

PS: A good idea to open a new thread about your tool!!
Frank Quisinsky
Posts: 7214
Joined: Wed Nov 18, 2009 7:16 pm
Location: Gutweiler, Germany
Full name: Frank Quisinsky

Re: PgnHelper

Post by Frank Quisinsky »

Hi Ferdinand,

sorry for my late answer.
I have problems to install the new files after deinstallation from the first version I am looking.
Need time and more concentration for it.

Python is very interesting.
A "master-plan" for people like me is needed.
Sure I find a solution and all works fine!!

Later ...

Best
Frank