Skip to main content

Making chess analytics easy.

Project description

Chess-Analytica: chess analytics made easy

.. image:: https://img.shields.io/pypi/v/chess-analytica :target: https://pypi.org/project/chess-analytica/ :alt: PyPI

.. image:: https://static.pepy.tech/badge/chess-analytica :target: https://pepy.tech/project/chess-analytica :alt: Downloads

.. image:: https://readthedocs.org/projects/chess-analytica/badge/?version=latest :target: https://chess-analytica.readthedocs.io/en/latest/ :alt: Docs

.. image:: https://img.shields.io/pypi/l/chess-analytica :target: https://pypi.org/project/chess-analytica/ :alt: License

.. image:: https://img.shields.io/pypi/status/chess-analytica :target: https://pypi.org/project/chess-analytica/ :alt: Status

.. image:: https://github.com/AronFrish/Chess-Analytica/actions/workflows/test.yml/badge.svg :target: https://github.com/AronFrish/Chess-Analytica/actions/workflows/test.yml :alt: Tests

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:

.. code:: python

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chess-analytica-1.1.9.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chess_analytica-1.1.9-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file chess-analytica-1.1.9.tar.gz.

File metadata

  • Download URL: chess-analytica-1.1.9.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for chess-analytica-1.1.9.tar.gz
Algorithm Hash digest
SHA256 18fb93261ad6286674a49be802a0e61c1a7509a8307d26737b82ed3e09106a25
MD5 22eb05b3afefbdd31782845d8f407419
BLAKE2b-256 3a895dca9f13badd2b74b91d9ea467a51b5340c5730b4521cacf29fa79924659

See more details on using hashes here.

File details

Details for the file chess_analytica-1.1.9-py3-none-any.whl.

File metadata

File hashes

Hashes for chess_analytica-1.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 032c08eba20626d4cf24fee09e391598e1fbb238a12f2e0db1b5d9a8e7b38f53
MD5 9ecfee98cd44f4f1dfaadf88241b248f
BLAKE2b-256 dad7292a1e73f489796790cb9d6d91c2077d5d22dcea4f1bb90a5fff472f587f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page