{"id":20830657,"url":"https://github.com/endlesstrax/pgn-to-sqlite","last_synced_at":"2026-03-07T03:09:34.692Z","repository":{"id":48782976,"uuid":"338403875","full_name":"EndlessTrax/pgn-to-sqlite","owner":"EndlessTrax","description":"Pull your Chess games from chess.com and lichess.org into a sqlite3 database. ","archived":false,"fork":false,"pushed_at":"2025-05-02T23:49:33.000Z","size":319,"stargazers_count":19,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-03T00:27:48.006Z","etag":null,"topics":["chess","database","pgn","python","sqlite3"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pgn_to_sqlite/","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/EndlessTrax.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-12T18:45:58.000Z","updated_at":"2025-05-02T23:49:25.000Z","dependencies_parsed_at":"2024-01-30T00:29:58.501Z","dependency_job_id":"b78116ca-4caa-4bfc-a435-2f4629bb8fda","html_url":"https://github.com/EndlessTrax/pgn-to-sqlite","commit_stats":{"total_commits":87,"total_committers":2,"mean_commits":43.5,"dds":0.03448275862068961,"last_synced_commit":"1c6fdf3c4e2306f56224b4823ca35a5fc9dd5203"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EndlessTrax%2Fpgn-to-sqlite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EndlessTrax%2Fpgn-to-sqlite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EndlessTrax%2Fpgn-to-sqlite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EndlessTrax%2Fpgn-to-sqlite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EndlessTrax","download_url":"https://codeload.github.com/EndlessTrax/pgn-to-sqlite/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252963316,"owners_count":21832484,"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","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","database","pgn","python","sqlite3"],"created_at":"2024-11-17T23:25:21.833Z","updated_at":"2026-03-07T03:09:34.685Z","avatar_url":"https://github.com/EndlessTrax.png","language":"Python","funding_links":["https://github.com/sponsors/EndlessTrax","https://ko-fi.com/endlesstrax"],"categories":[],"sub_categories":[],"readme":"# PGN to SQLite\n\n![PyPI version](https://img.shields.io/pypi/v/pgn-to-sqlite)\n![GitHub](https://img.shields.io/github/license/endlesstrax/pgn-to-sqlite)\n![Python Version](https://img.shields.io/pypi/pyversions/pgn-to-sqlite)\n\nA CLI application for pulling PGN files from Chess.com and Lichess.org and saving your games into a SQLite database.\n\nIt can also be used to save PGN files from a local folder to a SQLite database.\n\n## Requirements\n\nPython 3.10 or higher is required.\n\n## Installation\n\nIt is recommended that you install this package in a virtual or isolated environment. The easiest way to do this is with [uv](https://docs.astral.sh/uv/):\n\n```bash\nuv tool install pgn_to_sqlite\n```\n\nAlternatively, you can install it with [pipx](https://github.com/pypa/pipx):\n\n```shell\npipx install pgn_to_sqlite\n```\n\nOr with `pip`:\n\n```bash\npip install pgn_to_sqlite\n```\n\n## Usage\n\n```shell\nUsage: pgn-to-sqlite [OPTIONS] COMMAND [ARGS]...\n\n  Save your chess games to a SQLite database.\n\n  You can `fetch` your games from chess.com or lichess.org. You can also\n  `save` local PGN files to the database.\n\nOptions:\n  -u, --user TEXT    Your username for the chess site.\n  -o, --output FILE  Where you would like your database saved.  [required]\n  --help             Show this message and exit.\n\nCommands:\n  fetch  Fetch all games from the requested site.\n  save   Save all PGN files from the given folder.\n```\n\n### Fetching Games from Chess.com or Lichess.org\n\nTo download, parse, and save your games, both `--user` and `--output` are required. The `fetch` command accepts either `chess` or `lichess` as an argument for [Chess.com](https://www.chess.com) and [Lichess.org](https://lichess.org) respectively.\n\n**Example:**\n\n```shell\npgn-to-sqlite -u endlesstrax -o games.db fetch lichess\n```\n\n\u003e **Note:** If you've played a lot of games, be patient—it could take a minute or two to download and process them all.\n\n### Saving Games from a Local Folder\n\nTo save games from local PGN files to your database, only `--output` is required. The `save` command expects a folder path as an argument.\n\n**Example:**\n\n```shell\npgn-to-sqlite -o games.db save ./chess/games/\n```\n\n## Development\n\nThis project uses [uv](https://docs.astral.sh/uv/) for dependency management and development workflows.\n\n### Setting Up Your Development Environment\n\n1. Install `uv` if you haven't already:\n   ```bash\n   pip install uv\n   ```\n\n2. Clone the repository:\n   ```bash\n   git clone https://github.com/EndlessTrax/pgn-to-sqlite.git\n   cd pgn-to-sqlite\n   ```\n\n3. Sync dependencies and set up the virtual environment:\n   ```bash\n   uv sync\n   ```\n\n### Running Tests\n\nRun the test suite with:\n\n```bash\nuv run pytest\n```\n\nFor coverage reporting:\n\n```bash\nuv run pytest --cov\n```\n\n### Linting and Formatting\n\nThis project uses [Ruff](https://github.com/astral-sh/ruff) for linting and formatting:\n\n```bash\n# Check for issues\nuv run ruff check .\n\n# Format code\nuv run ruff format .\n```\n\n### Building the Project\n\nTo build the package:\n\n```bash\nuv build\n```\n\n## Contributing\n\nContributions are welcome! Please follow these guidelines:\n\n1. **File an issue first** - Before making a PR, please [file an issue](https://github.com/EndlessTrax/pgn-to-sqlite/issues) so the implementation can be discussed. This saves time and increases the chances of your PR being merged without significant changes.\n\n2. **Lint and format your code** - Use `uv run ruff check .` and `uv run ruff format .` to ensure your code follows the project's style guidelines.\n\n3. **Include tests** - Please include tests for any code changes (unless current tests already cover your contribution).\n\n4. **Update documentation** - If your changes affect usage, please update the README accordingly.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Support\n\nIf you find this project useful and would like to show your support, you can:\n- [Sponsor on GitHub](https://github.com/sponsors/EndlessTrax)\n- [Buy me a coffee](https://ko-fi.com/endlesstrax) ☕\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendlesstrax%2Fpgn-to-sqlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fendlesstrax%2Fpgn-to-sqlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendlesstrax%2Fpgn-to-sqlite/lists"}