-
Notifications
You must be signed in to change notification settings - Fork 1
.fec File Format
.fec files are used to transmit forms to the US Federal Elections Commission (FEC). Most commonly they are financial reports such as the itemized sources of income and expenditures for committees, but they could also be registration forms, or something else.
There are many versions of the .fec format, going back to before the year 2000. The FEC provides technical documentation on the format. This document serves to augment that, summarizing it and describing the differences between the various formats, so that you can understand how to make a parser that can read a range of versions.
An .fec file consists of 3 sections: A Header, A Cover Record, and 0 or more Itemization Records
The header is the first section. It contains metadata on the .fec file itself:
- The .fec format version, such as "8.4". This is essential for the rest of the parsing, because it determines the schemas used later on.
- The name of the software that created the .fec file, and possibly the version.
- If this .fec file is an amendment to a previous filing, the filing number of the original and which number amendement this is (1, 2, 3 etc)
The structure can be in one of two formats, I'll call them "legacy" and "nonlegacy".
/* Header
FEC_Ver_# = 2.02
Soft_Name = FECfile
Soft_Ver# = 3
Dec/NoDec = DEC
Date_Fmat = CCYYMMDD
NameDelim = ^
Form_Name = F3XA
FEC_IDnum = C00101766
Committee = CONTINENTAL AIRLINES INC EMPLOYEE FUND FOR A BETTER AMERICA (FKA CONTINENTAL HOLDINGS PAC)
Control_# = K245592Q
Schedule_Counts:
SA11A1 = 00139
SA17 = 00001
SB23 = 00008
SB29 = 00003
/* End Header
As you can see, legacy headers contain some additional information such as the name of the form and the committee that filed the filing. In non-legacy versions, this extra info was moved out of the header and into the next section, the Cover record
These look like a row of a CSV file. Versions older than 6.1 use commas (,
) as the delimiter. Versions 6.1 and later use the ASCII "field separator" value, a byte with the hex value 0x1C
, which is 28 in decimal. We call this character ascii28 to be clear.
The header might look like the following (with ascii28 replaced with π so you can see them, because ascii28 does not render as anything in many programs.)
HDRπFECπ8.3πNGPπ8πππ
In older versions, the 2nd value of "FEC" isn't present:
HDR,8.1,NGP,8,,,
Note that unlike in the legacy header, here the format isn't self-describing: each value is not labeled with what field it represents. And this changes depending on the .fec format version. So, we have to look up the schema separately using the version number. Currently, in feco3 we have a .json file that holds this schema information.
After the header comes a Cover Record. This contains summary information on the filing. This is a single line, in the same CSV-like format as the non-legacy header. Again, the schema varies depending on the version, so we have to look up the schema separately using the version.
Example:
F3AπC00792689πBrice Wiggins for CongressππPO Box 1611ππOcean SpringsπMSπ39566πMSπ04πYEππππ20211001π20211231πFeidtπWilliamππππ20220307π126691.07π0.00π126691.07π3510.80π0.00π3510.80π123180.27π0.00π0.00π114649.00π4702.00π119351.00π0.00π7240.07π100.00π126691.07π0.00π0.00π0.00π0.00π0.00π0.00π126691.07π3510.80π0.00π0.00π0.00π0.00π0.00π0.00π0.00π0.00π0.00π3510.80π0.00π126691.07π126691.07π3510.80π123180.27π126691.07π0.00π126691.07π3510.80π0.00π3510.80π114649.00π4702.00π119351.00π0.00π7240.07π100.00π126691.07π0.00π0.00π0.00π0.00π0.00π0.00π126691.07π3510.80π0.00π0.00π0.00π0.00π0.00π0.00π0.00π0.00π0.00π3510.80
Interpretation:
- The form code (
F3A
) - The filing committee (
C00792689
andBrice Wiggins for Congress
) - The address of that committee
- The date of the filing
- (in some versions) the name of the person filing
- (in some versions) summary info on the following itemization records, such as number of itemizations, sum of the receipt amounts, etc
There are 0 or more itemization records. Each record is a single CSV-like row as described in the Non-Legacy Header.
Example:
SA11AIπC00792689πSA11AI.4286πππINDππAlfonsoπCarleneππππ5352 Red Creek RoadππLong BeachπMSπ39560πP2022ππ20211229π2900.00π2900.00ππColdwell Banker Alfonso RealtyπOwnerππππππππππππππππππππ
The first value in each record is the record type, such as "SA11AI". This is composed of two parts:
- "SA" refers to one of the Schedules. One of "SA", "SB", "SC", or "SD".
- "11AI" the line number within that schedule.
The rest of the values in the record represent different things. Again, we have to look up the schema based on the .fec file version and the record type. In this example, this contains:
- The receiving committee id ("C00792689")
- The type of contributor ("IND", meaning individual)
- The name of the contributor ("Alfonso Carlene")
- Their address ("5352 Red Creek Road,Long Beach,MS,39560")
- Their occupation and employer ("Owner, Coldwell Banker Alfonso Realty")
- The contribution amount and date ($2900, 2021-12-29)
- Some other stufff