Skip to content

Kajendran2012/Project_Streamlit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 

Repository files navigation

πŸ“Š Streamlit Excel Validation & Processing App

A Streamlit-based internal tool designed to validate, clean, and split Excel data based on complex business rules related to Castle & DUNS decision logic.
This app ensures data quality, rule compliance, and standardized outputs for downstream processing.


πŸš€ Features Overview

βœ… Secure Login (Session-Based)
πŸ“€ Excel Upload & Sheet Validation
πŸ” Advanced Business Rule Validation
🧹 Column Cleanup & Standardization
πŸ“Š PH / FH Record Analysis
⬇️ CSV Export (PH, FH, or Combined)


🧱 Tech Stack

  • Python
  • Streamlit
  • Pandas
  • Excel (.xlsx) Processing

πŸ” Step 1: Login Page

  • Uses Streamlit session state for authentication
  • Prevents access unless logged in
  • Styled with custom CSS for centered UI

πŸ”’ Authentication logic can be extended to integrate real user validation


πŸ“€ Step 2: Upload Excel File

  • Accepts only .xlsx files
  • Blocks workflow until a valid file is uploaded

πŸ“„ Step 3: Sheet Selection & Preview

  • Targets a specific required sheet:

DS Feedback Template Castle 2.0


  • Displays:
  • Row & column count
  • Data preview (first few rows)

❌ Stops execution if the sheet is missing


πŸ§ͺ Step 4: Data Validation Engine (Core Logic)

πŸ”Ή Mandatory Columns Check

Ensures these columns exist and contain no missing values:

  • DS_CastleSiteDUNS_Decision
  • DS_Research_Decision
  • prtl_hrchy_flg

πŸ”Ή Business Rule Validation

βœ… Accept_Castle_Site_DUNS

  • Allowed DS_Research_Decision:
  • Accept Castle Match
  • Proposed different Site DUNS
  • prtl_hrchy_flg must be N
  • Additional mandatory DUNS fields if Proposed different Site DUNS

❌ Reject_Both

  • prtl_hrchy_flg must be Y
  • Invalid if DS_Research_Decision is:
  • Accept Castle Match
  • Proposed different Site DUNS

Special handling for:

  • No Site/Domestic/GU DUNS found
  • Proposed GU / DU / Parent DUNS scenarios

πŸ”’ DUNS Number Validation

All proposed DUNS fields must:

  • Be numeric
  • Be exactly 9 digits

Validated using reusable helper logic.


β›” Fail-Fast Design

  • Any rule violation:
  • Shows error message
  • Displays affected rows
  • Stops execution immediately

βœ”οΈ If all checks pass β†’ success message displayed


🧹 Step 5: Column Cleanup

Removes unnecessary metadata columns such as:

  • Match grades
  • Confidence codes
  • DNB hierarchy fields

βœ”οΈ Ensures final dataset contains exactly 29 columns


πŸ‘€ Step 6: Cleaned Data Preview

Displays:

  • Cleaned dataset preview
  • Row & column counts
  • Summary counts:
  • PH records (prtl_hrchy_flg = Y)
  • FH records (prtl_hrchy_flg = N)

⬇️ Step 7: Download Options

Users can download:

  • πŸ“ PH data only
  • πŸ“ FH data only
  • πŸ“ Combined PH + FH data

βœ”οΈ Custom file naming
βœ”οΈ UTF-8 encoded CSV output


🎯 Key Benefits

  • Enforces strict business rules
  • Prevents bad data from moving downstream
  • Reduces manual validation effort
  • Built for operational efficiency & audit readiness

πŸ“Œ Ideal Use Cases

  • Data Quality Validation
  • Castle vs Research Decision Reconciliation
  • DUNS Hierarchy Processing
  • Internal Ops & Analytics Teams

πŸ› οΈ Future Enhancements

  • Role-based authentication
  • Logging & audit trail
  • Config-driven rule management
  • Deployment via Streamlit Cloud / Docker

πŸ‘€ Author

KJ
Business / Data Analyst
Python β€’ SQL β€’ Power BI β€’ Streamlit


⭐ If this project helps you, consider giving it a star!

About

Upload/Cleaning/Download

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published