MuckRock / muckrock

MuckRock's source code - Please report bugs, issues and feature requests to info@muckrock.com
https://www.muckrock.com
GNU Affero General Public License v3.0
114 stars 22 forks source link

API Feature request: "law" #1569

Open red-bin opened 6 years ago

red-bin commented 6 years ago

In getting into the nitty gritty of codifying the public records laws throughout the US, it probably makes sense to have an endpoint specifically for the laws themselves. This would then be linkable from each jurisdiction or agency. Having an endpoint like this one would probably make the "exemptions" endpoint redundant.

Potential structure:

{ 
  "law_name": "Government Records Access and Management Act",
  "law_shortname": "GRAMA",
  "top_level_jurisdiction": 230,
  "exemptions": [], //potentially remove exemptions endpoint?
  "submission_requirements": {"residency": False},
  "statute": [a[1[i]]],
  "requestable_records": ["emails", "autopsy reports", "birth certificates"]
  "required_initial_response_time": 999,
  "who_can_receive": "designated officers",
  "useful_guides": ["https://www.rcfp.org/georgia-open-government-guide"],
  "allows_digital_records": True
}
red-bin commented 6 years ago

Might get messy, but a "law_overrides" endpoint could be used for those jurisdictions/agencies that have pesky requirements.

morisy commented 6 years ago

So some of this is currently stored on the backend but not provided through the API at this moment (some fields are exposed here: https://www.muckrock.com/place/), and exposing more through the API based on the jurisdiction data should be easy if you want to take a swing at it in a pull request.

If you get it up and running locally, I think this URL will take you to see how things are structured for various states on the backend:

/admin/jurisdiction/jurisdiction/236/change/?_changelist_filters=level__exact%3Ds

Having laws live under states keeps a lot of things simpler in terms of how people want to programmatically access stuff, reduced duplication, etc. And then exemptions feed up to jurisdictions.

Having something like "requestable_records" was an approach we experimented with but in practice was just really hard to get right, which is why we switched to the tracking that kind of data via the exemption database. RCFP's Open Gov Guide did a good job with the "what is requestable" approach but so much of that hinges on definitions and interpretations and endless exceptions to the exceptions ("autopsy reporters" are available to next of kin, or maybe their available but only from a local agency, or maybe only a summary Cause of Death is available but not the full autopsy, and then multiple all of that nuance times 50 states and coming up with binary available/not available calls is a nightmare.