|
1 |
| -========================================== |
2 |
| -Go Tools: Smart Game Format Parser Library |
3 |
| -========================================== |
| 1 | +====================================================== |
| 2 | + sgflib: Smart Game Format Parser Library & Utilities |
| 3 | +====================================================== |
4 | 4 |
|
5 | 5 | Description
|
6 | 6 | ===========
|
7 | 7 |
|
8 | 8 | For Python programmers, sgflib.py is a module containing a parser and classes
|
9 |
| -for SGF, the Smart Game Format. Also included is the module typelib.py, which |
10 |
| -emulates Python built-in data types as classes. |
| 9 | +for SGF, the Smart Game Format, specifically for the game of Go. |
| 10 | + |
| 11 | +For Go players, several utilities are included: |
| 12 | + |
| 13 | +* sgfmerge: Merge two or more game record files into one. Works best |
| 14 | + when the game record files are for the same game, and contain |
| 15 | + variations. |
| 16 | + |
| 17 | +* sgfnorm: Normalize an SGF file. Usful for comparing two files |
| 18 | + representing the same game. |
| 19 | + |
| 20 | +* sgfsummary: Read, analyze, and summarize one or more SGF files. |
| 21 | + |
11 | 22 |
|
12 | 23 | Installation
|
13 | 24 | ============
|
14 | 25 |
|
15 |
| -Please note that sgflib.py and typelib.py are included as part of the |
16 |
| -sgfsummary.py download, so you need not download them separately. Although these |
17 |
| -modules are only useful to Python programmers, if you're not one, I encourage |
18 |
| -you to take a look. Python is a cool programming language. |
| 26 | +You'll need the Python language itself, version 3.8 or higher, freely |
| 27 | +available from http://www.python.org. |
19 | 28 |
|
20 |
| -You'll need the Python language itself, freely available from |
21 |
| -[[http://www.python.org]]. |
22 |
| - |
23 |
| -The sgflib.tgz (tarred, gzipped) archive contains the following: |
| 29 | +The sgflib.tgz archive contains the following: |
24 | 30 |
|
25 | 31 | - sgflib.py -- SGF Parser Library. Put this in a folder on Python's path.
|
26 | 32 |
|
27 |
| -- typelib.py -- Type Class Library. Put this in a folder on Python's path. |
| 33 | +- sgfsummary, sgfnorm, sgfmerge -- Utility tools. Put these on your PATH. |
28 | 34 |
|
29 | 35 | - README.txt -- Installation instructions (the file you're reading now).
|
30 | 36 |
|
31 |
| -- lgpl.txt -- The GNU Lesser General Public License; applies to sgflib.py. |
| 37 | +- test_sgflib.py & test_data/ -- Test suite. Requires pytest to run. |
| 38 | + |
| 39 | + |
| 40 | +Bugs & Other Issues |
| 41 | +=================== |
32 | 42 |
|
33 |
| -I have only tested this code on my system, MacOS 8.6, running Python 1.5.2. I |
34 |
| -did try to write it to be platform-independent. If you have any trouble running |
35 |
| -it, find (fix?) any bugs, or add any features, please contact me. |
| 43 | +If you have any trouble running this code, if you find (maybe fix?) |
| 44 | +any bugs, or add any features, please contact_ the author. |
36 | 45 |
|
37 |
| -MacOS users: please see the Macintosh Python Notes and the Macintosh SGF Notes |
38 |
| -at [[http://gotools.sourceforge.net]]. |
39 | 46 |
|
40 | 47 | To Do
|
41 | 48 | =====
|
42 | 49 |
|
43 |
| -There's nothing on my list for sgflib.py right now. |
| 50 | +* Reimplement the GameTree as a data structure that's convenient for |
| 51 | + the user of sgflib, rather than following the file format. |
| 52 | + |
| 53 | +* Reimplement the Cursor class? Or remove it altogether if unnecessary. |
| 54 | + |
| 55 | +* Reimplement the parser? |
44 | 56 |
|
45 |
| -typelib.py: |
| 57 | + * Simplify. It works, but it seems clunky. Written early in my |
| 58 | + Python career. |
46 | 59 |
|
47 |
| -- Implement 'Function'? 'File'? (Have to come up with a good reason first ;-) |
| 60 | + * Reimplement as a generator? |
| 61 | + |
| 62 | + * Support earlier versions of SGF? |
| 63 | + |
| 64 | +* Titler: Populate the title (GN/game_name property) inside the SGF |
| 65 | + file itself, e.g.: |
| 66 | + |
| 67 | + player1 (2 dan, white) vs player2 (4 kyu, black +h5); W+18½; KGS; 2020-12-04 |
| 68 | + |
| 69 | +* Renamer: Rename SGF files, e.g.: |
| 70 | + |
| 71 | + 2020-12-04 player1 · player2 +h5 W+18.sgf |
| 72 | + |
| 73 | +* Query SGF data: Extract game & node properties & comments from .sgf |
| 74 | + files. Queries could be Python expressions for maximum flexibility. |
| 75 | + |
| 76 | +* Handicap convertor? Lizzie (Leela Zero?) can't handle handicap |
| 77 | + stones, so this program would convert the HA[n] & AB[xx] tags to |
| 78 | + B[xx] moves & W[] passes. Katago via KaTrain doesn't have this |
| 79 | + problem though. |
| 80 | + |
| 81 | +* Auto-label variations. |
| 82 | + |
| 83 | +Have any suggestions? Want to help? Please contact_ the author. |
48 | 84 |
|
49 |
| -Have any suggestions? Want to help? Let me know! |
50 | 85 |
|
51 | 86 | Contact
|
52 | 87 | =======
|
53 | 88 |
|
54 |
| -Project administrator: David Goodger [[mailto: [email protected]]] |
55 |
| -Go Tools Project website: [[http://gotools.sourceforge.net]] |
| 89 | +Project author: `David Goodger <mailto: [email protected]>`_. |
| 90 | + |
| 91 | +Go Tools Project website: http://gotools.sourceforge.net. |
0 commit comments