Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including fec2csv with all npm packages installed. Try it out:

var fec2csv = require("fec2csv")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

fec2csv v0.1.0

A CLI tool to take an FEC filing and turn it into a bunch of CSVs.

FEC fillings to CSV

A small CLI tool to take a .fec filing and turn it into a collection of CSVs, one for each form type.

Installation & usage

$ npm install -g fec2csv $ fec2csv path/to/file.fec path/to/output/dir

fec2csv expects at least one argument but can take two. The first one, which is required, is the path to the .fec source file. The second, which is optional, is the path to the directory where fec2csv should put the generated files. This will default to the current directory (.).

Motivation

This tool creates nice CSV files out of those files to do analysis quickly. The FEC publishes .fec files really quickly, but they're sort of hard to use. First, the .fec file isn't actually a rectangular table. It is a single file with all of the different types of FEC submissions combined into table.

Credits

The work horse of this tool is fec-parser by @chriszs, which in turn uses code from the Fech Ruby gem by Derek Willis and others, and the csv-parser module by Mathias Buus, Max Ogden and others.

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free