this project utilizes the gcsa package for google calendar integration and openai for generating event details. ensure you have an openai api key to use this functionality.
- add new events to your google calendar
- delete events from your calendar
- view existing events
- manage calendar settings
- python 3.x
- google calendar api credentials.json (oauth)
-
Create a directory called
credentialsin your project root. -
Add your
credentials.jsonfile to thecredentialsdirectory. -
Create a
.env.localfile in your project root with the following content:CREDENTIALS_PATH=/path/to/your/project/credentials/credentials.json TOKEN_PATH=/path/to/your/project/credentials/token.pickleReplace
/path/to/your/projectwith the actual path to your project directory. -
The
token.picklefile will be automatically generated when you first authenticate with Google Calendar.
Make sure to update the authenticate_calendar.py file to use these environment variables for authentication.
if you have a credentials.json (clientsecret*.json) file (see getting started), googlecalendar will read all the needed data to generate the token and refresh-token from it.
to read credentials.json (clientsecret*.json) from the default directory (~/.credentials) use:
gc = googlecalendar()run main script:
python main.pyfollow the on-screen prompts to interact with your google calendar.
main.py: entry point of the applicationadd_new_event.py: handles adding new events to the calendardelete_an_event.py: manages event deletionview_events.py: displays calendar eventssettings.py: manages calendar settings
-
Navigate to your Desktop:
cd ~/Desktop -
Create the script file:
nano run_gcal.command -
Add the following content to the file:
#!/bin/bash cd /Users/davidoh/TerminalGoogleCal/ python3 main.py -
Save and exit nano (CTRL + O, then CTRL + X)
-
Make the script executable:
chmod +x run_gcal.command
Now you can double-click the run_gcal.command file on your Desktop to launch the application.