From: Matt A. <mr...@ma...> - 2007-12-01 21:22:13
|
Hey Doug, Thanks again for this, it was just what I was looking for and got me nearly there, simplifying all the really tedious work out. So far I haven't added too much to it, but if I do I'll be sure and post it back to the list. On Tue, Nov 27, 2007 at 07:55:20PM -0800, dsblank wrote: > I wrote a quick-n-dirty html scraper that is about 75% of the way there... I > Here it is: > > http://bubo.brynmawr.edu/~dblank/getnarrative.py > > and you run it like: > > python getnarrative.py http://somewebsite.com/myfamily/ > import.csv > > Then, in GRAMPS you should be able to import the file "import.csv" into a > blank database. I actually uncovered a bug around this (filing it now) Apparently auto-detect doesn't yet know that it knows how to import a csv file. Nothing terrible, and hopefully it will be easy to fix. > If you (or any one else) fix up the script, please share it back with us. ... > see some obvious errors (looks like a person becomes their own child) This one was actually a bit of a problem. Gramps apparently doesn't like it at all if a person is their own parent. Thankfully I was able to just add this line and it took care of that issue: $ diff -u getnarrative.py.orig getnarrative.py --- getnarrative.py.orig 2007-11-27 22:54:22.000000000 -0500 +++ getnarrative.py 2007-12-01 16:02:19.000000000 -0500 @@ -189,4 +189,5 @@ kids = family[pair] kids = set(kids) for kid in kids: - print '"%s","%s"' % (marriage[pair], kid) + if (kid != pair[0]) or (kid != pair[1]): + print '"%s","%s"' % (marriage[pair], kid) -matt |