Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sanderland/pysgf
Small and simple SGF parser for python
https://github.com/sanderland/pysgf
baduk go sgf weiqi
Last synced: 15 days ago
JSON representation
Small and simple SGF parser for python
- Host: GitHub
- URL: https://github.com/sanderland/pysgf
- Owner: sanderland
- License: mit
- Created: 2020-04-12T20:27:07.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-06-01T10:11:31.000Z (5 months ago)
- Last Synced: 2024-10-03T11:34:56.738Z (about 1 month ago)
- Topics: baduk, go, sgf, weiqi
- Language: Python
- Size: 86.9 KB
- Stars: 7
- Watchers: 1
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PySGF
[![Release Status](https://github.com/sanderland/pysgf/workflows/release/badge.svg)](https://github.com/sanderland/pysgf/actions)
[![PyPI version](https://badge.fury.io/py/pysgf.svg)](https://pypi.org/project/pysgf/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)PySGF is a lightweight but powerful parser for the Go SGF Format.
## Quickstart
```python
from pysgf import SGF
# parse either a string ..
root = SGF.parse(input_sgf)
# or pass a file name. It will try to detect the encoding specified in the SGF file
root = SGF.parse_file(input_file_name)
# all properties are stored as lists, but you can ask for the first
root.get_list_property('AB')
root.get_property('KM')
move = root.move # returns a Move object with options for SGF, GTP or 0- based coordinates
children = root.children # returns all child nodes
```## Documentation
For documentation, run `make html` in the `docs` directory.