Skip to content

Commit

Permalink
Merge branch 'release/v0.2.3dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicklas Reincke committed Nov 28, 2018
2 parents c8571f2 + 80846b5 commit 87ad49a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ is_private | none | Boolean | Returns True if the record is
is_deceased | none | Boolean | Returns True if the individual is marked deceased
criteria_match | colon separated string "surname=[name]:name=[name]:birth][year]:birth_range=[year-to-year]:death=[year]:death_range[year-to-year]"| Boolean | Returns True if the criteria matches
surname_match | String | Boolean | Returns True if substring matches
given_match | String | Boolean | Returns True if subscring matches
given_match | String | Boolean | Returns True if substring matches
death_range_match | Int from, Int to | Boolean | Returns True if Death Year is in the supplied range
death_year_match | Int | Boolean | Returns True if Death Year equals parameter
birth_range_match | Int from, Int to | Boolean | Returns True if Birth Year is in the supplied range
Expand Down Expand Up @@ -144,11 +144,15 @@ Further updates by [Nicklas Reincke](https://github.com/nickreynke) and [Damon B

## Changelog

**v0.2.3dev**
- Assemble Marriages properly ([#9](https://github.com/nickreynke/python-gedcom/issues/9))
- Return the top NAME record instead of the last one ([#9](https://github.com/nickreynke/python-gedcom/issues/9))

**v0.2.2dev**

- Support BOM control characters
- Support BOM control characters ([#5](https://github.com/nickreynke/python-gedcom/issues/5))
- Support the last line not having a CR and/or LF
- Support incorrect line splitting generated by Ancestry. Insert CONT/CONC tag as necessary
- Support incorrect line splitting generated by Ancestry. Insert CONT/CONC tag as necessary ([#6](https://github.com/nickreynke/python-gedcom/issues/6))

**v0.2.1dev**

Expand Down
20 changes: 16 additions & 4 deletions gedcom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,14 +346,14 @@ def get_marriages(self, individual):
for family in families:
for family_data in family.get_child_elements():
if family_data.get_tag() == GEDCOM_TAG_MARRIAGE:
date = ''
place = ''
for marriage_data in family_data.get_child_elements():
date = ''
place = ''
if marriage_data.get_tag() == GEDCOM_TAG_DATE:
date = marriage_data.get_value()
if marriage_data.get_tag() == GEDCOM_TAG_PLACE:
place = marriage_data.get_value()
marriages.append((date, place))
marriages.append((date, place))
return marriages

def get_marriage_years(self, individual):
Expand Down Expand Up @@ -917,22 +917,34 @@ def get_name(self):
last = ""
if not self.is_individual():
return first, last

# Return the first GEDCOM_TAG_NAME that is found. Alternatively
# as soon as we have both the GETCOM_TAG_GIVEN_NAME and _SURNAME return those
found_given_name = False
found_surname_name = False
for child in self.get_child_elements():
if child.get_tag() == GEDCOM_TAG_NAME:
# some older GEDCOM files don't use child tags but instead
# some GEDCOM files don't use child tags but instead
# place the name in the value of the NAME tag
if child.get_value() != "":
name = child.get_value().split('/')
if len(name) > 0:
first = name[0].strip()
if len(name) > 1:
last = name[1].strip()
return first, last
else:
for childOfChild in child.get_child_elements():
if childOfChild.get_tag() == GEDCOM_TAG_GIVEN_NAME:
first = childOfChild.get_value()
found_given_name = True
if childOfChild.get_tag() == GEDCOM_TAG_SURNAME:
last = childOfChild.get_value()
found_surname_name = True
if found_given_name and found_surname_name:
return first, last

# If we reach here we are probably returning empty strings
return first, last

def get_gender(self):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='python-gedcom',
version='0.2.2dev',
version='0.2.3dev',
packages=['gedcom', ],
license='GPLv2',
package_dir={'': '.'},
Expand Down

0 comments on commit 87ad49a

Please sign in to comment.