Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

Helper scripts to fix PGN meta-data before importing them to Chess DB (like SCID)

Project description

**normalizePGN** is a package containing helper scripts and examples that show how to normalize - i.e. correct
some games' meta-data contained in .pgn files before loading them to chess database.
PGN files that are being published by tournaments' organizers sometimes (especially for large events where
few people work on digitalizing games) used to be not consistent. E.g. event name or event place is written
in slightly different way or there is missing some important information in .pgn files that we want to have - like
time control, players ELO or titles, etc. Those scripts help to fix and complete this information quickly
(faster than just by manually editing .pgn files).
The idea is to perform following steps:
- import games to SQLite database
- run few SQL queries that check data consistency and things that we care
- based on results of previous step, write fix SQL expressions (usually the ones from previous tournaments
are good enough or needs only slight modification)
- run fix expressions
- re-check data (using queries from second step)
- export games back to .pgn file
- import .pgn file to chess database of your choice (e.g. SCID).
So using this package requires some basic SQL knowledge and some initial time investment into getting
familiar how all this works and creating an initial scripts suitable for your specific use cases.
But my experience is that tournament organizers tend to replicate the same issues in .pgn files
from one event edition to next. So workout scripts from one edition usually works for all next editions of the
same tournament.

Provided examples use POSIX shell and some utilities (like sed), so Linux or Mac users could have good starting point.
Windows users may need to put more time to rewrite this staff to technologies available in their system or
try to use some utilities like cygwin or unix services for windows.

For information what files are deployed by this package and where see file included in source-ball or
in typical installation using pip deployed to folder:
- /usr/local/share/doc/normalizePGN (Linux)
- C:\Python35\doc\normalizePGN (Windows) or
- <USER>\AppData\Local\Programs\Python\Python35-32\Doc\normalizePGN

Project details

Release history Release notifications

This version
History Node


History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
normalizePGN-0.1.1.tar.gz (754.5 kB) Copy SHA256 hash SHA256 Source None Mar 21, 2016

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page