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
This tutorial walks you through the process of running and deploying the Django-based application.
To work through this tutorial and the solution starter, you need the following:
- Python: The programming language, along with pip and pipenv supporting tools
- Django: A framework for web applications
- Bootstrap: A popular User Interface toolkit
- PDFminer: Extracts text from PDF
- SQlite: A simple, local database
- Postgresql: A robust, relational database
- Gunicorn: A WSGI HTTP server for Python
- Watson Natural Language Understanding
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.
It should take you approximately 30 minutes to complete this tutorial.
This tutorial focuses on deploying the solution locally. To begin:
Clone the Legit-Info Git repository.
git clone https://github.com/Call-for-Code-for-Racial-Justice/Legit-Info.git
Change to the
Legit-Infodirectory in the repository.
Install the dependencies using
Use the following command if you already have installed the dependencies and want to activate the virtual environment only.
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
cfcadminwith the password
Run the application with the following command.
./stage1 runserver localhost:3000
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.