python-gedcom icon indicating copy to clipboard operation
python-gedcom copied to clipboard

enhancement: return all_names

Open mameen opened this issue 5 years ago • 2 comments

while the following snippet can return all names.. having it built in IndividualElement would help

all_names = [a.get_value() for a in individual.get_child_elements() if a.get_tag() == gedcom.tags.GEDCOM_TAG_NAME]

mameen avatar Feb 17 '20 04:02 mameen

@mameen Thank you for contributing! I know I have merged it already but shouldn't get_all_names() return a list of tuples containing the first and last name of the individuals?

Change in consideration:

all_names = [a.get_name() for a in individual.get_child_elements() if a.get_tag() == gedcom.tags.GEDCOM_TAG_NAME]

See the get_name() method: https://nickreynke.github.io/python-gedcom/gedcom/element/individual.html#gedcom.element.individual.IndividualElement.get_name

joeyaurel avatar Mar 22 '20 15:03 joeyaurel

I agree this is the right way to do it.. I'm not actively working on it, but since this is my bad I can fix it, and update the tests.. do you want me to fix it, or will you take care of it? Thanks!

mameen avatar Mar 22 '20 21:03 mameen