A few weeks ago, Ari Hershowitz posted on Quroa calling for a Californa code hackathon.  Since Ari was drumming up support for software developers to build state-level tools, I thought I’d see what data the Michigan government had to offer.  However, Michigan, unlike California, does not provide any bulk access to its Code.  Access to Michigan laws as codified in the Michigan Compiled Law (MCL) is only available through the Michigan legislature’s web site.  The laws displayed on this site lack hyperlinks between sections of the MCL, as well as indents to reflect subclause levels.  Even worse, someone thought it appropriate to slap a copyright on the MCL, despite the Howell v. Miller over 110 years ago.  So what are we to do?

  I decided to scrape the Michigan legislature’s index of the MCL and convert these documents into an XML copy of the code.  During the process, I also improved the underlying data by adding <cite> tags and correcting indentation as best as possible.  If you’re interested in producing a more friendly interface to the MCL or analyzing the contents of the law, you can get either a ZIP or BZ2 copy of the Code.  The XML document looks like this:

<chapter path="" id="mcl-chap1" name="Chapter 1" description="Constitution of the State of Michigan of 1963">
    <statute path="mcl-chap1" id="mcl-Constitution" name="CONSTITUTION OF MICHIGAN OF 1963" description="STATE CONSTITUTION (Article I &#167; 1 - &#167; 0)">
      <division path="mcl-chap1/mcl-Constitution" id="mcl-Constitution-I" name="CONSTITUTION-I" description="ARTICLE I DECLARATION OF RIGHTS (Article I &#167; 1...&#167; 27)">
        <section path="mcl-chap1/mcl-Constitution/mcl-Constitution-I" id="mcl-Article-I-1" name="Article I &#167; 1" description="Political power.">
          <p>All political power is inherent in the people. Government is instituted for their equal benefit, security and protection.</p>
        </section>
      </division>
    </statute>
</chapter>

  Before hacking away, remember why you came to this page.  The premise behind Ari’s call – that local, state, and federal governments should make law freely available in structured, machine-readable form – is one that Dan and I have trumpeted many times.  Despite the large number of important services and reduced costs that such data could provide, the current state of affairs is far from this goal.  If you feel strongly about this goal, please think about contributing your time to help develop software or lobby your government to make this data freely available.