New FECHell 0.1.9

March 22, 2010
By

(This article was first published on Offensive Politics, and kindly contributed to R-bloggers)

Our FEC report file library FECHell has been updated to 0.1.9. The release includes a half dozen bug fixes and the following new features:

  • Speed improvements – Schedule and field names names are matched by compiled regular expressions instead of brute-force string matching, resulting in a ~25% speed increase for large files.
  • DEF file fixes – The field definition files FECHell uses have been heavily updated to remove bad fields and standardize field names for most schedules
  • FECForm library – FECHell now includes an optional library called FECForm. FECHell returns an hash indexed by field names. This is problematic because field names are case sensitive, version dependent, and some field names are difficult to understand. FECForm tries to alleviate some of these issues by providing a consistent interface for one form (F3) and several schedules (SA,SB,SC,SC1) using named parameters. This is especially helpful when parsing very old FEC files where name and address components were delimited by a ^ instead of being an individual field, COMMITTEE was called CMTTE, etc.
    Example:

    fec_version, original_form_type, form_type, values = h.header_lines("12345.fec")
    # old way 5.2-6.4
    puts "Committee: #{values['COMMITTEE NAME']}"
    # old way 3.0-5.1
    puts "Committee: #{values['FILER NAME']}"
    # new way
    f = FECForm.schedule_for(form_type, fec_version, values)
    puts "For: #{f.committee_name}"

    Other major forms (F3X,F1,F2,F6) are in progress, as are the outstanding schedules (SC2).

  • Monolithic unit tests – FECHell / FECForms finally comes with some unit tests! An example file for every form and every schedule, for every supported version, is included in the distribution. Tests are included for every form and field supported by FECForms.

Visit the FECHell page for more information, installation instructions, and more examples.

To leave a comment for the author, please follow the link and comment on his blog: Offensive Politics.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags: , ,

Comments are closed.