Package: everypolitician-popolo
This is a port of the Ruby gemeverypolitician-popoloto
Python.  Even this README is strongly based on that gem.InstallationYou can install this package with:pipinstalleverypolitician-popoloUsageYou can download a Popolo file manually fromEveryPolitician(although there’s another
library if you want to automate that:See also: the everypolitician package).The following example usesÅland Lagting(which is the legislature of the Åland islands, available as
JSON data from theEveryPolitician page for Åland).First you’ll need to require the library and read in a file from disk.frompopolo_data.importerimportPopolopopolo=Popolo.from_filename('ep-popolo-v1.0.json')All Popolo classes used by EveryPolitician are implemented:PersonOrganizationAreaEventMembershipThere are methods defined for each property on a class, e.g. for a
Person:len(popolo.persons)# => 60person=popolo.persons.firstperson.id# => u'e3aab23e-a883-4763-be0d-92e5936024e2'person.name# => u'Aaltonen Carina'person.image# => u'http://www.lagtinget.ax/files/aaltonen_carina.jpg'person.wikidata# => u"Q4934081"You can also find individual records or collections based on their
attributes:popolo.persons.get(name="Aaltonen Carina")# => <Person: Aaltonen Carina>popolo.organizations.filter(classification="party")# => [<Organization: Liberalerna>,#     <Organization: Liberalerna på Åland r.f.>,#     <Organization: Moderat Samling>,#     <Organization: Moderat Samling på Åland r.f.>,#     <Organization: Moderat samling>,#     <Organization: Moderaterna på Åland>,#     <Organization: Obunden Samling>,#     <Organization: Obunden Samling på Åland>,#     <Organization: Ålands Framtid>,#     <Organization: Ålands Socialdemokrater>,#     <Organization: Ålands framtid>,#     <Organization: Ålands socialdemokrater>,#     <Organization: Åländsk Center>,#     <Organization: Åländsk Center r.f.>,#     <Organization: Åländsk Demokrati>,#     <Organization: Åländsk center>]DevelopmentAfter checking out the repo, install the dependencies with:pipinstall-rrequirements.txtYou can then run the tests with:toxTo release a new version, update the version number insetup.pyand add notes to theCHANGES.txtdescribing
the fixes or new features.See also: the everypolitician packageIn the example above, the Popolo data comes from a downloaded
file (ep-popolo-v1.0.json), which is the kind of file you
can get from theEveryPolitician website. But your Ruby application can
also interact directly with the EveryPolitician data using theeverypolitician package,
so you don’t need to handle JSON files at all. The value
returned from theLegislature.popolomethod is aPopoloobject, which you can use as above.  For example, you can
install the package with:pipinstalleverypoliticianAnd then use it as follows:fromeverypoliticianimportEveryPoliticianaustralia=EveryPolitician().country('Australia')australia.code# => u'AU'senate=australia.legislature('Senate')senate.popolo().persons.get(name='Aden Ridgeway')# => <Person: Aden Ridgeway>ContributingBug reports and pull requests are welcome on GitHub at<https://github.com/everypolitician/everypolitician-popolo-python>.LicenseThe gem is available as open source under the terms of theMIT
License.