A skill for Opsdroid that connects to your Google Calendar to display
- Your upcoming events
- Your events for a specific day
Use this as a foundation for creating more Google Calendar skills, such as adding new events, and more!
- Have a Google account with Google Calendar enabled.
- Create your Google Cloud project. Follow the steps you will see here
- Enable the API on your Google Cloud project.
- Configure the OAuth consent screen:
- In the Google Cloud console, go to Menu menu > APIs & Services > OAuth consent screen.
- For User type select Internal, then click Create.
- Complete the app registration form, then click Save and Continue.
- For now, you can skip adding scopes and click Save and Continue. In the future, when you create an app for use outside of your Google Workspace organization, you must change the User type to External, and then, add the authorization scopes that your app requires.
- Review your app registration summary. To make changes, click Edit. If the app registration looks OK, click Back to Dashboard.
- Authorize credentials for a desktop application
- In the Google Cloud console, go to Menu menu > APIs & Services > Credentials.
- Click Create Credentials > OAuth client ID.
- Click Application type > Desktop app.
- In the Name field, type a name for the credential. This name is only shown in the Google Cloud console.
- Click Create. The OAuth client created screen appears, showing your new Client ID and Client secret.
- Click OK. The newly created credential appears under OAuth 2.0 Client IDs.
- Save the downloaded JSON file as credentials.json, and move the file to your working directory.
- Install the Google client library
pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
googlecalendar:
path: # your local path to __init__.py
creds_path: # your path to credentials.json
user: What are the upcoming 2 events?
Opsdroid: Your two upcoming events are:
At Tuesday 11 June 2024-13:30-14:30 you have Yoga Session.
At Wednesday 12 June 2024-16:00-17:00 you have Meeting with partners.
Opsdroid: Events on Wednesday 10 July 2024:
At 16:00-17:00 you have Doctor Appointment.
At 22:00-23:00 you have Meeting at work.