MA_Group_Project

Database Documentation

Overview

This documentation covers the data generation, manipulation, and schema details of the SuRFM package which utilizes an SQLite database to store and manage subscriber data and associated activities.

Data Generation

The data generation scripts use the Faker library to create realistic mock data for subscribers, activities, transactions, payment methods, RFM segmentation, retention strategies, and customer lifetime value (CLV).

Key Functions

Saving Data to CSV

Data generated from the above functions can be stored in CSV format using the save_to_csv(data, filename) function, which checks if required CSV files exist and writes data accordingly.

Database Schema

The database schema is defined using SQLAlchemy ORM and includes the following entities:

Relationships

SQL Operations

The SqlHandler class is used to manage database interactions. Key methods include:

RFM Data Handling

Additional Functionalities

Installation and Setup

Ensure all required packages are installed and Python is properly configured to interact with the SQLite database. For detailed setup instructions, refer to the main README.md of the SuRFM package.