You can view the project presentation made by my friend and who we participated in Hackathon with here:
β‘οΈ View on Google Drive
This project is designed to classify and process email data stored in JSON format. It uses HTML parsing, data transformation, and optional OpenAI-based classification to organize emails into a structured format. The project includes scripts for Gmail API integration, data loading, and content transformation.
AI-powered_Mail_Classifier/
βββ another.py # π Gmail API authentication and token management
βββ gettingJson.py # π₯ Loads and parses raw email data from stuff.json
βββ json_creator.py # π Converts HTML content to plain text and saves as JSON
βββ logics.py # π€ Contains logic for processing emails, may include OpenAI
βββ mails.json # π Sample input email data
βββ newMails.json # π§ͺ Intermediate processed data
βββ stuff.json # π¦ Raw input data
βββ .gitignore # π« Git ignored files
google-authgoogle-auth-oauthlibgoogle-api-python-clientbeautifulsoup4html2text- (optional)
openai
Install them with:
pip install google-auth google-auth-oauthlib google-api-python-client beautifulsoup4 html2text openai- Make sure your email data exists in
stuff.jsonormails.json. - Run the scripts in sequence:
python gettingJson.py # Step 1: Load and clean JSON email data
python json_creator.py # Step 2: Convert HTML to text and structure it
python logics.py # Step 3: Process emails (logic or OpenAI)- Output will be saved in files like
newMails.jsonorstuff.json.
The another.py script uses Google's OAuth2 flow:
- Requires a
credentials.jsonfile from Google Cloud Console. - Generates
token.jsonafter first-time authentication. - SCOPES used include Gmail read access.
- File paths in scripts may need adjusting to your system.
- Gmail access requires manual API setup.
- OpenAI functionality in
logics.pymay be incomplete or require your API key.
Project contents derived directly from submitted source code. No external assumptions added.