Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Navigate countries and legislatures from EveryPolitician

Project Description


A Python library for easy access to EveryPolitician data. This is essentially a Python port of everypolitican-ruby.

This has been tested with Python 2.7 and Python 3.5.


You can install this package from PyPi with:

pip install everypolitician


Creating a instance of the EveryPolitican class allows you to access information on countries, their legislatures and legislative periods. Each country and legislature has a slug that can be used to reference them via the country and legislature methods:

from everypolitician import EveryPolitician
ep = EveryPolitician()

australia ='Australia')
senate = australia.legislature('Senate')
senate # => <Legislature: Senate in Australia>

united_kingdom ='UK')
house_of_commons = united_kingdom.legislature('Commons')

american_samoa ='American-Samoa')
house_of_representatives = american_samoa.legislature('House')

for country in ep.countries():
    print, 'has', len(country.legislatures()), 'legislatures'

By default this will get the EveryPolitician data and returns the most recent data. This data is found from the index file, called countries.json, which links to specific versions of other data files.

If you want want to point to a different countries.json file, you can override the default URL by specifying the countries_json_url keyword argument when creating the EveryPolitician object, e.g.:


The example above is using a specific commit (indicated by the hash 080cb46). If you want to use a local copy of countries.json you can create the object with the countries_json_filename keyword argument instead, e.g.:


For more about countries.json, see this description.

Remember that EveryPolitician data is frequently updated — see this information about using EveryPolitician data.

More information on the EveryPolitician site.


After cloning the repo, you can run the tests on Python 2.7 and Python 3.5 by running:


Or you can create a virtualenv and install the package’s dependencies with:

pip install -e .

And run the tests on the Python version your virtualenv was based on with:



Bug reports and pull requests are welcome on GitHub at


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

Release History

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
everypolitician-0.0.13-py2-none-any.whl (7.1 kB) Copy SHA256 Checksum SHA256 py2 Wheel Jan 31, 2017
everypolitician-0.0.13.tar.gz (4.7 kB) Copy SHA256 Checksum SHA256 Source Jan 31, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS 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