This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

This is a port of the Ruby gem everypolitician-popolo to Python. Even this README is strongly based on that gem.

Installation

You can install this package with:

pip install everypolitician-popolo

Usage

You can download a Popolo file manually from EveryPolitician (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 the EveryPolitician page for Åland). You can

First you’ll need to require the library and read in a file from disk.

from popolo_data.importer import Popolo
popolo = Popolo.from_filename('ep-popolo-v1.0.json')

All Popolo classes used by EveryPolitician are implemented:

There are methods defined for each property on a class, e.g. for a Person:

len(popolo.persons) # => 60
person = popolo.persons.first
person.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>]

Development

After checking out the repo, install the dependencies with:

pip install -r requirements.txt

You can then run the tests with:

tox

To release a new version, update the version number in setup.py and add notes to the CHANGES.txt describing the fixes or new features.

See also: the everypolitician package

In 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 the EveryPolitician website. But your Ruby application can also interact directly with the EveryPolitician data using the everypolitician package, so you don’t need to handle JSON files at all. The value returned from the Legislature.popolo method is a Popolo object, which you can use as above. For example, you can install the package with:

pip install everypolitician

And then use it as follows:

from everypolitician import EveryPolitician

australia = EveryPolitician().country('Australia')
australia.code # => u'AU'
senate = australia.legislature('Senate')
senate.popolo().persons.get(name='Aden Ridgeway') # => <Person: Aden Ridgeway>

Contributing

Bug reports and pull requests are welcome on GitHub at <https://github.com/everypolitician/everypolitician-popolo-python>.

License

The gem is available as open source under the terms of the MIT License.

Release History

Release History

0.0.10

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.9

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.8

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.7

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.6

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
everypolitician-popolo-0.0.10.tar.gz (14.5 kB) Copy SHA256 Checksum SHA256 Source Nov 7, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting