-
-
Save rightfold/7b8a97fb76e53674eec0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fields = line['Contact'].split(' ') | |
line['Achternaam'] = '' | |
line['Voornaam'] = '' | |
line['Tussenvoegsel'] = '' | |
for field in fields: | |
field = field.lower() | |
if field in {'van', 'de', 'der', 'te'}: | |
line['Tussenvoegsel'] += ' ' + field | |
elif line['Tussenvoegsel']: | |
line['Achternaam'] = field | |
else: | |
line['Voornaam'] = field | |
line['Tussenvoegsel'] = line['Tussenvoegsel'].strip() or None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment