Setting family_name and given_name on a Person?


#1

I’m trying to create a new person, but can’t seem to add the first and last name.

        person = Person(
            name=row['name'],
            district=row['district'],
            party=party,
            primary_org=chamber,
            gender='male',
            given_name='first',
            family_name='last',
        )

but when I do that, I get:

TypeError: __init__() got an unexpected keyword argument 'given_name'

same goes for family_name. Is there a different way to add those? I found the attrs via the OCD docs.


#2

we could definitely add these as optional parameters in Pupa: https://github.com/opencivicdata/pupa/blob/master/pupa/scrape/popolo.py

if you have time to make a PR that’d be great


#3

Thanks James, just checking that I wasn’t doing something wrong. I’ll add that PR to my todo list when i’m done w/ the new WY scraper.