🌐 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.
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 toviewer/public/data/
. -
A Svelte app (
viewer/
) that renders the JSON files, providing a simplestate->facility->submission
browser.
Follow these instructions to run the converter yourself.
- If the
data/raw/
directory does not already exist, create it. - Download
RMPData.sqlite
andRMPFac.sqlite
from this Google Drive folder. - Copy those two files into
data/raw/
.
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
).
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.
- 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.
Follow these instructions to modify the Svelte application.
cd viewer && npm install
The viewer is written as a Svelte app, with all relevant files in the viewer/
directory. The main source files are in viewer/src/
.
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.
File them as an issue in this repository or email Jeremy at jsvine@gmail.com.