opencivicdata / python-opencivicdata

python utilities for Open Civic Data

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Model for code citations affected by Bill

showerst opened this issue · comments

A number of jurisdictions offer citations to the sections of the legal/administrative codes that bills will potentially change, or have changed. It would be nice to track this data.

We're currently storing these in a few states in "extras", but it's kind of a sloppy abstraction because extras takes a string not a list, and because of the variety of citation formats, there's not a great separator for multiple entries.

I propose something like this (the method names need some work):

bill.add_proposed_citation(
  string Citation,
  datetimeoptional Adopted_date = null,
  datetimeoptional Effective_date = null,
)

bill.add_citation(
  string Citation,
  datetimeoptional Adopted_date = null,
  datetimeoptional Effective_date = null,
)

Some sample bills that have been codified:

In these examples, in WY it would be something simpler,

bill.add_citation("CH0017", <datetime>, <datetime>)

whereas in CA it would be:

bill.add_citation("Cal. Fin. Code Ch 708 § 22202", <datetime>)
bill.add_citation("Cal. Fin. Code Ch 708 § 22250", <datetime>)
etc

Proposed citations would be similar, just for cases when it's clearly stated what the bill will modify, but it hasn't been passed yet.

Thoughts on this? I'd be willing to do the PR once new state legislative sessions cool down a bit, I just don't want to get too far down that path if it's out of scope or doesn't mesh well with other levels (municipal, etc)

RE: proposed vs final yeah this could use better naming. I've noticed that proposed doesn't match final 100% of the time (usually because of sections of a bill getting struck between versions), but it seems like for a certain subset of users "I want to look up anything in play that might change the CA financial code" would be valuable in addition to "What sections of the code did this effect after it passed?".

RE:Actual collection -- Final citations seem to pretty much always be in actions, usually something like "Chaptered. SD Code Title 3 Ch. 4" or something, OR as a separate field on the site like in WY.

Proposed seems to be all over, but they're often in either titles or summaries (like that CA example).

They're (always?) in text too but just eyeballing it extracting those looks like a gnarly workload, so maybe we just go for low hanging fruit.

https://github.com/statedecoded/law-identifier has a bunch of nice example formats of standard citation formats.

From having done this in unrelated work in the past I know it can get crazy ("sections 6-34 of title nine, excepting 11,14, and 15.5-.9") but even if we started by just grabbing for a few big states it would be worth the data model work. It might benefit the local scraper folks too, since municipal code cites tend to be cleaner.

Quick edit for good sample of proposed citations: WV