Skip to content

Instantly share code, notes, and snippets.

View daroza's full-sized avatar

Ed Daroza daroza

  • Starbucks
  • Seattle, WA
View GitHub Profile
@daroza
daroza / millionbase_to_json.py
Created November 4, 2016 04:03 — forked from rasmusab/millionbase_to_json.py
Converts the millionbase chess PGN database (http://www.top-5000.nl/pgn.htm) to json
# 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
import urllib.parse
import urllib.request
import re
import json
import numpy as np
import matplotlib.pyplot as plt
from collections import Counter
page = "List_of_chess_grandmasters"
@datagrok
datagrok / gist:2199506
Last active December 16, 2024 16:14
Virtualenv's `bin/activate` is Doing It Wrong