Giter VIP home page Giter VIP logo

fec_results_generator's Introduction

FecResultsGenerator

A Ruby gem that takes Federal Election Commission election results as retrieved by the FecResults gem and generates JSON files in a directory structure, suitable for producting a static API. You can see an example of the data at the FecResults site.

The resulting JSON API is designed to be used as both a reference for House, Senate and Presidential election results and also as a reconciliation service for connecting results produced by state authorities with federal data such as FEC candidate ids.

Installation

Add this line to your application's Gemfile:

gem 'fec_results_generator'

And then execute:

$ bundle

Or install it yourself as:

$ gem install fec_results_generator

Usage

In irb, create an instance of the JsonGenerator class:

g = FecResultsGenerator::JsonGenerator.new(:year => 2000)
g.congress  # for congressional results
g.president # for presidential results
g.summary  # for vote totals

This will create the following directories and files:

api/2000/congress

api/2000/president

api/2000/summary

with one or more files in each. The same directories and files are created for any even-numbered year between 2000 and 2012. Some years do not have all of the data that others; those files are still generated but are empty arrays.

Contributing

  1. Fork it ( http://github.com//fec_results_generator/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

fec_results_generator's People

Contributors

dwillis 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.