feat: refactor GUI to multi-page Streamlit app with 9 tool pages
Convert single-page deduplicator into a multi-page suite. Home page shows tool card grid. Deduplicator extracted to its own page (fully working). 8 stub pages added for Text Cleaner, Format Standardizer, Missing Values, Column Mapper, Outlier Detector, Multi-File Merger, Validator & Reporter, and Pipeline Runner — each with functional file upload and coming-soon UI. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
93
src/gui/pages/8_Validator_Reporter.py
Normal file
93
src/gui/pages/8_Validator_Reporter.py
Normal file
@@ -0,0 +1,93 @@
|
||||
"""DataTools Validator & Reporter — stub page."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import streamlit as st
|
||||
|
||||
_project_root = Path(__file__).resolve().parent.parent.parent.parent
|
||||
if str(_project_root) not in sys.path:
|
||||
sys.path.insert(0, str(_project_root))
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Header
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
st.title("✅ Validator & Reporter")
|
||||
st.caption("Validate data against rules and generate quality reports.")
|
||||
|
||||
st.info("This tool is under development.")
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# What this tool will do
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
st.markdown("""
|
||||
**Features:**
|
||||
- Column-level validation rules (not null, unique, regex pattern, range, enum)
|
||||
- Cross-column validation (e.g., start_date < end_date)
|
||||
- Data quality score per column and overall
|
||||
- Generate PDF quality report
|
||||
- Generate Excel report with flagged rows highlighted
|
||||
- Summary dashboard: pass/fail counts, severity breakdown
|
||||
""")
|
||||
|
||||
st.divider()
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# File upload (functional)
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
uploaded = st.file_uploader(
|
||||
"Upload CSV or Excel file",
|
||||
type=["csv", "tsv", "xlsx", "xls"],
|
||||
help="Upload a file to preview. Processing is not yet available.",
|
||||
key="validator_file_upload",
|
||||
)
|
||||
|
||||
if uploaded is not None:
|
||||
import pandas as pd
|
||||
try:
|
||||
if uploaded.name.endswith((".xlsx", ".xls")):
|
||||
df = pd.read_excel(uploaded)
|
||||
else:
|
||||
df = pd.read_csv(uploaded)
|
||||
st.subheader(f"Preview: {uploaded.name}")
|
||||
st.caption(f"{len(df)} rows, {len(df.columns)} columns")
|
||||
st.dataframe(df.head(10), use_container_width=True)
|
||||
except Exception as e:
|
||||
st.error(f"Failed to read file: {e}")
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Placeholder options
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
st.subheader("Validation Rules")
|
||||
|
||||
st.file_uploader("Load rules file (JSON)", type=["json"], disabled=True, key="validator_rules")
|
||||
st.multiselect("Quick checks", [
|
||||
"No null values",
|
||||
"No duplicate rows",
|
||||
"All emails valid",
|
||||
"All dates parseable",
|
||||
"Numeric columns in range",
|
||||
], disabled=True)
|
||||
|
||||
st.subheader("Report Format")
|
||||
|
||||
st.selectbox("Output format", ["Excel (flagged rows)", "PDF summary", "Both"], disabled=True)
|
||||
|
||||
st.divider()
|
||||
st.button("Validate & Generate Report", type="primary", use_container_width=True, disabled=True)
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Footer
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
st.divider()
|
||||
st.caption(
|
||||
"Runs locally. Your data never leaves this computer. "
|
||||
"| DataTools v3.0"
|
||||
)
|
||||
Reference in New Issue
Block a user