{"id":18136234,"url":"https://github.com/purarue/chess_export","last_synced_at":"2025-12-13T23:03:43.051Z","repository":{"id":52468734,"uuid":"342403050","full_name":"purarue/chess_export","owner":"purarue","description":"Export your chess.com/lichess.org games using their APIs","archived":false,"fork":false,"pushed_at":"2024-11-13T02:37:46.000Z","size":54,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-31T19:57:13.401Z","etag":null,"topics":["chess","chessdotcom","lichess","lichess-api","pgn"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/chess-export/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/purarue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2021-02-25T23:04:57.000Z","updated_at":"2025-01-22T02:35:30.000Z","dependencies_parsed_at":"2024-10-26T11:32:09.341Z","dependency_job_id":"80bcc537-c091-4eff-bc82-b52521fc2e87","html_url":"https://github.com/purarue/chess_export","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"c97f156520ce4d57cadc87199037bbb62eb8d0ba"},"previous_names":["seanbreckenridge/chessdotcom_export","purarue/chess_export","seanbreckenridge/chess_export"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/purarue/chess_export","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purarue%2Fchess_export","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purarue%2Fchess_export/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purarue%2Fchess_export/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purarue%2Fchess_export/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/purarue","download_url":"https://codeload.github.com/purarue/chess_export/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/purarue%2Fchess_export/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270684143,"owners_count":24627773,"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-08-16T02:00:11.002Z","response_time":91,"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","chessdotcom","lichess","lichess-api","pgn"],"created_at":"2024-11-01T14:41:12.200Z","updated_at":"2025-12-13T23:03:43.037Z","avatar_url":"https://github.com/purarue.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chess_export\n\n[![PyPi version](https://img.shields.io/pypi/v/chess_export.svg)](https://pypi.python.org/pypi/chess_export) [![Python 3.10|3.11|3.12|3.13](https://img.shields.io/pypi/pyversions/chess_export.svg)](https://pypi.python.org/pypi/chess_export) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n\nExport your (or someone else's) chess.com/lichess.org games using their APIs\n\n- Chess.com requires no authentication, see their [public API docs](https://www.chess.com/news/view/published-data-api)\n- Lichess requires you to create a token, you can do so by going [here](https://lichess.org/account/oauth/token/create?description=lichess+export) (this requires no extra scopes)\n\n## Installation\n\nRequires `python3.10+`\n\nTo install with pip, run:\n\n    pip install chess-export\n\n## Usage\n\nEach subcommand (`chessdotcom`/`lichess`) has an `export` and `inspect` command -- `export` prints data about your games as JSON, `inspect` reads that dumped info so you can use it in the REPL.\n\nThe `inspect` command just accepts the file as the first argument, like `chess_export lichess inspect data.json` or `chess_export chessdotcom inspect data.json`\n\n### chessdotcom export\n\nThe only required argument is your username, the API serves public data and has no serial rate limit\n\n```\n$ chess_export chessdotcom export purarue \u003edata.json\nRequesting https://api.chess.com/pub/player/purarue/games/archives\nRequesting https://api.chess.com/pub/player/purarue/games/2021/01\n...\n```\n\nIf you're getting 403 errors, you may have to supply a user agent with your email, see [this forum thread](https://www.chess.com/clubs/forum/view/error-403-in-member-profile)\n\nTo do that, you can pass the `--user-agent-email` flag or set the `CHESSDOTCOM_USER_AGENT_EMAIL` environment variable.\n\n### lichess export\n\nRequires your username and a [token](https://lichess.org/account/oauth/token/create?description=lichess+export) (this requires no extra scopes). The token can be provided with the `--token` flag or by setting the `LICHESS_TOKEN` environment variable.\n\n```\n$ chess_export lichess export purarue \u003e data.json\nRequesting https://lichess.org/api/games/user/purarue?pgnInJson=true\n```\n\n### Example\n\nThe games are described in [`PGN`](https://en.wikipedia.org/wiki/Portable_Game_Notation) (which can be parsed using the [`chess`](https://python-chess.readthedocs.io/en/latest/pgn.html) package)\n\n```\n$ chess_export chessdotcom export purarue \u003edata.json\nRequesting https://api.chess.com/pub/player/purarue/games/archives\nRequesting https://api.chess.com/pub/player/purarue/games/2021/01\nRequesting https://api.chess.com/pub/player/purarue/games/2021/02\n$ chess_export chessdotcom inspect data.json\n\nIn [1]: import io, chess.pgn\n\nIn [2]: game = chess.pgn.read_game(io.StringIO(games[0].pgn))\n\nIn [3]: for move in game.mainline_moves():\n   ...:     print(move)\n   ...:\ne2e4\ne7e6\nb1c3\nd8f6\nd2d3\nf8c5\nd3d4\nc5d4\nf2f3\n```\n\nThe information returned by `chess.com`/`lichess` are slightly different, see the [lichess/model.py](chess_export/lichess/model.py) and [chessdotcom/model.py](chess_export/chessdotcom/model.py) files for reference\n\n### Tests\n\n```bash\ngit clone 'https://github.com/purarue/chess_export'\ncd ./chess_export\npip install '.[testing]'\nmypy ./chess_export\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurarue%2Fchess_export","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpurarue%2Fchess_export","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurarue%2Fchess_export/lists"}