Skip to main content

Fetch your games from and and add them to a sqlite database

Project description

PGN to Sqlite

PyPI version GitHub Black

A cli application for pulling pgn files from and and putting your games into a sqlite database.


Requires Python 3.7 and above.

MacOS / Linux:

python3 -m pip install pgn_to_sqlite


python -m pip install pgn_to_sqlite


Usage: pgn-to-sqlite [OPTIONS] COMMAND [ARGS]...

  Save your chess games to an sqlite database.

  You can `fetch` your games from or You can also
  `save` local pgn files to the database.

  Type `pgn-to-sqlite --help` for more information.

  -u, --user TEXT    You username for the chess site.
  -o, --output FILE  Where you would like your database saved?  [required]
  --help             Show this message and exit.

  fetch  Fetch all games from the requested site.
  save   Fetch all pgn file from the given folder.

Fetch games from or

username and output are required when using fetch to download, parse, and save your games to your database. fetch accepts with chess or lichess as an argument for and respectively.


pgn-to-sqlite -u endlesstrax -o data.db fetch lichess

If you've played a lot of games, be patient, it could take a minute or two.

Save games from local folder

output is required when saving games from local pgn files to your database. save expects a folder path as an argument.


pgn-to-sqlite -o data.db save .\chess\games\

Feedback and Contribution

If you find a bug, please file an issue.

If you have feature requests, please file an issue and use the appropriate label.

Please raise an issue before making a PR, so that the issue and implementation can be discussed before you write any code. This will save you time, and increase the chances of your PR being merged without significant changes.

Please format you code with Black.

Please include tests for any PR's that include code (unless current tests cover your code contribution).


If you would like to show your support for the project, I would be very grateful if you would donate to a charity close to my heart, Walk AS One.

And if you would prefer to donate to me personally instead, you can sponsor me on Github? 🤓



  • Breaking changes to CLI commands
  • Added ability to add games from locally saved .pgn files to the output database


  • Fetch games from and
  • Saves games to SQlite3 database

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

pgn_to_sqlite-2.0.3.tar.gz (19.9 kB view hashes)

Uploaded source

Built Distribution

pgn_to_sqlite-2.0.3-py3-none-any.whl (6.4 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page