Code Monkey home page Code Monkey logo

billtracker's Introduction

billtracker

New Mexico Bill Tracker

Track bills as they move through the New Mexico legislature's website, by scraping the nmlegis.gov website. Send alerts when a bill's status changes, e.g. when it moves to a new committee so it might be time to go to a hearing or write letters to committee members.

The project name isn't specific to New Mexico since most of the code could be extended to any state or venue that offers bill information online. I'd welcome contributions from other states or, especially, for federal bills.

Requirements

In addition to basic flask, this requires: flask-login sqlalchemy flask-migrate flask-wtf Flask-Mail dateutil xlrd

On a Debian-like system, try:

sudo apt install python3-flask-sqlalchemy python3-flask \
                 python3-flask-migrate python3-flask-login \
                 python3-flaskext.wtf python3-flask-mail \
                 python3-dateutil python3-xlrd

(or the Python 2 equivalents, if you insist, but that isn't well tested).

Most of those packages should be available. Some Debian systems may not have python3-flask-mail.

Running Locally

Run the test server locally like this:

export FLASK_APP=run_billtracker.py
flask run

When you're satisfied, use whatever production wsgi server you prefer. The FlaskNotes file in this directory has some notes I made while setting up WSGI on Apache2.

If you do use Apache2, note that apache2 by default uses the ascii encoding. If you're sure you're using a specific encoding, like UTF-8, everywhere, you can use AddDefaultCharset to change apache2's default https://httpd.apache.org/docs/2.2/en/mod/core.html#adddefaultcharset (on Debian, a good place to put this is /etc/apache2/conf-enabled/charset.conf). Or if you have multiple sites configured in apache2 and only want UTF-8 for one flask app, edit the sites-enabled file and add locale='C.UTF-8' to the WSGIDaemonProcess line. Or it might work to edit /etc/apache2/envvars and uncomment the

. /etc/default/locale

line.

Unit Tests

There are a few unit tests in the tests/ directory. Run them with:

python3 -m unittest discover

billtracker's People

Contributors

akkana avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

billtracker's Issues

RFE: search bill titles and text

Searching bill titles would be helpful when someone is looking for a bill knowing something about its title. I usually just go to the All Bills page and do find-in-page, but that might not be obvious to everybody.

Searching bill text is a lot more useful, e.g. search for every bill that has "broadband" anywhere in the text. That's harder because bill text isn't in the database, so it would require keeping an archive of the text of all bills in every session. Not clear if that's worthwhile or not.

Worth thinking about, anyway.

Display all amendments, and detect large amendments

Sometimes bills morph into something else without changing their title, like how the GIS bill morphed into a redistricting bill. It would be good to detect when amendments are as large as or larger than the bill's original text, which is probably a sign that it has morphed and should be shown in the New Bills list.

RFE: tags for bills

It's confusing to keep track of the 15 different bills that relate to a single topic, some good, some bad. It would help if I could add arbitrary tags, like broadband, healthcare, support, oppose, evil, etc. and have the billtracker display them on the home page (and maybe on other pages, as a mouseover if there's no room otherwise).

Requires database change.

RFE: Let users maintain lists of bills on a topic

E.g. someone from the Sierra Club could make a list for all environmental bills.
Must be per-session.
Should display in the allbills format, so other users could see the list and follow bills from it.

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.