GithubHelp home page GithubHelp logo

dawaltconley / birdog Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 0.0 380 KB

CLI for querying Congressional voting records.

Home Page: https://www.npmjs.com/package/birdog

JavaScript 99.45% Vim Script 0.55%
nodejs javascript legislation propublica propublica-congress-api propublica-api

birdog's Introduction

birdog

A simple CLI using the ProPublica database to track the voting records of members of the US Congress.

Install & configure

Install via npm:

npm i -g birdog

This app requires an API key for ProPublica's Congress database. You can request one here.

Once you have an API key, run birdog config and you will be prompted to enter it. You only need to do this once.

Run birdog --help for a full list of commands.

Pulling legislative records

The main function of this application is to compare the voting records of members of Congress on different pieces of legislation. Consider the following, using bills related to the repeal of the 2001 and 2002 Authorizations for Use of Military Force (AUMFs) as an example:

birdog records --votes hr256 hjres114-107 --cosponsors sjres10

If no congress is specified using the --congress option, birdog does its best to guess the current congress (in this case, 117). So the above command pulls voting records for the original 2002 AUMF from the 107th Congress, H.J.Res.114, and H.R.256, the most recent House bill to repeal the 2002 AUMF.

This command will also pull a list of cosponsors for S.J.Res.10, the current Senate bill to repeal the 2002 AUMF, which has not been voted on yet. It will output a csv of those records to stdout, together with info about representatives' districts and committee appointments. You can use the -f or --file option to output to a file instead.

By default, birdog will look for the most recent decisive vote on a piece of legislation; i.e. a vote to pass or a vote to table. However, you can also provide roll call numbers instead, to specify exactly which vote you want records for. birdog uses the legislative-parser script to parse both bill names and roll call numbers. You can use any string that can be parsed by that script; please refer to its documentation for more information.

Managing the cache

birdog keeps a local cache of data on members of congress, in order to minimize API requests. The records command will always check for obvious changes to membership before it pulls voting records, so it will mostly stay up to date on its own. You can also run birdog update to download new information on every member of congress; this will take longer, but will ensure that the local data is fully up-to-date.

Status

This is a very experimental version, published for testing. I may add more features and the entire API is subject to change.

To-dos

  • Convert to Typescript, probably using & contributing to the unofficial ProPublica SDK
  • Allow adding the results of a query directly to a shared database, i.e. Airtable or Google Sheets. Having a regularly-updated sheet is pretty important for legislative campaigns.
  • Distribute as executable binaries. I have started exploring options using caxa, which is probably the best bet for a JavaScript CLI. Converting this project to Deno would help to, and may be more reliable, although the file size is currently considerably larger. Finally, I could rewrite this script in Go or another language suited to binary compilation and distribution. The main barrier to that at the moment is the legislative-parser dependency, which would need to be re-written in pigeon or something similar.

birdog's People

Contributors

dawaltconley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.