Tool to explore multiple games

Sort:
LewesMint

Hi

I've written a Python script to export my (or anyone's) games as a big *.pgn file.

Is there a decent tool, that doesn't involve spending too much money, in which I can explore the games for opening lines in a similar way to lichess's opening explorer? 

import json
import requests
import re

WANT_CLOCKS = False


def main():
root_dir = '<root_path>'
username = '<chess.com_username>'
re_subst = '' if WANT_CLOCKS else '{\[%clk.*?\]}'
archive_url = f'https://api.chess.com/pub/player/{username}/games/archives'

with open(f'{root_dir}Complete_{username}.pgn', 'w') as text_file:
print(re.sub(re_subst, '', '\n'.join(
[item['pgn'] for sublist in
[json.loads(requests.get(url).text)['games']
for url in json.loads(requests.get(archive_url).
text)['archives']]
for item in sublist]
), flags=re.DOTALL), file=text_file)


if __name__ == '__main__':
main()

Thanks.

LewesMint

I've just realised that the facility I'm after is actually already in chess.com. You have to go to the lessons menu, then select explorer and switch from 'Master Games' to 'My Games'.