This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Converts the millionbase chess PGN database (http://www.top-5000.nl/pgn.htm) to json | |
# with one json dictionary per row. (That is, the resulting file is contain multiple json objects, | |
# not just one large). | |
import json | |
import chess.pgn # From python-chess https://github.com/niklasf/python-chess | |
pgn = open("millionbase-2.22.pgn") # Or where you have put it | |
fout = open('milionbase-2.22.json', 'w') # Or where you want it |