fech 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +15 -1
- data/lib/fech/fech_utils.rb +4 -1
- data/lib/fech/map_generator.rb +3 -1
- data/lib/fech/rendered_maps.rb +12 -3
- data/lib/fech/version.rb +1 -1
- data/sources/F6.csv +1 -0
- data/sources/F65.csv +1 -0
- metadata +6 -4
data/README.rdoc
CHANGED
@@ -6,10 +6,14 @@
|
|
6
6
|
|
7
7
|
Fech makes it easy to parse electronic campaign filings[http://query.nictusa.com/pres/], House candidate filings, 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.
|
8
8
|
|
9
|
-
Fech supports several FEC form types, including all F1 (statements of organization), F2 (statements of candidacy), F3 (House candidate filings), F3L (contributions bundled by lobbyists) F3P (presidential filings), F4 (convention committee filings), F5 (independent expenditures),
|
9
|
+
Fech supports several FEC form types, including all F1 (statements of organization), F2 (statements of candidacy), F24 (24/48 hour notices of independent expenditures), F3 (House candidate filings), F3L (contributions bundled by lobbyists) F3P (presidential filings), F4 (convention committee filings), F5 (independent expenditures), F56 (contributions to independent expenditure committees) F57 (expenditures by independent expenditure committees), F6 (48 hour notices of contributions/loans received), F3X (filings by unauthorized committees) and F9 (electioneering communications).
|
10
|
+
|
11
|
+
Fech is an open source project of The New York Times, but contributions from anyone interested in working with F.E.C. filings are greatly appreciated.
|
10
12
|
|
11
13
|
== News
|
12
14
|
|
15
|
+
* March 10, 2012: Version 0.9.4 released. Added support for F6 filings.
|
16
|
+
* March 8, 2012: Version 0.9.3 released. Bug-fix for F2 & F24 mappings.
|
13
17
|
* Feb. 29, 2012: Version 0.9.2 released. Bug-fix for F3 mappings, added filing comparison class.
|
14
18
|
* Feb. 21, 2012: Versions 0.9.0, 0.9.1 released. Added support for alternative CSV Parsers, F4 filings.
|
15
19
|
* Feb. 19, 2012: Version 0.8.2 released. Added layouts for F1M and F2 filings.
|
@@ -237,6 +241,8 @@ The following row types are currently supported from filing version 3 through 8.
|
|
237
241
|
* F5 (Report of Independent Expenditures Made and Contributions Received)
|
238
242
|
* F56 (Contributions for Independent Expenditures)
|
239
243
|
* F57 (Independent Expenditures)
|
244
|
+
* F6 (48 Hour Notice of Contributions/Loans Received)
|
245
|
+
* F65 (Contributions for 48 Hour Notices)
|
240
246
|
* F9 (Electioneering Communications, first appeared in filing version 5.0)
|
241
247
|
* F91 (Lists of Persons Exercising Control)
|
242
248
|
* F92 (Contributions for Electioneering Communications)
|
@@ -251,6 +257,14 @@ The following row types are currently supported from filing version 3 through 8.
|
|
251
257
|
* SE (Independent Expenditures)
|
252
258
|
* SF (Coordinated Expenditures)
|
253
259
|
|
260
|
+
== How to contribute
|
261
|
+
|
262
|
+
Fech's goal is to provide support for all electronically filed forms and their row types, so contributors can pick an form type that is currently unsupported and try to implement it. For entirely new form types, please include specs showing successful parsing of the summary. A good way to start is to look at the mappings for a similar form type. Please note that Fech currently commits to supporting the F.E.C.'s filing formats back to version 3.0, where applicable.
|
263
|
+
|
264
|
+
Bug reports and feature requests are welcomed by submitting an Issue. Please be advised that development is focused on parsing filings, which may contain errors or be improperly filed, and not on providing wrappers or helper methods for working with filings in another context.
|
265
|
+
|
266
|
+
To get started, fork the repo, make your additions or changes and send a pull request.
|
267
|
+
|
254
268
|
== Authors
|
255
269
|
|
256
270
|
Michael Strickland, michael.strickland@nytimes.com
|
data/lib/fech/fech_utils.rb
CHANGED
@@ -3,7 +3,8 @@
|
|
3
3
|
module FechUtils
|
4
4
|
|
5
5
|
# All supported row types pointed to regular expressions that will correctly
|
6
|
-
# match that row type in the wild.
|
6
|
+
# match that row type in the wild. If multiple matches exist, Fech will match
|
7
|
+
# the longest regex pattern found.
|
7
8
|
ROW_TYPES = {
|
8
9
|
:hdr => /^hdr$/i,
|
9
10
|
:f1 => /^f1/i,
|
@@ -21,6 +22,8 @@ module FechUtils
|
|
21
22
|
:f5 => /^f5[na]/i,
|
22
23
|
:f56 => /^f56/i,
|
23
24
|
:f57 => /^f57/i,
|
25
|
+
:f6 => /^f6[^5]/i,
|
26
|
+
:f65 => /^f65/i,
|
24
27
|
:f7 => /^f7[na]/i,
|
25
28
|
:f76 => /^f76/i,
|
26
29
|
:f9 => /^f9/i,
|
data/lib/fech/map_generator.rb
CHANGED
@@ -10,7 +10,7 @@ module Fech
|
|
10
10
|
FILING_VERSIONS = ["8.0", "7.0", "6.4", "6.3", "6.2", "6.1",
|
11
11
|
"5.3", "5.2", "5.1", "5.0", "3"]
|
12
12
|
BASE_ROW_TYPES = ["HDR", "F1", "F1M", "F2", "F24", "F3", "F3L", "F3P", "F3P31", "F3PS", "F3S", "F3X",
|
13
|
-
"F4", "F5", "F56", "F57", "F7", "F76", "F9", "F91", "F92", "F93", "F94", "F99",
|
13
|
+
"F4", "F5", "F56", "F57", "F6", "F65", "F7", "F76", "F9", "F91", "F92", "F93", "F94", "F99",
|
14
14
|
"SchA", "SchB", "SchC", "SchC1", "SchC2", "SchD", "SchE",
|
15
15
|
"SchF", "TEXT"]
|
16
16
|
ROW_TYPE_MATCHERS = {
|
@@ -30,6 +30,8 @@ module Fech
|
|
30
30
|
"F5" => FechUtils::ROW_TYPES[:f5],
|
31
31
|
"F56" => FechUtils::ROW_TYPES[:f56],
|
32
32
|
"F57" => FechUtils::ROW_TYPES[:f57],
|
33
|
+
"F6" => FechUtils::ROW_TYPES[:f6],
|
34
|
+
"F65" => FechUtils::ROW_TYPES[:f65],
|
33
35
|
"F7" => FechUtils::ROW_TYPES[:f7],
|
34
36
|
"F76" => FechUtils::ROW_TYPES[:f76],
|
35
37
|
"F9" => FechUtils::ROW_TYPES[:f9],
|
data/lib/fech/rendered_maps.rb
CHANGED
@@ -85,6 +85,15 @@ module Fech
|
|
85
85
|
'^5.3|5.2|5.1|5.0' => [:form_type, :filer_committee_id_number, :entity_type, :payee_name, :payee_street_1, :payee_street_2, :payee_city, :payee_state, :payee_zip, :expenditure_purpose_descrip, :expenditure_date, :expenditure_amount, :support_oppose_code, :candidate_id_number, :candidate_name, :candidate_office, :candidate_state, :candidate_district, nil, nil, nil, nil, nil, nil, :conduit_name, :conduit_street_1, :conduit_street_2, :conduit_city, :conduit_state, :conduit_zip, nil, :transaction_id_number, :category_code, :expenditure_purpose_code, :calendar_y_t_d_per_election_office, :election_code, :election_other_description],
|
86
86
|
'^3' => [:form_type, :filer_committee_id_number, :entity_type, :payee_name, :payee_street_2, nil, :payee_city, :payee_state, :payee_zip, :expenditure_purpose_descrip, :expenditure_date, :expenditure_amount, :support_oppose_code, :candidate_id_number, :candidate_name, :candidate_office, :candidate_state, :candidate_district, nil, nil, nil, nil, nil, nil, :conduit_name, :conduit_street_1, :conduit_street_2, :conduit_city, :conduit_state, :conduit_zip, :amended_code],
|
87
87
|
},
|
88
|
+
"^f6[^5]" => {
|
89
|
+
'^7.0|6.4|6.3|6.2|6.1' => [:form_type, :filer_committee_id_number, nil, :committee_name, :street_1, :street_2, :city, :state, :zip, :candidate_id_number, :candidate_last_name, :candidate_first_name, :candidate_middle_name, :candidate_prefix, :candidate_suffix, :candidate_office, :candidate_state, :candidate_district, :signer_last_name, :signer_first_name, :signer_middle_name, :signer_prefix, :signer_suffix, :date_signed],
|
90
|
+
'^5.3|5.2|5.1|5.0|3.0' => [:form_type, :filer_committee_id_number, :committee_name, :street_1, :street_2, :city, :state, :zip, :candidate_id_number, :candidate_name, :candidate_office, :candidate_state, :candidate_district, :date_signed],
|
91
|
+
'^8.0' => [:form_type, :filer_committee_id_number, :original_amendment_date, :committee_name, :street_1, :street_2, :city, :state, :zip, :candidate_id_number, :candidate_last_name, :candidate_first_name, :candidate_middle_name, :candidate_prefix, :candidate_suffix, :candidate_office, :candidate_state, :candidate_district, :signer_last_name, :signer_first_name, :signer_middle_name, :signer_prefix, :signer_suffix, :date_signed],
|
92
|
+
},
|
93
|
+
"^f65" => {
|
94
|
+
'^5.3|5.2|5.1|5.0|3.0' => [:form_type, :filer_committee_id_number, :entity_type, :contributor_name, :contributor_street_1, :contributor_street_2, :contributor_city, :contributor_state, :contributor_zip, :contributor_employer, :contributor_occupation, :contribution_date, :contribution_amount, :contributor_fec_id, :candidate_id, :candidate_name, :candidate_office, :candidate_state, :candidate_district, :conduit_name, :conduit_street_1, :conduit_street_2, :conduit_city, :conduit_state, :conduit_zip, nil, :transaction_id],
|
95
|
+
'^8.0|7.0|6.4|6.3|6.2|6.1' => [:form_type, :filer_committee_id_number, :transaction_id, :entity_type, :contributor_organization_name, :contributor_last_name, :contributor_first_name, :contributor_middle_name, :contributor_prefix, :contributor_suffix, :contributor_street_1, :contributor_street_2, :contributor_city, :contributor_state, :contributor_zip, :contributor_fec_id, :contribution_date, :contribution_amount, :contributor_employer, :contributor_occupation],
|
96
|
+
},
|
88
97
|
"^f7[na]" => {
|
89
98
|
'^5.3|5.2|5.1|5.0|3.0' => [:form_type, :filer_committee_id_number, :organization_name, :street_1, :street_2, :city, :state, :zip, :organization_type, :report_code, :election_date, :election_state, :coverage_from_date, :coverage_through_date, :total_costs, :person_designated_name, :date_signed, :person_designated_title],
|
90
99
|
'^8.0|7.0|6.4|6.3|6.2|6.1' => [:form_type, :filer_committee_id_number, :organization_name, :street_1, :street_2, :city, :state, :zip, :organization_type, :report_code, :election_date, :election_state, :coverage_from_date, :coverage_through_date, :total_costs, :person_designated_last_name, :person_designated_first_name, :person_designated_middle_name, :person_designated_prefix, :person_designated_suffix, :person_designated_title, :date_signed],
|
@@ -120,9 +129,9 @@ module Fech
|
|
120
129
|
'^8.0|7.0|6.4|6.3|6.2|6.1' => [:form_type, :filer_committee_id_number, :transaction_id, :back_reference_tran_id_number, :back_reference_sched_name, :candidate_id_number, :candidate_last_name, :candidate_first_name, :candidate_middle_name, :candidate_prefix, :candidate_suffix, :candidate_office, :candidate_state, :candidate_district, :election_code, :election_other_description],
|
121
130
|
},
|
122
131
|
"^f99" => {
|
123
|
-
'^5.3|5.2|5.1|5.0' => [:form_type, :filer_committee_id_number, :committee_name, :street_1, :street_2, :city, :state, :zip, :treasurer_name, :date_signed, :text_code],
|
124
|
-
'^8.0|7.0|6.4|6.3|6.2|6.1' => [:form_type, :filer_committee_id_number, :committee_name, :street_1, :street_2, :city, :state, :zip, :treasurer_last_name, :treasurer_first_name, :treasurer_middle_name, :treasurer_prefix, :treasurer_suffix, :date_signed, :text_code],
|
125
|
-
'^3' => [:form_type, :filer_committee_id_number, :committee_name, :street_1, :street_2, :city, :state, :zip, :treasurer_name, :date_signed],
|
132
|
+
'^5.3|5.2|5.1|5.0' => [:form_type, :filer_committee_id_number, :committee_name, :street_1, :street_2, :city, :state, :zip, :treasurer_name, :date_signed, :text_code, :text],
|
133
|
+
'^8.0|7.0|6.4|6.3|6.2|6.1' => [:form_type, :filer_committee_id_number, :committee_name, :street_1, :street_2, :city, :state, :zip, :treasurer_last_name, :treasurer_first_name, :treasurer_middle_name, :treasurer_prefix, :treasurer_suffix, :date_signed, :text_code, :text],
|
134
|
+
'^3' => [:form_type, :filer_committee_id_number, :committee_name, :street_1, :street_2, :city, :state, :zip, :treasurer_name, :date_signed, :text],
|
126
135
|
},
|
127
136
|
"^sa" => {
|
128
137
|
'^5.0' => [:form_type, :filer_committee_id_number, :entity_type, :contributor_name, :contributor_street_1, :contributor_street_2, :contributor_city, :contributor_state, :contributor_zip, :election_code, :election_other_description, :contributor_employer, :contributor_occupation, :contribution_aggregate, :contribution_date, :contribution_amount, :contribution_purpose_code, :contribution_purpose_descrip, :donor_committee_fec_id, :donor_candidate_fec_id, :donor_candidate_name, :donor_candidate_office, :donor_candidate_state, :donor_candidate_district, :conduit_name, :conduit_street1, :conduit_street2, :conduit_city, :conduit_state, :conduit_zip, :memo_code, :memo_text_description, nil, :transaction_id, :back_reference_tran_id_number, :back_reference_sched_name, :reference_code, :increased_limit_code],
|
data/lib/fech/version.rb
CHANGED
data/sources/F6.csv
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
canonical,^8.0,,^7.0|6.4|6.3|6.2|6.1,,^5.3|5.2|5.1|5.0|3.0,
|
data/sources/F65.csv
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
canonical,^8.0|7.0|6.4|6.3|6.2|6.1,,^5.3|5.2|5.1|5.0|3.0,
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fech
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 51
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 4
|
10
|
+
version: 0.9.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael Strickland
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2012-03-
|
20
|
+
date: 2012-03-10 00:00:00 -05:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
@@ -193,6 +193,8 @@ files:
|
|
193
193
|
- sources/F5.csv
|
194
194
|
- sources/F56.csv
|
195
195
|
- sources/F57.csv
|
196
|
+
- sources/F6.csv
|
197
|
+
- sources/F65.csv
|
196
198
|
- sources/F7.csv
|
197
199
|
- sources/F76.csv
|
198
200
|
- sources/F9.csv
|