A Python tool for analyzing insurance data across two time periods. It helps insurance companies validate their data, find outliers, track records coming on and going off the book, and ensure data consistency.
- Load and compare data from two time periods
- Find outliers in numeric and categorical data
- Track new and lapsed policies
- Validate business rules (dates, premiums, etc.)
- Optional LLM-based data validation using Ollama
- Generate reports in CSV, JSON, and HTML formats
pip install polars requests jinja2You'll need Ollama installed and running if you want to use the LLM validation features.
- Clone the repository
- Create these folders in your project:
data/(for your CSV files)reports/(for output)templates/(for HTML templates)
- Copy your data files to the
data/folder - Update
config.jsonwith your settings
main.py- Main script to run the analysisdata_loader.py- Handles data loading and initial validationoutlier_detector.py- Finds outliers in the datadata_comparison.py- Compares datasets and tracks changesbusiness_validator.py- Validates business rulesllm_validator.py- Optional LLM-based validationreport_generator.py- Generates reportsconfig.json- Configuration settings
-
Update
config.jsonwith your settings -
Run:
python main.py
- CSV files with detailed analysis
- JSON summary of findings
- HTML report with key metrics
- Validation results
- Lists of new and lapsed policies
- Designed for large datasets (1M+ records)
- Uses Polars for efficient data processing
- Configurable for different insurance companies
- Implementing line-by-line data comparison and generating a summary that highlights the percentage of records changed for each field. This can be enhanced further: for numerical fields, categorize changes into increases and decreases; for categorical fields, show the distribution in the previous dataset versus the current one.
- Enhancing LLM-based validation capabilities.
Feel free to open issues or submit pull requests.