Point or postcode to electoral district service for Canada, its provinces and municipalities
HTML JavaScript CSS Python



Dependency Status

Represent is the open database of Canadian elected officials and electoral districts. It provides a REST API to boundary, representative, and postcode resources.

This repository contains a master Django project, documentation, and a demo app. Code for the individual components of the API is in separate packages, which this project depends on:

There's also a package to provide colourful district map tiles:

Getting Started

The following instructions are to setup your own instance of Represent. If you just want access to data, please read our API documentation.

Follow the instructions in the Python Quick Start Guide to install Homebrew, Git, Python, virtualenv, GDAL and PostGIS. The deployment uses Python 3.5, PostgreSQL 9.6, and PostGIS 2.3.

Create a database and enable PostGIS (commands should be issued as user postgres):

createdb represent
psql -c "CREATE EXTENSION postgis;" represent

Install the project:

pyvenv represent-env
source represent-env/bin/activate
git clone https://github.com/opennorth/represent-canada.git
cd represent-canada
pip install -r requirements.txt

Configure the DATABASES Django setting and and create the database tables:

cp settings.py.example settings.py
$EDITOR settings.py
python manage.py migrate

You can launch a development server with:

python manage.py runserver

Adding Data

Download the data, and then symlink represent-canada-data into the project directory:

mkdir data
ln -s /path/to/represent-canada-data/ data/shapefiles

To load the data into the API, see the boundaries, representatives, and postcodes packages.


Read the wiki and deployment/.

Bugs? Questions?

This repository is on GitHub: https://github.com/opennorth/represent-canada, where your contributions, forks, bug reports, feature requests, and feedback are greatly welcomed.

Copyright (c) 2017 Open North Inc., released under the MIT license