{"id":18393044,"url":"https://github.com/elma16/reti","last_synced_at":"2025-10-12T22:54:15.618Z","repository":{"id":207887099,"uuid":"478216868","full_name":"elma16/reti","owner":"elma16","description":"A collection of cql scripts for endgame studies in pgn files.","archived":false,"fork":false,"pushed_at":"2025-09-27T20:37:01.000Z","size":6255,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-12T22:54:14.311Z","etag":null,"topics":["chess","cql"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elma16.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-04-05T16:41:29.000Z","updated_at":"2025-09-27T20:37:08.000Z","dependencies_parsed_at":"2024-12-31T17:30:32.864Z","dependency_job_id":"617800e1-398f-4c0d-abc2-097c41f52b80","html_url":"https://github.com/elma16/reti","commit_stats":null,"previous_names":["elma16/reti"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/elma16/reti","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elma16%2Freti","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elma16%2Freti/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elma16%2Freti/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elma16%2Freti/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elma16","download_url":"https://codeload.github.com/elma16/reti/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elma16%2Freti/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013281,"owners_count":26085250,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chess","cql"],"created_at":"2024-11-06T01:59:08.555Z","updated_at":"2025-10-12T22:54:15.602Z","avatar_url":"https://github.com/elma16.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# reti\nA collection of cql scripts for endgame studies in pgn files.\n\n## Introduction\n\nIn Müller and Lamprecht's celebrated work \"Fundamental Chess Endgames\", [they show a table on page 11 (this is from the Amazon website free sample of the book)](https://www.amazon.co.uk/Fundamental-Chess-Endings-One-Encyclopaedia/dp/1901983536?asin=B00BJ64LMW\u0026revisionId=e8148266\u0026format=1\u0026depth=1). In it, they mention the use of Mega Database 2001, a proprietary database by Chessbase. Obtaining a copy of this to reproduce their table would be ~£100. It's now 2022, and open source chess has come a long way, and now it is trivial to obtain databases 100 times larger than this, completely for free. Namely, Lichess has an [open source database of games played on their website](https://database.lichess.org/#standard_games). The final piece of the puzzle is finding a way to obtain the required values. For this I used Gady Costeff's [CQL : Chess Query Language](http://www.gadycosteff.com/cql/). The result is a collection of scripts which can be run to analyse how often an ending occurs.\n\n## But wait, there's more!\n\nThis analysis is not limited to just some big database, this can be done on _any_ pgn file you have available to you!\n\n## Installation\n\nTo install, simply clone the repository\n\n``` shell\ngh repo clone elma16/reti\n```\n\nyou will also need cql.\n\n## Usage \n\n``` shell\nsource FCE-table.sh path/to/cql/executable path/to/database.pgn path/to/output/folder halfmoves\n```\n\nTODOs\n\n- [ ] use cql to make a collection of endings, create a pgn with a bunch of them\n  - [ ] randomly select a game from the pgn without replacement. \n  - [ ] if the ending is a theoretical win, play against the computer with the winning side\n  - [ ] if the ending is a theoretical draw, you need to work out with which side you're defending.\n\n\npython chess_practice.py --pgn your_endgames.pgn --mode endgame --num 5","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felma16%2Freti","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felma16%2Freti","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felma16%2Freti/lists"}