diff --git a/export_csv.sql b/export_csv.sql new file mode 100644 index 0000000..9808838 --- /dev/null +++ b/export_csv.sql @@ -0,0 +1,4 @@ +.headers on +.mode csv +.output legislators.csv +select name, given_name, family_name, gender, party, jurisdiction, r.district, r.type from person join personrole r on r.person_id=person.id where r.end_date is null; diff --git a/src/ossql/people_to_sqlite.py b/src/ossql/people_to_sqlite.py index e8ce00c..8b807ba 100644 --- a/src/ossql/people_to_sqlite.py +++ b/src/ossql/people_to_sqlite.py @@ -37,7 +37,7 @@ def load_people_yaml(dir_path: pathlib.Path) -> int: gender=pdata.pop("gender"), email=pdata.pop("email", ""), image=pdata.pop("image", ""), - party=pdata.pop("party"), + party=pdata.pop("party", [{"name": ""}])[0]["name"], extras=pdata.pop("extras", {}), ) to_links(person, pdata.pop("links", []), PersonLink)