Library to process 2 players' games recordings (only chess now)
Project description
**gamerec** is Python package intended to help process game recordings for 2 payers' games.
File with game records can be loaded to Python collection object, be manipulated by user Python code,
and then be saved back to file. Current very limited version of package only supports Chess game
and only .pgn file meta-data.
Below is an example of package use to save games from .pgn file to SQLite database:
```python
from gamerec.storage.pgnfile.chess import ChessGameCollection as PGNChessGC
from gamerec.storage.sqlite.chess import ChessGameCollection as SQLiteChessGC
PGNFile = sys.argv[1]
SQLFile = sys.argv[2]
pgngc = PGNChessGC()
pgngc.load(PGNFile)
sqlgc = SQLiteChessGC()
sqlgc.data = pgngc.data
sqlgc.coding = "utf_8"
sqlgc.save(SQLFile)
```
Consider installing [normalizePGN](https://pypi.python.org/pypi/normalizePGN) which is an example of
how this package may be used.
For more information see files README.md and Changelog.md included in source-ball or
in typical installation using pip deployed to folders:
- /usr/local/share/doc/gamerec (Linux)
- C:\Python35\doc\gamerec (Windows) or
- <USER>\AppData\Local\Programs\Python\Python35-32\Doc\gamerec
File with game records can be loaded to Python collection object, be manipulated by user Python code,
and then be saved back to file. Current very limited version of package only supports Chess game
and only .pgn file meta-data.
Below is an example of package use to save games from .pgn file to SQLite database:
```python
from gamerec.storage.pgnfile.chess import ChessGameCollection as PGNChessGC
from gamerec.storage.sqlite.chess import ChessGameCollection as SQLiteChessGC
PGNFile = sys.argv[1]
SQLFile = sys.argv[2]
pgngc = PGNChessGC()
pgngc.load(PGNFile)
sqlgc = SQLiteChessGC()
sqlgc.data = pgngc.data
sqlgc.coding = "utf_8"
sqlgc.save(SQLFile)
```
Consider installing [normalizePGN](https://pypi.python.org/pypi/normalizePGN) which is an example of
how this package may be used.
For more information see files README.md and Changelog.md included in source-ball or
in typical installation using pip deployed to folders:
- /usr/local/share/doc/gamerec (Linux)
- C:\Python35\doc\gamerec (Windows) or
- <USER>\AppData\Local\Programs\Python\Python35-32\Doc\gamerec
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gamerec-0.1.0.tar.gz
(11.5 kB
view details)
File details
Details for the file gamerec-0.1.0.tar.gz
.
File metadata
- Download URL: gamerec-0.1.0.tar.gz
- Upload date:
- Size: 11.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf6a11a071439face6e6bd2a622280d9f574e953ff1e3e40a8c844162e7076fa |
|
MD5 | 2f6e2e228deb4a06b1faea4d6bf7a71a |
|
BLAKE2b-256 | cf2d955655c132681eaac67c05bb8606fc1863632c54a62d170616b2faf452df |