Socket
Book a DemoInstallSign in
Socket

fec_results_generator

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fec_results_generator

bundlerRubygems
Version
0.5
Version published
Maintainers
1
Created
Source

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

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

FAQs

Package last updated on 16 Nov 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.