Skip to main content

SIIHA SDK — Natural language → Google Calendar create-event with dedupe

Project description

SIIHA - SDK

What is SIIHA SDK?

SIIHA is a micro-resilience assistant that blends emotional awareness × suggestion maps × workspace tools.
SIIHA SDK v0.1.0 exposes a focused capability: Create Google Calendar events from natural language, with built-in dedupe. It’s designed for local OAuth, terminal-first workflows, and consistent behavior across CLI / UI integrations.


Features (v0.1.0)

  • 🗓️ Google Calendar – Create Event
    • zh/EN natural-language parsing for dates/times, location, attendees.
    • Cross-day handling (e.g., 晚上11點到凌晨1點).
    • 下個月 [date] with month-end clamp; explicit year (e.g., 2026/1/2).
    • Location markers 地點:/location:@ Zoom / at ...;attendees extraction & dedupe.
  • 🔁 Idempotent creation (dedupe): same instant (timezone-normalized) + normalized title within the same day → treated as duplicate.
  • 🧩 Configurable: DEFAULT_TIMEZONE, DEFAULT_CALENDAR_ID, GOOGLE_SEND_UPDATES.

Example (natural input)

Meet with Marketing team tomorrow 3PM, location: HQ Meeting Room 2, attendees: debby@example.com


Quickstart

0) Prerequisite

python --version           # >= 3.10 (3.11 recommended)
python -m pip install -U pip
python -m pip install -U build twine pytest

1) OAuth setup (Desktop app)

  1. In Google Cloud Console, create OAuth 2.0 Client (Desktop).
  2. Download the client secrets as credentials.json and place it at the project root.
  3. Run a one-time bootstrap to generate token.json (also kept at root):
python quickstart.py

Required scopes (minimum):

2) Install (editable for development)

cd C:\Users\(YOURFOLDER)\siiha-sdk
python -m build                 # (optional) build wheel & sdist into dist/
python -m pip install -e .      # recommended for local dev

Usage

A) Parse → Create (minimal)

from siiha_sdk.nlp import parse_natural_event
from siiha_sdk.calendar import create_calendar_event

text = "下個月 5號 下午3點到4點 和文巽討論 OAuth,地點:Teams,邀請 debby@example.com"
p = parse_natural_event(text)          # {'title', 'start_iso', 'end_iso', 'location', 'attendees', ...}
res = create_calendar_event(**p, dedupe=True)
print(res)                             # {'ok': True, 'eventId': ..., 'deduped': False/True, ...}

B) Target a test calendar (avoid polluting primary)

  • Set environment variable SIIHA_TEST_CALENDAR_ID=your_test_calendar_id or
  • Override in code:
from siiha_sdk import config
config.DEFAULT_CALENDAR_ID = "your_test_calendar_id"

C) Dedupe behavior

  • Duplicate if and only if:
  1. Same instant (RFC3339 compared as actual instant; timezone forms like +08:00 vs Z still dedupe), and
  2. Normalized title equals (trim/whitespace collapse/commas normalized/case-fold).
  • Location / attendees differences do not affect dedupe.

Tests

Parser smoke test

python tests/quickstart_create_event.py

Dedupe scenarios (creates events)

# (optional) direct events to a test calendar
# PowerShell:
$env:SIIHA_TEST_CALENDAR_ID="your_test_calendar_id"
# Bash:
export SIIHA_TEST_CALENDAR_ID=your_test_calendar_id

python tests/dedupe_scenarios.py

(Tip) You can tag test events by passing description="#SDK_TEST" to create_calendar_event(...) and clean them later via a small script.


Configuration

These live in siiha_sdk/config.py:

  • DEFAULT_TIMEZONE = "Asia/Taipei"
  • DEFAULT_CALENDAR_ID = "primary"
  • GOOGLE_SEND_UPDATES = "all" (Google will email updates to attendees)

Override at runtime:

from siiha_sdk import config
config.DEFAULT_TIMEZONE = "Asia/Tokyo"
config.DEFAULT_CALENDAR_ID = "your_cal_id"
config.GOOGLE_SEND_UPDATES = "none"  # or "externalOnly" / "all"

Known limitations

  • All-day events, recurrence, reminders, and conferenceData (Meet links) are not supported yet.
  • Language coverage is focused on common zh/EN patterns; other languages/phrases may need extensions.
  • Description is optional and not auto-generated (except when you pass one).
  • Dedupe checks only within the same local day window at creation time.

Security

  • Do not commit credentials.json or token.json.
  • Use a test calendar for automated tests.
  • Principle of least privilege for your Google account.

Versioning & License

  • Versioning: SemVer (MAJOR.MINOR.PATCH). Current: v0.1.0.
  • License: MIT (see LICENSE).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

siiha_sdk-0.1.3.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

siiha_sdk-0.1.3-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file siiha_sdk-0.1.3.tar.gz.

File metadata

  • Download URL: siiha_sdk-0.1.3.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for siiha_sdk-0.1.3.tar.gz
Algorithm Hash digest
SHA256 de2f64bd9956101cda7636113eb56b768efc061a2ad010cb7b385ba8bdb34518
MD5 b31e917de91c0e4b296b7a8f60930658
BLAKE2b-256 792aa5bcc4fbe82777644686a39649a1378ff4222b5bd147716941770b628b48

See more details on using hashes here.

File details

Details for the file siiha_sdk-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: siiha_sdk-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for siiha_sdk-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 680a948a5652b69ac23475c3a84b921ffaf420121a141bbb3c8436b02cadb59d
MD5 d3e3d9016ff2c3e557ec556265f3d006
BLAKE2b-256 4ea3a7ef78b0b0b630d38ae2a33f42d834654c9fd8e2ed4c866895806430d73f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page