Giter VIP home page Giter VIP logo

pemilu2024-api's Introduction

Pemilu Vote Count API

Minimal Python script to scrape data from different source of Pemilu live count websites (kawalpemilu.org, pemilu2024.kpu.go.id) and serve the api using Flask (Initially will be used to feed data to my visualisation)

Access it from http://157.230.44.40/{source}. Data updates every 10 minutes.

Available sources:

  • kawalpemilu.org (kawalpemilu)
  • pemilu2024.kpu.go.id (kpu)

E.g., fetching from http://157.230.44.40/kpu will return json of counts from KPU

Sample (data/provinces_data.json)

{"data": {"ACEH": {"paslon_1_ratio": 80.23, "paslon_1_count": 4962, "paslon_2_ratio": 18.17, "paslon_2_count": 1124, "paslon_3_ratio": 1.6, "paslon_3_count": 99, "cakupan_ratio": 0.22, "cakupan_count": "36/16,046", "cakupan_jaga_ratio": 13.86, "cakupan_jaga_count": "2,224/16,046"}, "BALI": {"paslon_1_ratio": 6.65, "paslon_1_count": 5086, "paslon_2_ratio": 55.44, "paslon_2_count": 42372, "paslon_3_ratio": 37.91, "paslon_3_count": 28975, "cakupan_ratio": 2.8, "cakupan_count": "359/12,809", "cakupan_jaga_ratio": 6.59, "cakupan_jaga_count": "844/12,809"}, "BANTEN": {"paslon_1_ratio": 37.88, "paslon_1_count": 35676, "paslon_2_ratio": 47.17, "paslon_2_count": 44424, "paslon_3_ratio": 14.94, "paslon_3_count": 14074, "cakupan_ratio": 1.25...

Todos

  • Make the API public
  • Scrape city/regency level data
  • Save and load data directly to/from Postgre instead of saving it to JSON
  • Add more sources
  • Add feature to access older vote counts

All credit for the data belongs to the KawalPemilu team!

pemilu2024-api's People

Contributors

hariesramdhani avatar

Watchers

 avatar

pemilu2024-api's Issues

issue with scraper import

from selenium.webdriver.support.ui import WebDriverWait

change to
from selenium.webdriver.support.wait import WebDriverWait

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.