Package: chess-insight
chess_insightModern application for gathering chess data and analyzing chess games.Features:Download games fromlichess.organdchess.comAnalyze games using set of custom methods andstockfish-16engine.Parses games toGameobject which contains all information about game and players to python object andjson.Provides method for exporting list of analyzed games tocsvinteractive modeinstallationpipinstallchess_insight# download application[Optional] Download stockfish-16 fromherepython-mchess_insight# run appNow answer questions and have fun withcsvorjsondataPython modulepipinstallchess_insight[Optional] Download stockfish-16 fromhereUsageget gamesfromchess_insightimportChessComApiCommunicator,LichessApiCommunicatorc1=LichessApiCommunicator("path/to/stockfish")c2=ChessComApiCommunicator("path/to/stockfish"# if blank stocfish wont be used)games=list(c1.games_generator("your lichess username",10,"blitz"))games+=list(c2.games_generator("your chess com username",10,"blitz"))export games to csvchess_insight.export_games_to_csv(list(games))CSVdatehostopeningopening_shortopponent_accuracy_opening_inaccuracyopponent_accuracy_opening_mistakeopponent_accuracy_opening_blunderopponent_accuracy_middle_game_inaccuracyopponent_accuracy_middle_game_mistakeopponent_accuracy_middle_game_blunderopponent_accuracy_end_game_inaccuracyopponent_accuracy_end_game_mistakeopponent_accuracy_end_game_blunderopponent_avg_move_time_openingopponent_avg_move_time_middle_gameopponent_avg_move_time_end_gameopponent_elophases_openingphases_middle_gamephases_end_gameplayer_accuracy_opening_inaccuracyplayer_accuracy_opening_mistakeplayer_accuracy_opening_blunderplayer_accuracy_middle_game_inaccuracyplayer_accuracy_middle_game_mistakeplayer_accuracy_middle_game_blunderplayer_accuracy_end_game_inaccuracyplayer_accuracy_end_game_mistakeplayer_accuracy_end_game_blunderplayer_avg_move_time_openingplayer_avg_move_time_middle_gameplayer_avg_move_time_end_gameplayer_eloplayer_colorresulttime_classtime_controlurlusername2022-05-26 16:51:04lichess.orgPirc Defense: Classical VariationPirc Defense2221011110000.252.882.881737851511002110001.02.23082.23081779white["white", "timeout"]blitz180+0https://lichess.org/vf8yqCKhpro100wdupe2022-05-11 20:26:37lichess.orgVienna GameVienna Game1118991414140.02.8752.269217923481040003220001.55.91673.34621790white["black", "timeout"]blitz180+0https://lichess.org/PjE2bZ8rpro100wdupe2022-05-11 20:22:35lichess.orgSicilian Defense: Chekhover VariationSicilian Defense0001110001.06.26.21772730302225550000.33335.93335.93331778black["black", "timeout"]blitz180+0https://lichess.org/y1OSLD9Apro100wdupe2022-05-05 07:52:37lichess.orgIndian Defense: Knights VariationIndian Defense0001114110.01.79172.521117893481421111111111822220.02.33332.26761778black["draw", "timeout"]blitz180+0https://lichess.org/Yn1BxD8rpro100wdupeget games as dictforgameingames:print(game.asdict())json{"date":datetime.datetime(2023,9,14,21,57,47),"host":"chess.com","opening":"Sicilian Defense: Closed, Traditional","opening_short":"Sicilian Defense","opponent":{"avg_move_time":{"opening":1.2,"middle_game":5.1906,"end_game":3.9467},"elo":1603,"evaluation":{"opening":{"inaccuracy":1,"mistake":1,"blunder":1},"middle_game":{"inaccuracy":13,"mistake":13,"blunder":15},"end_game":{"inaccuracy":6,"mistake":7,"blunder":7}}},"phases":{"opening":4,"middle_game":64,"end_game":91},"player":{"avg_move_time":{"opening":1.65,"middle_game":3.4875,"end_game":3.0109},"elo":1619,"evaluation":{"opening":{"inaccuracy":0,"mistake":0,"blunder":0},"middle_game":{"inaccuracy":1,"mistake":1,"blunder":1},"end_game":{"inaccuracy":1,"mistake":1,"blunder":1}}},"player_color":"white","result":["white","timeout"],"time_class":"blitz","time_control":"180+0","url":"https://www.chess.com/game/live/88467619273","username":"barabasz60"}ArchitectureGame objectAttributeDescriptionhostServer where game was played.urlUrl to game.player_colorPlayer color in game.time_controltime control in format "time+increment" in seconds.         e.g. "600+0" or "180+2"dateDate and time of game in UTC.resultReturns tuple (result, reason)         eg:         (white, resign) -> white won by resignationopening_shortShort opening name in ECO format.         e.g. "Sicilian Defense: Alapin Variation" -> "Sicilian Defense"phasesPhases in half moveshttps://en.wikipedia.org/wiki/Chess_endgame#The_start_of_the_endgamehostServer where game was played.usernameUsername of player.time_classTime class of game.openingOpening name in ECO format.playerDict containing player data. Determined byusername.opponentDict containing opponent data.urlUrl to game.Player objectAttributeDescriptioneloelo of player at the time of game.avg_move_timelist with average move time for each phase.evaluationdict with number of mistakes for each phase.example game:Example charts (Code can be found inhere)