Rize Google Calendar Sync polls your Rize project time entries and mirrors them into a Google Calendar. Each time entry becomes a calendar event titled [Project Name] - [Description], enriched with metadata inside the event description so you can search/sort in Google Calendar.
- Pulls
projectTimeEntriesvia the Rize GraphQL API - Creates or updates Google Calendar events using OAuth credentials
- Avoids duplicates by storing the time entry ID in
extendedProperties - Supports dry-run mode and a
--list-lasthelper to inspect recent entries - Timezone-aware (defaults to Asia/Shanghai, configurable via
.env)
- Python 3.11+
- Rize API token (visit Rize settings to generate)
- Google Cloud project with Calendar API enabled and OAuth client credentials (download as
credentials.json)
-
Clone the repository and create a virtual environment (recommended):
python -m venv .venv source .venv/bin/activate -
Install dependencies:
pip install -r requirements.txt -
Copy
.env.exampleto.envand fill in the values:cp .env.example .envRIZE_API_TOKEN: your personal Rize tokenGOOGLE_CALENDAR_ID: target calendar (defaults to the shared calendar in the example)GOOGLE_CLIENT_SECRET: path to your Google OAuth client JSONGOOGLE_TOKEN_PATH: where the script should store OAuth refresh tokensRIZE_SYNC_TIMEZONE: timezone for event start/end (e.g.Asia/Shanghai)
-
First run (dry run recommended):
python sync_rize_to_google.py --dry-runThe script opens a browser the first time to authorize access to your Google Calendar. After approving, the token is stored at
GOOGLE_TOKEN_PATH.
The script supports windowed syncs using absolute times or lookback/lookahead settings. Examples:
# Sync last 12 hours through the next 14 days (default settings)
python sync_rize_to_google.py
# Explicit window
python sync_rize_to_google.py --start 2025-08-10T00:00:00Z --end 2025-08-15T00:00:00Z
# Dry run to preview changes
python sync_rize_to_google.py --dry-run --lookback-hours 48
# Inspect the most recent five time entries without touching Google Calendar
python sync_rize_to_google.py --list-last 5Events use this format:
- Summary:
[Project Name] - [Description or "No description"] - Description: Original description (if present) plus metadata (project, client, start/end timestamps, duration, source, created/updated times, entry ID)
- Loads configuration from
.env(viapython-dotenv). - Fetches all project time entries from the Rize GraphQL API.
- Filters entries within the requested window.
- For each entry, searches Google Calendar for an event tagged with
rizeTimeEntryId.- Updates the event if the payload changed.
- Creates a new event otherwise.
- Stores the latest sync metadata in
extendedProperties.privateso future runs know whether an entry was already synced.
- Rize API errors: ensure your token is valid; rerun with
--log-level DEBUGfor more detail. - Google OAuth issues: delete the file at
GOOGLE_TOKEN_PATHto force a new authorization flow. - No entries syncing: expand the window via
--lookback-hours,--lookahead-days, or explicit--start/--end.
Issues and pull requests are welcome! Please run python -m compileall sync_rize_to_google.py before submitting to catch syntax errors early.
MIT