Permalink
Browse files

Merge branch 'master' of https://github.com/huffingtonpost/Fech

  • Loading branch information...
2 parents 2c72181 + 1553314 commit cd6c9c7f4eb84dacf61e7aed2c3c0c1b4a1116ef @dwillis dwillis committed Nov 22, 2011
Showing with 161 additions and 4 deletions.
  1. +3 −2 README.rdoc
  2. +1 −0 lib/fech/fech_utils.rb
  3. +2 −1 lib/fech/map_generator.rb
  4. +5 −0 lib/fech/rendered_maps.rb
  5. +125 −0 sources/F3X.csv
  6. +7 −0 spec/data/753533.fec
  7. +18 −1 spec/filing_spec.rb
View
@@ -4,9 +4,9 @@
\ \_\ \ \_____\ \ \_____\ \ \_\ \_\
\/_/ \/_____/ \/_____/ \/_/\/_/
-Fech makes it easy to parse electronic presidential campaign filings[http://query.nictusa.com/pres/] and independent expenditure filings[http://www.fec.gov/finance/disclosure/ie_reports.shtml] from the Federal Election Commission. It lets you access filing attributes the same way regardless of filing version, and works as a framework for cleaning and filing data.
+Fech makes it easy to parse electronic presidential campaign filings[http://query.nictusa.com/pres/], PAC filings and independent expenditure filings[http://www.fec.gov/finance/disclosure/ie_reports.shtml] from the Federal Election Commission. It lets you access filing attributes the same way regardless of filing version, and works as a framework for cleaning and filing data.
-Fech supports several FEC form types, including all F3P (presidential filings), F5 (independent expenditures), F24 (24/48 hour notices of independent expenditures), F56 (contributions to independent expenditure committees) and F57 (expenditures by independent expenditure committees).
+Fech supports several FEC form types, including all F3P (presidential filings), F5 (independent expenditures), F24 (24/48 hour notices of independent expenditures), F56 (contributions to independent expenditure committees) F57 (expenditures by independent expenditure committees) and F3X (filings by unauthorized committees).
== News
@@ -164,6 +164,7 @@ The following row types are currently supported from filing version 3 through 8.
* F3PS
* F3S
* F3P31 (Items to be Liquidated)
+* F3X (Report of Receipts and Disbursements for Other Than an Authorized Committee)
* F24 (24/48 Hour Notice of Independent Expenditure)
* F5 (Report of Independent Expenditures Made and Contributions Received)
* F56 (Contributions for Independent Expenditures)
@@ -11,6 +11,7 @@ module FechUtils
:f3s => /^f3s/i,
:f3p31 => /^f3p31/i,
:f3ps => /^f3ps/i,
+ :f3x => /^f3x/i,
:f5 => /^f5[na]/i,
:f56 => /^f56/i,
:f57 => /^f57/i,
@@ -9,7 +9,7 @@ class MapGenerator
attr_accessor :map
FILING_VERSIONS = ["8.0", "7.0", "6.4", "6.3", "6.2", "6.1",
"5.3", "5.2", "5.1", "5.0", "3"]
- BASE_ROW_TYPES = ["HDR", "F24", "F3P", "F3P31", "F3PS", "F3S", "F5", "F56", "F57",
+ BASE_ROW_TYPES = ["HDR", "F24", "F3P", "F3P31", "F3PS", "F3S", "F3X", "F5", "F56", "F57",
"SchA", "SchB", "SchC", "SchC1", "SchC2", "SchD", "SchE",
"SchF", "TEXT"]
ROW_TYPE_MATCHERS = {
@@ -19,6 +19,7 @@ class MapGenerator
"F3S" => FechUtils::ROW_TYPES[:f3s],
"F3P31" => FechUtils::ROW_TYPES[:f3p31],
"F3PS" => FechUtils::ROW_TYPES[:f3ps],
+ "F3X" => FechUtils::ROW_TYPES[:f3x],
"F5" => FechUtils::ROW_TYPES[:f5],
"F56" => FechUtils::ROW_TYPES[:f56],
"F57" => FechUtils::ROW_TYPES[:f57],
@@ -35,6 +35,11 @@ module Fech
'^8.0|7.0|6.4|6.3|6.2|6.1' => [:form_type, :filer_committee_id_number, :date_general_election, :date_day_after_general_election, :a_total_contributions_no_loans, :b_total_contribution_refunds, :c_net_contributions, :a_total_operating_expenditures, :b_total_offsets_to_operating_expenditures, :c_net_operating_expenditures, :a_i_individuals_itemized, :a_ii_individuals_unitemized, :a_iii_individuals_total, :b_political_party_committees, :c_all_other_political_committees_pacs, :d_the_candidate, :e_total_contributions, :transfers_from_other_auth_committees, :a_loans_made_or_guarn_by_the_candidate, :b_all_other_loans, :c_total_loans, :offsets_to_operating_expenditures, :other_receipts, :total_receipts, :operating_expenditures, :transfers_to_other_auth_committees, :a_loan_repayment_by_candidate, :b_loan_repayments_all_other_loans, :c_total_loan_repayments, :a_refund_individuals_other_than_pol_cmtes, :b_refund_political_party_committees, :c_refund_other_political_committees, :d_total_contributions_refunds, :other_disbursements, :total_disbursements],
'^5.3|5.2|5.1|5.0|3' => [:form_type, :filer_committee_id_number, :a_total_contributions_no_loans, :b_total_contribution_refunds, :c_net_contributions, :a_total_operating_expenditures, :b_total_offsets_to_operating_expenditures, :c_net_operating_expenditures, :a_i_individuals_itemized, :a_ii_individuals_unitemized, :a_iii_individuals_total, :b_political_party_committees, :c_all_other_political_committees_pacs, :d_the_candidate, :e_total_contributions, :transfers_from_other_auth_committees, :a_loans_made_or_guarn_by_the_candidate, :b_all_other_loans, :c_total_loans, :offsets_to_operating_expenditures, :other_receipts, :total_receipts, :operating_expenditures, :transfers_to_other_auth_committees, :a_loan_repayment_by_candidate, nil, :c_total_loan_repayments, :a_refund_individuals_other_than_pol_cmtes, nil, nil, :d_total_contributions_refunds, :other_disbursements, :total_disbursements, :date_general_election, :date_day_after_general_election],
},
+ "^f3x" => {
+ '^8.0|7.0|6.4|6.3|6.2|6.1' => [:form_type, :filer_committee_id_number, :committee_name, :change_of_address, :street_1, :street_2, :city, :state, :zip, :report_code, :election_code, :date_of_election, :state_of_election, :coverage_from_date, :coverage_through_date, :qualified_committee, :treasurer_last_name, :treasurer_first_name, :treasurer_middle_name, :treasurer_prefix, :treasurer_suffix, :date_signed, :col_a_cash_on_hand_beginning_period, :col_a_total_receipts, :col_a_subtotal, :col_a_total_disbursements, :col_a_cash_on_hand_close_of_period, :col_a_debts_to, :col_a_debts_by, :col_a_individuals_itemized, :col_a_individuals_unitemized, :col_a_individual_contribution_total, :col_a_political_party_committees, :col_a_other_political_committees_pacs, :col_a_total_contributions, :col_a_transfers_from_aff_other_party_cmttees, :col_a_total_loans, :col_a_total_loan_repayments_received, :col_a_offsets_to_expenditures, :col_a_total_contributions_refunds, :col_a_other_federal_receipts, :col_a_transfers_from_nonfederal_h3, :col_a_levin_funds, :col_a_total_nonfederal_transfers, :col_a_total_receipts, :col_a_total_federal_receipts, :col_a_shared_operating_expenditures_federal, :col_a_shared_operating_expenditures_nonfederal, :col_a_other_federal_operating_expenditures, :col_a_total_operating_expenditures, :col_a_transfers_to_affiliated, :col_a_contributions_to_candidates, :col_a_independent_expenditures, :col_a_coordinated_expenditures_by_party_committees, :col_a_total_loan_repayments_made, :col_a_loans_made, :col_a_refunds_to_individuals, :col_a_refunds_to_party_committees, :col_a_refunds_to_other_committees, :col_a_total_refunds, :col_a_other_disbursements, :col_a_federal_election_activity_federal_share, :col_a_federal_election_activity_levin_share, :col_a_federal_election_activity_all_federal, :col_a_federal_election_activity_total, :col_a_total_disbursements, :col_a_total_federal_disbursements, :col_a_total_contributions, :col_a_total_contributions_refunds, :col_a_net_contributions, :col_a_total_federal_operating_expenditures, :col_a_total_offsets_to_expenditures, :col_a_net_operating_expenditures, :col_b_cash_on_hand_jan_1, :col_b_year, :col_b_total_receipts, :col_b_subtotal, :col_b_total_disbursements, :col_b_cash_on_hand_close_of_period, :col_b_individuals_itemized, :col_b_individuals_unitemized, :col_b_individual_contribution_total, :col_b_political_party_committees, :col_b_other_political_committees_pacs, :col_b_total_contributions, :col_b_transfers_from_aff_other_party_cmttees, :col_b_total_loans, :col_b_total_loan_repayments_received, :col_b_offsets_to_expenditures, :col_b_total_contributions_refunds, :col_b_other_federal_receipts, :col_b_transfers_from_nonfederal_h3, :col_b_levin_funds, :col_b_total_nonfederal_transfers, :col_b_total_receipts, :col_b_total_federal_receipts, :col_b_shared_operating_expenditures_federal, :col_b_shared_operating_expenditures_nonfederal, :col_b_other_federal_operating_expenditures, :col_b_total_operating_expenditures, :col_b_transfers_to_affiliated, :col_b_contributions_to_candidates, :col_b_independent_expenditures, :col_b_coordinated_expenditures_by_party_committees, :col_b_total_loan_repayments_made, :col_b_loans_made, :col_b_refunds_to_individuals, :col_b_refunds_to_party_committees, :col_b_refunds_to_other_committees, :col_b_total_refunds, :col_b_other_disbursements, :col_b_federal_election_activity_federal_share, :col_b_federal_election_activity_levin_share, :col_b_federal_election_activity_all_federal, :col_b_federal_election_activity_total, :col_b_total_disbursements, :col_b_total_federal_disbursements, :col_b_total_contributions, :col_b_total_contributions_refunds, :col_b_net_contributions, :col_b_total_federal_operating_expenditures, :col_b_total_offsets_to_expenditures, :col_b_net_operating_expenditures],
+ '^5.3|5.2|5.1|5.0' => [:form_type, :filer_committee_id_number, :committee_name, :street_1, :street_2, :city, :state, :zip, :change_of_address, :qualified_committee, :report_code, :election_code, :date_of_election, :state_of_election, :coverage_from_date, :coverage_through_date, :col_a_cash_on_hand_beginning_period, :col_a_total_receipts, :col_b_cash_on_hand_jan_1, :col_a_total_disbursements, :col_a_cash_on_hand_close_of_period, :col_a_debts_to, :col_a_debts_by, :col_a_individuals_itemized, :col_a_individuals_unitemized, :col_a_individual_contribution_total, :col_a_political_party_committees, :col_a_other_political_committees_pacs, :col_a_total_contributions, :col_a_transfers_from_aff_other_party_cmttees, :col_a_total_loans, :col_a_total_loan_repayments_received, :col_a_offsets_to_expenditures, :col_a_total_contributions_refunds, :col_a_other_federal_receipts, :col_a_transfers_from_nonfederal_h3, :col_a_total_receipts, :col_a_total_federal_receipts, :col_a_shared_operating_expenditures_federal, :col_a_shared_operating_expenditures_nonfederal, :col_a_other_federal_operating_expenditures, :col_a_total_operating_expenditures, :col_a_transfers_to_affiliated, :col_a_contributions_to_candidates, :col_a_independent_expenditures, :col_a_coordinated_expenditures_by_party_committees, :col_a_total_loan_repayments_made, :col_a_loans_made, :col_a_refunds_to_individuals, :col_a_refunds_to_party_committees, :col_a_refunds_to_other_committees, :col_a_total_refunds, :col_a_other_disbursements, :col_a_total_disbursements, :col_a_total_federal_disbursements, :col_a_total_contributions, :col_a_total_contributions_refunds, :col_a_net_contributions, :col_a_total_federal_operating_expenditures, :col_a_total_offsets_to_expenditures, :col_a_net_operating_expenditures, nil, :col_b_year, :col_b_total_receipts, :col_b_subtotal, :col_b_total_disbursements, :col_b_cash_on_hand_close_of_period, :col_b_individuals_itemized, :col_b_individuals_unitemized, :col_b_individual_contribution_total, :col_b_political_party_committees, :col_b_other_political_committees_pacs, :col_b_total_contributions, :col_b_transfers_from_aff_other_party_cmttees, :col_b_total_loans, :col_b_total_loan_repayments_received, :col_b_offsets_to_expenditures, :col_b_total_contributions_refunds, :col_b_other_federal_receipts, :col_b_transfers_from_nonfederal_h3, :col_b_total_receipts, :col_b_total_federal_receipts, :col_b_shared_operating_expenditures_federal, :col_b_shared_operating_expenditures_nonfederal, :col_b_other_federal_operating_expenditures, :col_b_total_operating_expenditures, :col_b_transfers_to_affiliated, :col_b_contributions_to_candidates, :col_b_independent_expenditures, :col_b_coordinated_expenditures_by_party_committees, :col_b_total_loan_repayments_made, :col_b_loans_made, :col_b_refunds_to_individuals, :col_b_refunds_to_party_committees, :col_b_refunds_to_other_committees, :col_b_total_refunds, :col_b_other_disbursements, :col_b_total_disbursements, :col_b_total_federal_disbursements, :col_b_total_contributions, :col_b_total_contributions_refunds, :col_b_net_contributions, :col_b_total_federal_operating_expenditures, :col_b_total_offsets_to_expenditures, :col_b_net_operating_expenditures, :treasurer_name, :date_signed, :col_a_levin_funds, :col_a_total_nonfederal_transfers, :col_a_federal_election_activity_federal_share, :col_a_federal_election_activity_levin_share, :col_a_federal_election_activity_all_federal, :col_a_federal_election_activity_total, :col_b_levin_funds, :col_b_total_nonfederal_transfers, :col_b_federal_election_activity_federal_share, :col_b_federal_election_activity_levin_share, :col_b_federal_election_activity_all_federal, :col_b_federal_election_activity_total],
+ '^3' => [:form_type, :filer_committee_id_number, :committee_name, :street_1, :street_2, :col_b_cash_on_hand_jan_1, :state, :zip, :change_of_address, :qualified_committee, :report_code, :election_code, :date_of_election, :state_of_election, :coverage_from_date, :coverage_through_date, :col_a_cash_on_hand_beginning_period, :col_a_total_receipts, :col_a_subtotal, :col_a_total_disbursements, :col_a_cash_on_hand_close_of_period, :col_a_debts_to, :col_a_debts_by, :col_a_individuals_itemized, :col_a_individuals_unitemized, :col_a_individual_contribution_total, :col_a_political_party_committees, :col_a_other_political_committees_pacs, :col_a_total_contributions, :col_a_transfers_from_aff_other_party_cmttees, :col_a_total_loans, :col_a_total_loan_repayments_received, :col_a_offsets_to_expenditures, :col_a_total_contributions_refunds, :col_a_other_federal_receipts, :col_a_transfers_from_nonfederal_h3, :col_a_total_receipts, :col_a_total_federal_receipts, :col_a_shared_operating_expenditures_federal, :col_a_shared_operating_expenditures_nonfederal, :col_a_other_federal_operating_expenditures, :col_a_total_operating_expenditures, :col_a_transfers_to_affiliated, :col_a_contributions_to_candidates, :col_a_independent_expenditures, :col_a_coordinated_expenditures_by_party_committees, :col_a_total_loan_repayments_made, :col_a_loans_made, :col_a_refunds_to_individuals, :col_a_refunds_to_party_committees, :col_a_refunds_to_other_committees, :col_a_total_refunds, :col_a_other_disbursements, :col_a_total_disbursements, :col_a_total_federal_disbursements, :col_a_total_contributions, :col_a_total_contributions_refunds, :col_a_net_contributions, :col_a_total_federal_operating_expenditures, :col_a_total_offsets_to_expenditures, :col_a_net_operating_expenditures, nil, :col_b_year, :col_b_total_receipts, :col_b_subtotal, :col_b_total_disbursements, :col_b_cash_on_hand_close_of_period, :col_b_individuals_itemized, :col_b_individuals_unitemized, :col_b_individual_contribution_total, :col_b_political_party_committees, :col_b_other_political_committees_pacs, :col_b_total_contributions, :col_b_transfers_from_aff_other_party_cmttees, :col_b_total_loans, :col_b_total_loan_repayments_received, :col_b_offsets_to_expenditures, :col_b_total_contributions_refunds, :col_b_other_federal_receipts, :col_b_transfers_from_nonfederal_h3, :col_b_total_receipts, :col_b_total_federal_receipts, :col_b_shared_operating_expenditures_federal, :col_b_shared_operating_expenditures_nonfederal, :col_b_other_federal_operating_expenditures, :col_b_total_operating_expenditures, :col_b_transfers_to_affiliated, :col_b_contributions_to_candidates, :col_b_independent_expenditures, :col_b_coordinated_expenditures_by_party_committees, :col_b_total_loan_repayments_made, :col_b_loans_made, :col_b_refunds_to_individuals, :col_b_refunds_to_party_committees, :col_b_refunds_to_other_committees, :col_b_total_refunds, :col_b_other_disbursements, :col_b_total_disbursements, :col_b_total_federal_disbursements, :col_b_total_contributions, :col_b_total_contributions_refunds, :col_b_net_contributions, :col_b_total_federal_operating_expenditures, :col_b_total_offsets_to_expenditures, :col_b_net_operating_expenditures, :treasurer_name, :date_signed],
+ },
"^f5[na]" => {
'^8.0|7.0|6.4|6.3' => [:form_type, :filer_committee_id_number, :entity_type, :organization_name, :individual_last_name, :individual_first_name, :individual_middle_name, :individual_prefix, :individual_suffix, :change_of_address, :street_1, :street_2, :city, :state, :zip, :qualified_nonprofit, :individual_employer, :individual_occupation, :report_code, :report_type, :coverage_from_date, :coverage_through_date, :total_contribution, :total_independent_expenditure, :person_completing_last_name, :person_completing_first_name, :person_completing_middle_name, :person_completing_prefix, :person_completing_suffix, :date_signed],
'^5.3' => [:form_type, :filer_committee_id_number, :committee_name, :street_1, :street_2, :city, :state, :zip, :change_of_address, :qualified_nonprofit, :individual_employer, nil, :report_code, nil, nil, nil, :coverage_from_date, :coverage_through_date, :total_contribution, :total_independent_expenditure, :person_completing_name, :date_signed, nil, nil, nil, :report_type],
Oops, something went wrong.

0 comments on commit cd6c9c7

Please sign in to comment.