Code Monkey home page Code Monkey logo

uk-polling-stations's Introduction

Stories in Ready

Build Status Coverage Status

UK-Polling-Stations

This is a work in progress project that needs help in a number of ways:

  1. Importing the data we have collected from councils (See Below)
  2. If you are a developer (python, django, frontend, etc) or designer, we need help making the site itself.
  3. If you are interested in helping us gather this data, or if you know a lot about the strange world of the UK geographic system.

If you are interested in helping out in any way at all, please contact [email protected]

Getting Started

Python

UK-Polling-Stations requires python 3.4 or 3.5

Install system dependencies

UK-Polling-Stations requires Python 3, Postgres, PostGIS, libgeos, GDAL, Node JS and NPM.

On Mac OSX, run:

brew install postgresql
brew install postgis
brew install geos
brew install gdal
brew install node

From a clean install of Ubuntu 14.04 (Trusty):

sudo apt-get install postgresql-9.3 postgresql-server-dev-9.3 python-psycopg2 python3-dev postgis postgresql-9.3-postgis-2.1 libxml2-dev libxslt-dev nodejs npm

sudo ln -s /usr/bin/nodejs /usr/bin/node

or on Ubuntu 16.04 (Xenial):

sudo apt-get install postgresql-9.5 postgresql-server-dev-9.5 python-psycopg2 python3-dev postgis postgresql-9.5-postgis-2.2 libxml2-dev libxslt1-dev nodejs npm

sudo ln -s /usr/bin/nodejs /usr/bin/node

For other linux distributions, see here for details on installing geospatial libraries for use with Django.

The API docs rely on drafter for parsing API Blueprint. On OSX this can be installed using

brew install --HEAD https://raw.github.com/apiaryio/drafter/master/tools/homebrew/drafter.rb

On Ubuntu, this needs to be installed/compiled manually:

wget https://github.com/apiaryio/drafter/releases/download/v3.2.7/drafter-v3.2.7.tar.gz
tar xvzf drafter-v3.2.7.tar.gz
cd drafter-v3.2.7
./configure --shared
make libdrafter
sudo cp build/out/Release/lib.target/libdrafter.so /usr/lib/libdrafter.so
sudo cp src/drafter.h /usr/include/drafter/drafter.h

Install python dependencies

pip install -r requirements/base.txt

Install front-end dependencies

npm install

Install testing dependencies

The integration tests require PhantomJS to be installed globally.

On Mac OSX, this can be installed by running

brew install phantomjs

On Ubunutu, run:

sudo npm install -g phantomjs-prebuilt

Install testing requirements

pip install -r requirements/testing.txt

Create local config

cp polling_stations/settings/local.example.py polling_stations/settings/local.py

Create database

sudo -u postgres createdb polling_stations
sudo -u postgres createuser dc -P -s
sudo -u postgres psql polling_stations
psql (9.3.6)
Type "help" for help.

polling_stations=# CREATE EXTENSION postgis;
CREATE EXTENSION
polling_stations=#

Run migrations

python manage.py migrate

Import initial data

Import Councils

python manage.py import_councils

Import some Polling District/Station data

For development purposes, you will need to seed your database with some data. Most of our import scripts reference data is hosted privately, but there are a number of councils who publish their data at a public location.

For example:

  • python manage.py import_barrow_in_furness
  • python manage.py import_canterbury
  • python manage.py import_doncaster
  • python manage.py import_dover
  • python manage.py import_dundee
  • python manage.py import_eden
  • python manage.py import_edinburgh
  • python manage.py import_epsom_and_ewell
  • python manage.py import_fife
  • python manage.py import_guildford
  • python manage.py import_hastings
  • python manage.py import_lancaster
  • python manage.py import_salford
  • python manage.py import_shepway
  • python manage.py import_thanet
  • python manage.py import_tonbridge
  • python manage.py import_tunbridge_wells
  • python manage.py import_wolverhampton

all reference data which is publicly available.

Importing the data we have from councils

Each council that has unimported data has a Github Issue with the Data Import label.

You can see the current status in the Waffle Board.

We make a Django manage.py command in the data_collection app for each council which imports the raw data. If you are interested in helping the project by writing an import script, see the issues tagged recommended for beginners for more info.

uk-polling-stations's People

Contributors

chris48s avatar symroe avatar davidmiller avatar joemitchell avatar andylolz avatar tfgg avatar ashb avatar hishivshah avatar bobharper1 avatar waffle-iron avatar malcolmmoyes avatar mvl22 avatar dracos avatar pyup-bot avatar

Stargazers

Mohamed Almukhtar avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.