vonglasow / chess.com

Python script to use chess.com API and retrieve data like all games or stats

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

chess.py

python3 chess.py -h
usage: chess.py [-h] [-u USERNAME] [-t TOURNAMENT] [-a] [-s]

optional arguments:
  -h, --help            show this help message and exit
  -u USERNAME, --username USERNAME
                        chess.com username
  -t TOURNAMENT, --tournament TOURNAMENT
                        tournament ID (ex: poulet-1484723)
  -a, --archives        game archives
  -s, --stats           user stats

Usage

Get all games and create a pgn file

python3 chess.py -a -u username > mypgnfile.pgn
python3 chess.py -s -u username > mystatfile.json
python3 chess.py -t poulet-1484723
[{'username': 'g0g0lem', 'points': 33, 'place_finish': 1}, {'username': 'frigoriste69', 'points': 31, 'place_finish': 2}, {'username': 'flomefi', 'points': 26, 'place_finish': 3}]

About

Python script to use chess.com API and retrieve data like all games or stats


Languages

Language:Python 100.0%