sgftocsv.py

   

sgftocsv.py is a small [ext] Python script, that recursively goes through a directory, collecting some information from the sgf files and generates a csv file with that info.

Currently the following properties are collected:

  • Path and Filename
  • Black Player and Rank
  • White Player and Rank
  • Result
  • Date the game was played
  • Event

It is pretty easy to add more.

Here is what I did with it:

  1. Downloaded and extracted a game collection
  2. Ran the script over it to get the csv file
  3. Use [ext] OpenOffice.org Spreadsheet to convert the file to a format easily readable by filemaker, a database frontend (this was necessary as I used ^ as the text delimiter, since " and ' seem to be used within the Event names occasionally; the cell delimiter is the semicolon)
  4. Imported the data into the database
  5. Created a very small script in file maker so I can open the files from within filemaker (it actually also saves the number of times I viewed the file as well as the last access date)

Now I have the powerful search features of SQL combined with my favourite SGF reader. This had to be done because all other tools I could find would not handle this many files properly (or in a decent amount of time). Jacoto for example just crashed. Kombilo was horribly slow (apart from the interface being rather... well it can hardly be called interface at all).

A small bottom note: I cannot recommend using the [ext] OpenOffice.org Base database. After openig the data in the spreadsheet it promises that marking all the data and drag/droping it into Base will create a database with that data (since there is no import feature). Well what happened is that I let it run for around 45 minutes and then I was fed up.

Since I really cant be bothered to host the script anywhere I will just put it up here. Copy/Paste and save as sgftocsv.py. Obviously you will need [ext] Python for it to work, so download it from their page. Also you need to enter the paths in the script itself (using \\ instead of \ on windows systems).

Enjoy studying ChrisP


sgftocsv.py last edited by ArnoHollosi on December 23, 2006 - 10:30
RecentChanges · StartingPoints · About
Edit page ·Search · Related · Page info · Latest diff
[Welcome to Sensei's Library!]
RecentChanges
StartingPoints
About
RandomPage
Search position
Page history
Latest page diff
Partner sites:
Go Teaching Ladder
Goproblems.com
Login / Prefs
Tools
Sensei's Library