How to test this GEDCOM parser?

255 views Asked by At

I was trying to test this parser with my gedcom file. I do not understand how to call some of the functions and what parameters are to be given. Example, in the families function, I need to pass an individual as the parameter but if I type a Person's full name or even his ID it does not accept. I get an error "AttributeError: 'str' object has no attribute 'is_individual'".

https://github.com/madprime/python-gedcom

I appreciate the help. Thank you!

1

There are 1 answers

0
Michael Dyck On BEST ANSWER

Re your specific example: In the gedcom/__init__.py file, the is_individual method is only defined for the Element class, so presumably the families method is assuming that (the value bound to) its individual parameter is an instance of that class. In your case, this would be one of the many Element instances created when the parser parses your gedcom file, which you can get at via the element_list or element_dict methods of the Gedcom class.

Note: In the repo you link to, the README says that the project has moved elsewhere. You should probably use the parser there. Moreover, if you raise an issue there, they might expand the documentation to answer your questions.