Overview:
WODCal is an automated workout scheduling tool that simplifies the process of creating workout events on your Google Calendar. It retrieves workout descriptions from SugarWOD, determines their duration using the PaLM LLM (Language Model), and posts them as calendar events.
Features:
-
Automated Workout Scheduling: WODCal automatically generates workout events on your Google Calendar based on workout descriptions retrieved from SugarWOD.
-
Workout Duration Prediction: It utilizes the PaLM LLM (Language Model) to determine the duration of each workout based on the workout description.
-
Flexible Scheduling: You can schedule workouts for a single day or an entire week (to be implemented), depending on your needs.
-
Easy Configuration: The project is designed to be easily configured with your own settings and API keys.
Table of Contents:
To get started with WODCal, follow these steps:
- Clone the repository to your local machine.
- Install the required dependencies (see the Installation section).
- Configure the project with your API keys and settings (see the Configuration section).
- Deploy the project to your preferred cloud platform (e.g., Google Cloud Functions).
- Set up a trigger, such as a Cloud Pub/Sub topic, to invoke the WODCal function.
- Run the WODCal function to schedule your workouts automatically.
To install the required dependencies for WODCal, you'll need Python and pip installed on your machine. Use the following command to install the dependencies:
pip install -r requirements.txt
Before using WODCal, you need to configure it with your API keys and settings. Here's how:
-
Google Calendar API Credentials:
- Create a project in the Google Cloud Console.
- Enable the Google Calendar API for your project.
- Create OAuth 2.0 credentials and download the JSON file.
- Rename the JSON file to
credentials.json
and place it in the project directory.
-
Secret Manager:
- Set up Google Secret Manager and create secrets for your project.
- Configure the
get_secret
function in the code to retrieve secrets from Secret Manager.
-
SugarWOD API Key
- Go to the SugarWOD developer portal.
- Click the Create API Key button.
- Enter a name for your API key and click the Create button.
- Your API key will be displayed on the screen. Copy and save it in Secrets Manager
-
Cloud Storage (Optional):
- If you want to store token data in Cloud Storage, set up a bucket and configure the
get_bucket_data
function.
- If you want to store token data in Cloud Storage, set up a bucket and configure the
-
Machine Learning Model:
- Configure the machine learning model you want to use for workout duration prediction in the
make_time_prediction
function.
- Configure the machine learning model you want to use for workout duration prediction in the
-
Customize Settings:
- Adjust the settings in the code, such as
ACTIVE_FLAG
,CUSTOM_DATE_FLAG
,TODAY_ONLY_FLAG
,TRAINING_SESSION_START_TIME
, andTIME_BETWEEN_WODS
, to match your requirements.
- Adjust the settings in the code, such as
To use WODCal, deploy the project to a cloud platform of your choice (e.g., Google Cloud Functions) and set up a trigger to invoke the wodcal_pubsub
function. You can trigger the function manually or on a schedule.
When the function is invoked, it will automatically fetch workout descriptions from SugarWOD, determine their duration using the PaLM LLM, and create calendar events on your Google Calendar.
You can customize the scheduling behavior by adjusting the flags and settings in the code.
Contributions to WODCal are welcome! If you'd like to contribute to the project, please follow these guidelines:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and test thoroughly.
- Create a pull request with a clear description of your changes.
This project is licensed under the Apache License 2.0. Feel free to use, modify, and distribute it according to the terms of the license.
Enjoy using WODCal to simplify your workout scheduling and stay motivated on your fitness journey!
This project was part of a Google Developer Group event: Building and hosting LLM based applications using GCP serverless stack hosted at Google Pittsburgh on Thursday, September 28, 2023 Event Page Project Slides