A robust, Python-based auditing engine designed to process large-scale CSV transaction data β implementing dynamic column detection and professional error logging.
- π¬ Demo
- π· Overview
- β Core Features
- π§ Technical Implementation
- βοΈ How It Works
- π‘ Use Cases
- π Project Structure
- π How to Use
- πΊοΈ Future Roadmap
- π€ Author
| Demo | Platform | Watch |
|---|---|---|
| π₯ Live Demo Video | Repo (mp4) | βΆ Watch in Repo |
| πΌ LinkedIn Demo | βΆ Watch on LinkedIn |
Universal Data Auditor is a professional Python tool that moves away from hardcoded scripts by implementing dynamic column detection and production-grade error logging for large-scale CSV transaction data.
π CSV File β π Dynamic Column Detection β β
Validate β π Log Errors β π Summary Report
No manual code changes needed for different file structures β the auditor adapts automatically.
| Feature | Description |
|---|---|
| π Dynamic Column Detection | Automatically identifies file structure from the header. Adapts to any number of columns without manual code changes. |
| β Business Logic Validation | Implements strict data integrity rules. Transactions with zero or negative values are caught using custom ValueError raises. |
| π Production-Grade Logging | All anomalies, missing columns, and validation failures recorded in production_audit.log for post-audit analysis. |
| π§© Modular Architecture | Built as a standalone function β easy to integrate into larger automation workflows or CI/CD pipelines. |
The script uses a try-except block to ensure the entire process doesn't crash due to a single corrupted row. By using if amount <= 0: raise ValueError, the system separates standard data-type errors from specific business-rule violations.
try:
if amount <= 0:
raise ValueError(f"Invalid amount: {amount}")
except ValueError as e:
logging.warning(f"Row {row_num} skipped β {e}")The auditor reads files line-by-line using enumerate(file), ensuring low memory consumption even when processing files with 10,000+ rows.
with open(file_path, 'r') as file:
for row_num, line in enumerate(file):
# Process one row at a time β no full file loadββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β UNIVERSAL DATA AUDITOR β PIPELINE β
β β
β π CSV File Input β
β β β
β βΌ β
β π Dynamic Column Detection β
β β’ Read header row automatically β
β β’ Map columns β no hardcoding needed β
β β β
β βΌ β
β π Row-by-Row Processing (enumerate) β
β β’ Low memory β reads line by line β
β β’ Handles 10,000+ rows efficiently β
β β β
β βΌ β
β β
Business Logic Validation β
β βββ Amount β€ 0 β raise ValueError β Log & Skip β
β βββ Missing column β Log warning β Continue β
β βββ Corrupted row β try-except catches β Log & Skip β
β β β
β βΌ β
β π production_audit.log β Full Error Record β
β β β
β βΌ β
β π Console Summary Report β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Use Case | How It Helps |
|---|---|
| π’ Business Transaction Auditing | Validate thousands of daily transactions automatically |
| π Data Quality Checks | Catch corrupted, missing, or invalid rows before they cause problems |
| π CI/CD Data Pipeline Validation | Integrate as a modular function in automated pipelines |
| π Compliance & Reporting | Generate production-grade audit logs for regulatory needs |
| π CSV Data Cleaning | Pre-process large datasets before analysis or import |
universal-data-auditor/
β
βββ main.py # Primary auditing engine β dynamic logic & validation rules
βββ audit.log # System-generated log β tracks all data discrepancies
βββ company_big_data.csv # Sample large-scale CSV dataset for testing
βββ 2026-03-25 20-59-39.mp4 # Live demo video
βββ README.md # Project documentation
| File | Description |
|---|---|
main.py |
The primary auditing engine containing the dynamic logic and validation rules |
audit.log |
Example of the system-generated log file tracking data discrepancies |
company_big_data.csv |
Sample CSV dataset with large-scale transaction data |
- β Python 3.11+
- β No external libraries required β uses Python standard library only
# 1. Clone this repository
git clone https://github.com/muhammadantor/universal-data-auditor
# 2. Navigate into the project
cd universal-data-auditor
# 3. Generate sample data
python data_creator.py
# 4. Run the auditor
python main.py
# 5. Review results
# β Console: summary report
# β audit.log: full breakdown of skipped or failed rows- Add support for Excel (.xlsx) and JSON formats
- Integrate automated PDF report generation for audit summaries
- Add a CLI (Command Line Interface) for easier file path input
