Helps populate amendment information in a special annotation like this:
Haskell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
analyze
fixtures
.gitignore
LICENSE
README.md

README.md

analyze-oregon-law

A command line app, analyze, which pulls in an Oregon session law in PDF format:

image

and produces this metadata in JSON:

$ analyze 2016orLaw0001.pdf

{
    "summary": "Relating to speed limits on highways that traverse state lines; creating new provisions; amending ORS 811.111; and declaring an emergency."
    "bill": {
        "billNumber": 4047,
        "billType": "HB"
    }, 
    "effectiveDate": "2016-03-01",
    "year": 2016,
    "affectedSections": {
        "repealed": [],
        "amended": [
            "811.111"
        ]
    }
}

A Rails app then imports it to create a notice like this See Main.hs for the top-level code.

An intermediate step to improve flexibility

In the past, I've done this kind of coding in the same project as the rest of the application. E.g., here, it'd be a Ruby rake task because the app is in Rails.

But this new, separate repo decouples the data import process: instead of writing more Ruby code for my Rails app, the JSON data is a go-between format. In this way I can, e.g. use with other languages like Haskell when appropriate.