Coder Social home page Coder Social logo

ellipszist / dataset-election-62-candidates Goto Github PK

View Code? Open in Web Editor NEW

This project forked from electinth/dataset-election-62-candidates

0.0 0.0 0.0 41.47 MB

Thailand Election'62 Candidate Information Browsing Website

Home Page: http://elect.in.th/candidates

License: Other

Shell 0.01% JavaScript 0.23% Python 0.11% CSS 0.33% HTML 0.56% Jupyter Notebook 98.76%

dataset-election-62-candidates's Introduction

Thailand Election'62 Zone and Candidate Dataset and Browsing Website

How did we get candidate data?

In the beginning, we had only PDFs from The Election Commission of Thailand (ECT). So, we had to parse them manually. Details about parsing can be founded in ./notebooks/dev.ipyndb. The process caused several issues, for example, typos from tone marks not ordered properly.

Around 20 Feb 2019, ECT released SmartVote application, we then tracked down APIs that the application uses and were able to retreive the candidate and party information.

Below are the datasets extracted from SmartVote's APIs.

  1. Zone candidate information ./data/candidates.csv, ./data/detailed-candidates.csv
  2. Party-list candidate information ./data/partylist_candidates.csv with help from @c4n
  3. Party information, including leader and secretary's names, address, logo, address, policy /data/party-information.json, ./data/party-logos

Details about tracking down API endpoints used by SmartVote will be written in TODO.

Zone & Candidate Browsering Website

This website has no database. This website provides a quick and simple way for users to see who are candidates in their area, using postcode. As zone and candidate data is rarely changed, a static website is sufficient to this purpose without the use of backend and database. Apart from few components needed to be developed, the static-site approach can be massively scaled, for example deployed behind a CDN service. At peak, we had 5,000 concurrent users without any failure. This technique is also adopted by ELECT Live.

This website has two components, front page, zone and party pages. The first page has a form for entering a postcode or address. We use React for HTML DOM manipulation. Zone and party pages are static files that are generated accordingly. Please see generate-site.py for more details.

Development

Every change made to those pagaes, located in election62, requires regeneration. One can use the following command to automatically update the site:

watch -n 10 'WEBPATH=127.0.0.1:8000 python generate-site.py --env dev'

The script generates the site to ./dist. You can run a static web server from the root directory and access it via http://<WEBPATH>/dist. You might encouter cross-origin issues. If that the case, please verify the value of WEBPATH.

For example, one can use Python's web server module for this purpose:

python -m SimpleHTTPServer

Statistics

Analysis

The presence of political families in 2019 general election

This Jupyter notebook investigates families with multiple MP candidates as well as their affiliation/electoral area in the 2019 Thai general election. [Notebook]

Acknowledgement

This project is published as a part of ELECT. Founded by several parties who care about democracy and transparent information, the mission of ELECT is to provide insightful information for Thai peoples in order to make a better voting decision. We would like to thank all volunteers behind ELECT, including The Matter, Boonmee Lab, and Minimore, and all contributors on GitHub.

dataset-election-62-candidates's People

Contributors

c4n avatar hereblur avatar microbenz avatar p16i avatar phoneee avatar phongsathorn1 avatar verticall 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.