Coder Social home page Coder Social logo

nyt-fec's Introduction

Archived January 2024

fec

Note!

VERSION 1.1 INCLUDES BREAKING CHANGES THAT COULD LEAD TO DATA LOSS! The previous working version is tagged working If you would like to update to the current version, which supports multiple cycles, and you have data in your donors table, please update to v1.0, run the sql updates described here, and then go up to v1.1. Also strongly recommended to backup your whole database before doing any of this.

App is still kind of in the scratchpad phase, absolutely no promises that it works or I won't make breaking changes.

About

This app allows for importing and searching expenditures, independent expenditures and contributions from electronic FEC filings. It relies on the NYT's fec2json library.

Why not just use the FEC website?

The FEC website has been substantially improved recently, but it still lacks several main features we desire.

  1. It takes several days for itemizations to be processed, so it is impossible to search transactions right away
  2. There are some search fields that are important to me that do not exist in the FEC
  3. We want to be able to do more with independent expenditure summing and categorizing
  4. We want to be able to add additional data, such as our own donor ids

If you don't really need to deploy and maintain your own standalone campaign finance infrastructure, however, I recommend using tools developped by the FEC including their site, their api or their bulk data. Or use ProPublica's site or api.

Setup instructions

  1. pull this repo
  2. mkvirtualenv fec --python $(which python3)
  3. get a FEC API key here
  4. email [email protected] and ask them to upgrade you to 120 api calls per minute
  5. add the following to your $VIRTUAL_ENV/bin/postactivate:
    export DJANGO_SETTINGS_MODULE=config.dev.settings
    export fec_DB_NAME=nyt_dev_fec
    export fec_DB_USER=nyt_dev_fec
    export FEC_API_KEY=your-api-key
  6. pip install -r requirements.txt
  7. createuser -s nyt_dev_fec
  8. createdb -U nyt_dev_fec nyt_dev_fec
  9. add2virtualenv . && add2virtualenv config && add2virtualenv fec
  10. django-admin migrate

nyt-fec's People

Contributors

anniedaniel avatar dependabot[bot] avatar jayminkapish avatar jeremyjbowers avatar rshorey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nyt-fec's Issues

ies by race

we probably want a better way to look at IEs by race (maybe also fundraising).

I think we're going to need a view of some sort in order to do this, because computing the summary stats on the fly will be too slow. Basically I think I want a list of races with amounts, and then a detail page where you can see the items

amendments

make bad things not happen if amendments come in

backup scraper that hits the fec html page

we've had trouble with the api being behind. i think i'd generally like this to have this available and maybe make a management command as a suspended cron but crank it up on filing nights.

Filing list page

  • include date filed
  • make it searchable, with options to include at least:
    • committee
    • amended
    • form type
    • min raised/spent

kitty requests

  • add address search for expends
  • separate occupation and employer search on contribs

logging

ugh what I'm doing now is a terrible hack, log to datadog.

make status queue

this is currently on the filing, but we want another table for filing import status to keep clutter down and so we can also store filings we decided not to import so we don't re-download them.

pagination issues

when I paginate from a filing's expenditures, I get all expenditures.

add f24s

currently only parsing f3 type forms, add f24s, and add itemization turning off

read/write to google cloud

we are currently reading/writing to a static dir which is definitely bad, we should read/write from google cloud storages

load F5s

some IEs are coming through on F5s.

deal with pac/party cycle to date totals

I don't think we're displaying them anywhere, but that doesn't mean they should be incorrect. To fix:

  1. write method to find last odd year filing
  2. check whether incoming filing year is even or odd
  3. if odd, add cycle totals from last odd year filing to current filing totals.

show SA17s in admin

Priorities got all their money as SA17s(???), we need to be able to standardize

csv downloads

I do actually use these and would miss them, bring them back.

donor standardization

I think we want to do this through the admin

  • add donor model
  • make it possible to add donor to ScheduleA in admin via an auto-complete
  • come up with the easiest possible way to add a new donor
  • make a page that shows the top donors
  • make a donor detail page

failed filings

  • we're being inconsistent about our expectations of failed filings (we delete them with the intent to reload in one place but go looking for them in another. Fix that.
  • better error handling for unexpected fails
  • a place in the UI to see all failed filings

inaugural contribs

lots of requests to search trump inaugural contribs. This shouldn't be part of the core, but if we can one-time import and then make searchable separately, it'll be good for folks.

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.