Legit-Info

Concerned citizens and impacted residents often don’t have a straightforward way of knowing what or how policies and regulations impact them or what they can do in response. Searching for legislation can be complicated by the fact that each government level has their own repository, their own numbering convention, and different formats. This is where technology can help by allowing content to be centralized into a single database, in a consistent format, and readily accessible to advocates that need simple-to-read information. The Legit-Info solution starter is an effort to use technology to analyze, inform, and develop policy to reform the workplace, products, public safety, and legislation.

Legit-Info is a web-based application that is written in Python. It uses the Django framework as well as a Bootstrap user interface. Its primary goal is to help advocates find legislation they’re interested in based on their preferences for impact areas and their geographical location. The application is customizable, allowing application staff to specify the location hierarchy and impact categories.

The solution starter’s database is automatically updated weekly, combining the resources from the Legiscan.com API with government repositories. Plain text is extracted from HTML- and PDF-formatted documents, processed through the IBM Watson® Natural Language Understanding service to identify titles, summaries, locations, and impacts. The results can then be further curated to improve legibility.

The solution starter uses the following repositories to automate the collection of legislation:

  • Legiscan: API that provides links to all 50 states in the United States
  • AZLeg: Arizona state legislature website
  • Ohio.gov: Ohio state website

Learning objectives

This tutorial walks you through the process of running and deploying the Django-based application.

Prerequisites

To work through this tutorial and the solution starter, you need the following:

The following technologies are used to deploy and demonstrate the application. However, the technologies are optional because the application can run on a traditional LAMP stack bare metal server or virtual machine.

Estimated time

It should take you approximately 30 minutes to complete this tutorial.

Architecture diagram

Legit-info flow diagram

Steps

This tutorial focuses on deploying the solution locally. To begin:

  1. Clone the Legit-Info Git repository.

     git clone https://github.com/Call-for-Code-for-Racial-Justice/Legit-Info.git
    
  2. Change to the Legit-Info directory in the repository.

     cd Legit-Info
    
  3. Install the dependencies using pipenv.

     pipenv install
    
  4. Use the following command if you already have installed the dependencies and want to activate the virtual environment only.

     pipenv shell
    
  5. Run the following command to generate a default user with some pre-existing impacts and locations.

     ./stage1 loaddata cfc-seed.json
    

    This creates an admin user cfcadmin with the password Call4Code.

  6. Run the application with the following command.

     ./stage1 runserver localhost:3000
    

Summary

This project aims to educate people about different impact areas and to make laws easy to understand and digest. We hope to make this an open space for people to get legitimate law information. Contribute to the Legit-Info solution starter. All contributions are welcome.