Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Simplify Calendar Alarm Creation

License

NotificationsYou must be signed in to change notification settings

dashinja/CalarmHelp

Repository files navigation

Why

Perhaps you like to use google calendar to time block both events and tasks - however you find the 'notifications' from those calendar events to be lack luster. It just doesn't get your attention enough to be in your face, and thus actionable.

Perhaps then you'd like to supplement each calendar event with a separate alarm - which also means double work.

Then maybe you found an alarm application like (AMDroid on Android devices) which can look at selected calendars for tags of a given name (i.e.#work or#home) paired with a reminder syntax (i.e.[10m] or[120m]) and create an alarm to pair with the specified event.

A calendar title nomenclature of say:"Take out the trash #home [10m]" and the event itself with a start time of 8:00AM will produce an alarm titled "Take out the trash" and be set for 7:50AM.

CalarmHelp is a word jumble coming from"Calendar" +"Alarm" +"Help". Calendar Alarm Help.

CalarmHelp contains an API used to triggerGPT4o to translate normal human speech (or an API call) with content"At 8AM remind me to take out the trash 10 minutes early at home" into a JSON object which contains a structured title with a value such as"Take out the trash @ 8AM #home [10m]".

This output (simplified in this readme) is passed as input to a google calendar API service, and calls the create calendar event method - and provides the needed meta data for that event's creation.

After the calendar event is created - the Android application (or application of your choice) can look at the calendar and create an alarm on your behalf based on the tags in that title + the syntax for lead time for a reminder of that alarm.

Setting up your project

Requirements


Optional Requirements


Installation

  1. Make sure you have Python and Poetry installed on your system. If not, follow the instructions in the links above.

  1. Clone this repository to your local machine:
git clone https://github.com/your-username/calarmHelp.git

  1. Navigate to the project directory:
cd calarmHelp

  1. Install the project dependencies using Poetry:
poetry install

  1. Create an environment file
touch .env

  1. Add the following environment variables, with values, to the.env file.
OPENAI_API_KEY=<Refer to OpenAI Docs>ORIGINS=<A string which defines origins for CORS middleware>CALENDAR_ID=<The calendar ID you want to use>GOOGLE_APPLICATION_CREDENTIALS=<to the location of your google credentials file>

SeeHow Application Default Credentials Work

SeeOpenAI API Keys

IMPORTANT: Accessing the Calendar with a Service Account

Find yourCALENDAR_ID by going to your Google Calendar, clicking on the three dots next to the calendar you want to use, and selectingSettings and Sharing. TheCALENDAR_ID will be listed underIntegrate Calendar.

Ensure the calendar is shared with the service account by following these steps:

In the same Settings and sharing section, under "Share with specific people or groups," add the service account's email.Assign the "Make changes and manage sharing" permissions.

Otherwise, the service account will not be able to access the calendar. And this application will not be able to create events on your behalf.



Building and running your application

Locally on your machine

The advantage of running your application locally is that you can make changes to your application and see the changes immediately.

When you're ready to run locally:Ensure you're in the root directory of your project and run the following commands:

poetry run start# alias for: `poetry run python calarmhelp/main.py`

Your application will be available athttp://localhost:8000.


Locally with Docker

The advantage of running your application in Docker is that you can ensure that your application runs the same way locally as it does in the cloud.

When you're ready to run locally, start your application by running:docker compose up --build.

Your application will be available athttp://localhost:8000.


Scripts

The commands are defined in thetool.poetry.scripts section of thepyproject.toml file for inclusion in the application.

The scripts themselves are defined in thecalarmhelp/scripts directory.

To create a new script:
  1. Create a new file (named after the script) in thecalarmhelp/scripts directory.
  2. Add the script to thetool.poetry.scripts section of thepyproject.toml file.
  3. Runpoetry install to install the new script.
  4. Run the script by runningpoetry run <script-name>.

Commands:

Start:

To start your application, run:

poetry run start

For Running locally with Dockerclick here or see theDocker-Start section below.

Docker-Start:

To start your application with Docker, run:

poetry run docker-start

Docker-Build:

To build your application with Docker, run:

poetry run docker-build <image-tag>

Docker-Push:

To push your application with Docker, run:

poetry run docker-push <image-tag>

Deploy-App

To deploy your application to Google Cloud, run:

poetry run deploy-app <tag-name>

Where<tag-name> becomes part of your image name in the format:gcr.io/calarmhelp/calarmhelp:<tag-name>

Examples:

  • poetry run deploy-app latest → Creates imagegcr.io/calarmhelp/calarmhelp:latest
  • poetry run deploy-app v1.0 → Creates imagegcr.io/calarmhelp/calarmhelp:v1.0
  • poetry run deploy-app test-build → Creates imagegcr.io/calarmhelp/calarmhelp:test-build
Important

This command is comprehensive and will:

  1. Build the Docker image with your specified tag
  2. Push the image to Google Container Registry
  3. Deploy the application to Google Cloud Run
  4. Update the traffic to route to the new revision

Note: Use simple tag names without special characters or multiple colons.

Linting:

To lint your code, run:

poetry run precommit

The linting step will also happen automatically before you commit your code.


References

About

Simplify Calendar Alarm Creation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp