Here's a README file for your GitHub project:
The Email Categorization App automatically fetches and organizes your Gmail emails using OpenAI's GPT-3.5 model. It categorizes emails into concise groups (Security, Work, Personal, Marketing, Spam, and Other) and visualizes the data with interactive charts, making email management effortless.
- Fetches emails from your Gmail account.
- Categorizes emails into predefined groups: Security, Work, Personal, Marketing, Spam, and Other.
- Displays categorized data with interactive Bar, Doughnut, Line, and Radar charts using Chart.js.
- Responsive UI built with Flask and Bootstrap.
- Easily explore and filter emails by category.
git clone https://github.com/yourusername/email-categorization-app.git
cd email-categorization-app
pip install -r requirements.txt
-
Google API:
- Create Google API credentials (OAuth 2.0) for Gmail API access.
- Download the
cred.json
file and place it in the project folder.
-
OpenAI API:
- Add your OpenAI API key in the
app.py
file where indicated.
- Add your OpenAI API key in the
python app.py
- Open your browser and go to
http://localhost:5000
.
- app.py: The main Flask application that integrates with OpenAI and Gmail APIs.
- cred.json: Your Google API credentials for Gmail access.
- token.json: Stores the user's Gmail tokens (generated automatically after the first authentication).
- templates/index.html: The front-end HTML with responsive charts and email list.
- static/: Folder for static files such as custom CSS (optional).
- Python 3.x
- Flask
- OpenAI Python Library
- Google API Client Library
- Chart.js (loaded via CDN in the
index.html
)
Example requirements.txt
:
Flask==2.0.3
openai==0.27.0
google-auth==2.6.0
google-auth-oauthlib==0.5.0
google-api-python-client==2.33.0
- Once running, click "Fetch Emails" on the dashboard to retrieve and categorize your Gmail emails.
- The charts update automatically to show the distribution of your email categories.
- Click on any category in the charts to filter and display emails of that type.
This project is licensed under the MIT License.
Feel free to customize the sections based on your needs!