Skip to content

data-liberation-project/epa-rmp-viewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EPA RMP Submission Viewer

🌐 data-liberation-project.github.io/epa-rmp-viewer

This repository aims to build a simple browser and viewer for raw data extracted from the EPA's Risk Management Program database, obtained by the Data Liberation Project via FOIA.

Structure

The repository consists of two main components:

  • Data extraction scripts, written in Python, in the (scripts/) directory. These convert the RMP data in the database into a JSON files — one per state, one per facility, and one per submission, plus a couple of auxiliary lookup files. The output is written to viewer/public/data/.

  • A Svelte app (viewer/) that renders the JSON files, providing a simple state->facility->submission browser.

Local Development

SQLite->JSON converter

Follow these instructions to run the converter yourself.

Copy the main RMP SQLite files into data/raw/

  • If the data/raw/ directory does not already exist, create it.
  • Download RMPData.sqlite and RMPFac.sqlite from this Google Drive folder.
  • Copy those two files into data/raw/.

Install the Python requirements

This project requires Python 3, and a few Python libraries. To install them, create a Python virtual environment (make venv) and activate it (source venv/bin/activate).

Tweak the conversion process

There are two main ways to alter the conversion process:

  • Modify the files in scripts/.
  • Edit data/manual/tablemap.json, which specifies the relationships between the tables and how they should be extracted. The structure is currently undocumented, but is hopefully somewhat clear from what is already there.

Create JSON files for each submission

  • Run make submissions to regenerate the submission JSON files.
  • Run make facilities to regenerate the facility-level and state-level files.
  • Run make lookups to regenerate the shortcude-lookup file.

Frontend

Follow these instructions to modify the Svelte application.

Install the JavaScript requirements

cd viewer && npm install

Edit the Svelte code

The viewer is written as a Svelte app, with all relevant files in the viewer/ directory. The main source files are in viewer/src/.

Licensing

This repository's code is available under the MIT License terms. The data files are available under Creative Commons' CC BY-SA 4.0 license terms.

Questions / suggestions?

File them as an issue in this repository or email Jeremy at [email protected].