Mbox to CSV Template
import logging
from gunicorn.app.base import BaseApplication
from app_init import app
# IMPORT ALL ROUTES
from routes import *
# Setup logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
class StandaloneApplication(BaseApplication):
def __init__(self, app, options=None):
self.application = app
self.options = options or {}
super().__init__()
def load_config(self):
# Apply configuration to Gunicorn
for key, value in self.options.items():
if key in self.cfg.settings and value is not None:
self.cfg.set(key.lower(), value)
Created: | Last Updated:
Introduction to the Mbox to CSV Template
This template provides a web application that allows users to convert MBOX email files to CSV format and automatically upload them to Google Drive. The app requires Google OAuth authentication to access Gmail and Google Drive services.
Getting Started
- Click "Start with this Template" to begin using the template in the Lazy Builder
Initial Setup
You'll need to set up Google OAuth credentials:
- Go to the Google Cloud Console
- Create a new project or select an existing one
- Enable the Gmail API and Google Drive API for your project
- Go to "Credentials" and create OAuth 2.0 Client credentials
- Add the following to your authorized redirect URIs:
https://[your-app-url]/gmail_callback
- Copy your Client ID and Client Secret
Add these credentials as environment secrets in the Lazy Builder Environment Secrets tab:
* GOOGLE_CLIENT_ID
: Your Google OAuth client ID
* GOOGLE_CLIENT_SECRET
: Your Google OAuth client secret
Test the Application
- Click the "Test" button in the Lazy Builder interface
- The app will deploy and provide you with a server link
Using the App
- Visit the server link provided after deployment
- Click "Get Started" to begin
- Authenticate with your Google account
- Once connected, you'll see the option to upload MBOX files
- Select an MBOX file to convert
- The app will:
- Convert the MBOX file to CSV format
- Upload the resulting CSV to your Google Drive
- Display a success message with the filename
The converted CSV file will contain the following columns: * From * To * Subject * Date * Body
You can access the converted file in your Google Drive account after the conversion is complete.
Template Benefits
- Email Migration & Analysis Tool
- Enables businesses to easily convert legacy MBOX email archives into CSV format
- Perfect for companies transitioning between email systems or performing email data analysis
-
Valuable for compliance audits and historical email record management
-
Customer Communication Analytics
- Helps businesses analyze customer communication patterns from email data
- Enables extraction of valuable insights from email interactions
-
Useful for improving customer service strategies and response times
-
Sales Intelligence Platform
- Convert email correspondence into structured data for sales analysis
- Track client interactions and engagement patterns
-
Identify sales opportunities through historical email analysis
-
Compliance & Documentation Solution
- Assists in maintaining email records for regulatory compliance
- Provides easy access to historical email data in a structured format
-
Supports legal discovery and audit requirements
-
Data Integration Foundation
- Serves as a bridge between email systems and business intelligence tools
- Enables integration of email data with CRM and analytics platforms
- Supports data-driven decision making by making email data accessible and analyzable
Technologies







