-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds downloading user games from Chess.com and cleans up downloading user games from Lichess.org #33
base: master
Are you sure you want to change the base?
Conversation
colorama==0.4.4 | ||
chess==1.5.0 | ||
requests==2.20.0 | ||
lichess>=0.1.9 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a problem installing this and had to change it to:
colorama==0.4.4 | |
chess==1.5.0 | |
requests==2.20.0 | |
lichess>=0.1.9 | |
colorama==0.4.4 | |
chess==1.5.0 | |
requests==2.27.1 | |
lichess>=0.1.9 |
This was the error
ERROR: Cannot install -r requirements.txt (line 4) and requests==2.20.0 because these package versions have conflicting dependencies.
The conflict is caused by:
The user requested requests==2.20.0
lichess 0.1.9 depends on requests==2.27.1
archive_dates[len(archive_dates) - 1] = archive_dates[ | ||
len(archive_dates) - 1].rstrip("\"]}") | ||
|
||
with open("games.pgn", "w") as new_file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we will need the max
param also for chess.com
One way to do it is use parse the json from https://api.chess.com/pub/player/hikaru/games/2017/04
to count the number of games. and get the pgn with .pgn
|
||
archives = http_response.read().decode("utf-8") | ||
archives = archives.replace("{\"archives\":[\"", "\",\"") | ||
archive_dates = archives.split("\",\"" + url_chessdotcom) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be better if the dates are sorted from recent to older. So you can always download the latest games by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vanderbilt-cs This pr is great I left some comments to make it better.. Thanks for the pr
The following changes have been implemented in this PR:
lichess
Python package.DS_Store
since it is unnecessary and already not included in.gitignore
README.md
on how to download user game data for Lichess or Chess.com and improved its readability