Giter Club home page Giter Club logo

ballot-cure's Introduction

Ingest Scripts

Process county and SoS data for the purposes of helping cure ballots. This was built targeting a GCP PSQL instance. You will need your own PSQL instance to run this without modifying the code. In the csv directory create at least one sub-directory named for a date in this format MM-DD (e.g. 10-06). In that sub-directory place at least one CSV named for a county (e.g. Polk.csv).

  • service.py: defines the Postgres context manager class, you will need to supply your own values for host, dbname, etc. either in the constructor call or as hardcoded defaults in this file
  • constants.py: exists to share common constants between other scripts and keep them out of the way
  • initialize.py: removes all logs then drops and recreates the voters table (executes schema.sql)
  • ingest_county.py: target a directory that is named following this format MM-DD containing one or more county CSV files to ingest this content into the database
    • relies on logging both to the DB and to flat files to track changes over time to voter records
    • CSVs should be ingested in chronological order from oldest to most recent
  • digest_sos.py: process the SoS daily CSV (does not yet interact with the persistent layer) to output the top 5 counties by number rejected and rejection rate. easily extended to answer specific questions, e.g. how many counties are reporting at least one rejected ballot?
  • schema.md: a description of the fields in the county CSVs, SoS CSV, and the schema defined in schema.sql

Table Parser

a demonstration using AWS (textract) to convert images of tabular data into a CSV. to run this you will need to supply your own AWS credentials and a test file converted into images. e.g. break Howard 10.08.pdf into 5 images files and use those image files as inputs to table_parser.py. early tests are promising that we can use this to convert scanned PDFs into usable data.

ballot-cure's People

Contributors

mcculleydj avatar

Watchers

James Cloos 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.