This project uses the OpenAI API for performing sentiment analysis on emails and integrates the Calendly API for efficient event management. It also uses Docker for containerization and PostgreSQL as the database, providing a robust and scalable solution for automating sentiment analysis and event scheduling.
- Sentiment Analysis : Uses OpenAI API to analyze sentiment from email content.
- Event Management: Integrates Calendly API for scheduling and managing events.
- Containerized Deployment : Docker setup for easy deployment.
- Database Management : Uses PostgreSQL to store and manage email and event data.
- Python
- VS code
- PostgresSQL
- Docker
- OpenAI API Key
- FastAPI
- Pydantic
- Sqlalchemy
- Calendly
1. Clone this repository:
# Clone the repository
git clone https://github.com/prernarohra/Email-Sentiment-Analysis.git
# Navigate to the project directory
cd Email-Sentiment-Analysis
2. Create a .env file in the root directory to securely store your API keys and email credentials:
touch .env
3. In the .env file, replace YOUR_OPENAI_API_KEY and YOUR_CALENDLY_API_KEY with your respective API keys and configure your email credentiatls:
OPENAI_API_KEY=YOUR_OPENAI_API_KEY
CALENDLY_API_KEY=YOUR_CALENDLY_API_KEY
USERNAME=YOUR_EMAIL_USERNAME
PASSWORD=YOUR_EMAIL_PASSWORD
4. Start Docker and build the application container:
docker-compose up --build
-
Set Up Environment Variables: Ensure the .env file has the correct API keys for OpenAI and Calendly and correct credentials.
-
Run the Application : Once the Docker container is up, the app will start, and you can access it through http://localhost:8000 (or your specified port).
-
Sentiment Analysis: The application will process emails and return sentiment analysis using the OpenAI API.
-
Event Scheduling: Use the Calendly integration to manage events directly within the application.
-
API Key Replacement:
- OpenAI API Key: Replace YOUR_OPENAI_API_KEY in the .env file.
- Calendly API Key: Replace YOUR_CALENDLY_API_KEY in the .env file.
- Postgresql Database URL: Replace postgresql://username:password@localhost:5432/your-database with your username, password of the server and your database name.
Make sure to restart the Docker container after making any updates to the .env file to apply the new keys.
If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.
This project is open-source and available under the MIT License.