This repository presents a solution where you can fetch your Google Calendar meetings, classify them and summarize them by using an AI.
To run the server.py file locally, follow these steps:
-
Clone the repository:
git clone https://github.com/your-username/google-calendar-parser.git cd google-calendar-parser -
Set up a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate` -
Install dependencies:
pip install fastapi google-auth google-auth-oauthlib google-auth-httplib2 google-api-python-client python-dotenv pytz -
Set up Google Calendar API:
- Go to the Google Cloud Console.
- Create a new project or select an existing one.
- Enable the Google Calendar API for your project.
- Create a service account and download the JSON key file.
- Rename the key file to
credentials.jsonand place it in the project root directory.
-
Configure environment variables: Create a
.envfile in the project root directory with the following content:EMAIL=your-google-calendar-email@example.com -
Run the server:
fastapi dev server.pyThe server will start running on
http://127.0.0.1:8000. -
Access the API:
- Open a web browser or use a tool like curl to access the API endpoints:
- Root endpoint:
http://127.0.0.1:8000/ - Calendar events endpoint:
http://127.0.0.1:8000/calendar-events?date=YYYY-MM-DD
- Root endpoint:
- Open a web browser or use a tool like curl to access the API endpoints:
/: Welcome message/calendar-events: Fetch and summarize calendar events- Query parameter:
date(format: YYYY-MM-DD)
- Query parameter:
Make sure to grant the necessary permissions to your service account to access your Google Calendar. You may need to share your calendar with the service account email address.