Making chess analytics easy.
Project description
Chess-Analytica: chess analytics made easy
================================================================================
Introduction
Chess-Analytica is a chess library that allows for the simple scraping of data using the chess.com API, and subsequent
analysis of that data. Built on top of the python-chess library, Chess-Analytica allows for you to easily scrape
all of a given player's past (or current) games, filter the games down, and then analyze them.
.. code:: python
from chess_analytica import Board, ChessDotCom
profile = ChessDotCom.Profile("aronfrish", False)
profile.filterGameType("rapid")
print(len(profile.games)) #720
n = 0
for game in profile.games : #Note: this is still filtered to rapid
if ("resignation" in game.termination) :
n += 1
print(n) #Note: this will print the number of the player's rapid games that ended in resignation
#334
italian_games = profile.find_games_with_FEN_and_Color("r1bqkbnr/pppp1ppp/2n5/4p3/2B1P3/5N2/PPPP1PPP/RNBQK2R", True) #Note: this FEN is the italian game and the target player color is white (because is_white is set to True)
print(len(italian_games)/len(profile.white_games)) #Note: this will print the percentage of rapid games (where the player is white) that the player has played the italian game
#0.013888888888888888
Installing
Download and install the latest release:
::
pip install chess-analytica
Documentation <https://chess-analytica.readthedocs.io/en/latest/>
__
-
Examples <https://chess-analytica.readthedocs.io/en/latest/usage.html>
_ -
ChessDotCom Class <https://chess-analytica.readthedocs.io/en/latest/chessdotcom.html>
_ -
Board Class <https://chess-analytica.readthedocs.io/en/latest/board.html>
_
Features
-
Scrape all game info from a given player's profile
-
Simulate games and analyze them
-
Filter games by time control
License
Chess-Analytica is licensed under the MIT License.
Check out LICENSE.txt
for the full text.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for chess_analytica-1.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3c27cf5e08b1a5db185782f07d3150776b9950cb2fe5471d52aaafa9298b11e |
|
MD5 | a47b1ce99e6a761a1459c9d28d67cca7 |
|
BLAKE2b-256 | 715a4cbb1901b87abf1fae30e6d6664d7f9c20c2ed8f173290280b10a39e5a8a |