0.27.0 • Published 2 years ago

fec-parse v0.27.0

Weekly downloads
13
License
(Apache-2.0 AND M...
Repository
github
Last release
2 years ago

This is an unofficial Node.js parser for electronic filings submitted to the Federal Election Commission.

This uses code from the Fech Ruby gem by Derek Willis and others, and the csv-parser module by Mathias Buus, Max Ogden and others. It uses header mappings contributed to by many and refined by Evan Sonderegger for fecfile.

Installation

npm i fec-parse

Usage

Parse from downloaded file

wget http://docquery.fec.gov/dcdev/posted/876050.fec
import fs from "fs";
import parser from "fec-parse";

const filingId = "876050"; // Obama for America 2012 post-general report

fs.createReadStream(`${filingId}.fec`)
  .pipe(parser())
  .on("data", (row) => {
    console.log(row);
  })
  .on("error", (err) => {
    console.error(err);
  })
  .on("finish", () => {
    console.log("done");
  });

Download and parse in one

npm install --save request JSONStream
import fs from "fs";
import parser from "fec-parse";
import request from "request";
import JSONStream from "JSONStream";

const filingId = "876050";

request(`http://docquery.fec.gov/dcdev/posted/${filingId}.fec`)
  .pipe(parser())
  .pipe(JSONStream.stringify('{"rows":[\n', ",\n", "\n]}"))
  .pipe(fs.createWriteStream(`${filingId}.json`));
0.27.0

2 years ago

0.26.0

3 years ago

0.25.0

3 years ago

0.24.0

3 years ago

0.23.0

3 years ago

0.21.0

4 years ago

0.20.0

4 years ago

0.22.0

4 years ago

0.19.0

5 years ago

0.18.0

5 years ago

0.17.0

6 years ago

0.16.0

6 years ago

0.15.0

6 years ago

0.14.0

6 years ago

0.13.0

6 years ago

0.11.0

6 years ago

0.10.0

6 years ago

0.9.0

6 years ago

0.8.0

6 years ago

0.7.0

7 years ago

0.6.0

8 years ago

0.5.0

8 years ago

0.4.0

8 years ago

0.3.0

8 years ago

0.2.1-beta.2

8 years ago

0.2.1-beta.1

8 years ago

0.2.1-beta.0

8 years ago

0.2.0-beta

8 years ago