Coder Social home page Coder Social logo

fastfec-rust's Introduction

FastFEC-rust

A machine-translated version of FastFEC using the c2rust tool.

Adaptation of FastFEC README:

A Rust program to stream and parse FEC filings, writing output to CSV.

Installation

cargo install --path .

Usage

Once FastFEC has been installed, you can run the program by calling fastfec in your terminal:

Usage: fastfec [flags] <id, file, or url> [output directory=output] [override id]
  • [flags]: optional flags which must come before other args; see below
  • <id, file, or url> is either
    • a numeric ID, in which case the filing is streamed from the FEC website
    • a file, in which case the filing is read from disk at the specified local path
    • a url, in which case the filing is streamed from the specified remote URL
  • [output directory] is the folder in which CSV files will be written. By default, it is output/.
  • [override id] is an ID to use as the filing ID. If not specified, this ID is pulled out of the first parameter as a numeric component that can be found at the end of the path/URL.

The CLI will download or read from disk the specified filing and then write output CSVs for each form type in the output directory. The paths of the outputted files are:

  • {output directory}/{filing id}/{form type}.csv

You can also pipe the output of another command in by following this usage:

[some command] | fastfec [flags] <id> [output directory=output]

Flags

The CLI supports the following flags:

  • --include-filing-id / -i: if this flag is passed, then the generated output will include a column at the beginning of every generated file called filing_id that gets passed the filing ID. This can be useful for bulk uploading CSVs into a database
  • --silent / -s : suppress all non-error output messages
  • --warn / -w : show warning messages (e.g. for rows with unexpected numbers of fields or field types that don't match exactly)
  • --no-stdin / -x: disable receiving piped input from other programs (stdin)

The short form of flags can be combined, e.g. -is would include filing IDs and suppress output.

Examples

fastfec -s 13360 fastfec_output/

  • This will run FastFEC in silent mode, download and parse filing ID 13360, and store the output in CSV files at fastfec_output/13360/.

fastfec-rust's People

Contributors

aneksteind avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

icodein

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.