-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
50 lines (34 loc) · 1.26 KB
/
Copy pathapp.py
File metadata and controls
50 lines (34 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import streamlit as st
import pandas as pd
from data_loader import load_controls
from pipeline import run_pipeline
st.set_page_config(page_title="GRC Toolkit", layout="wide")
st.title("GRC Compliance Automation Toolkit")
uploaded_file = st.file_uploader("Upload Control CSV", type=["csv"])
if uploaded_file:
df = load_controls(uploaded_file)
st.subheader("Raw Data")
st.dataframe(df.head())
if st.button("Run Analysis"):
results = run_pipeline(uploaded_file)
hipaa_matches = results[results["discussion"].str.contains(
r"HIPAA|164\.",
case=False,
na=False
)]
st.subheader("Summary Metrics")
col1, col2 = st.columns(2)
with col1:
st.metric("Total Controls", len(results))
with col2:
st.metric("HIPAA Matches", len(hipaa_matches))
tab1, tab2, tab3 = st.tabs(["Results", "Risk Summary", "HIPAA Matches"])
with tab1:
st.subheader("Analysis Results")
st.dataframe(results)
with tab2:
st.subheader("Risk Summary")
st.dataframe(results[["identifier", "score", "risk_level"]])
with tab3:
st.subheader("HIPAA Matches")
st.dataframe(hipaa_matches)