New FECHell 0.1.9
[This article was first published on Offensive Politics, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
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 their blog: Offensive Politics.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.