Metadata-Version: 2.4
Name: concinno-skills-google
Version: 0.1.0
Summary: Google ecosystem agent skills (Calendar/Drive/Gmail/YouTube Data) for Concinno — native Python API first, MCP fallback optional
Project-URL: Homepage, https://github.com/aiking931931/concinno
Project-URL: Issues, https://github.com/aiking931931/concinno/issues
Project-URL: Changelog, https://github.com/aiking931931/concinno/blob/main/projects/concinno-skills-google/CHANGELOG.md
Author-email: "AI King (Chen-Xuan Wang)" <me@ai-king.dev>
License-Expression: Apache-2.0
Keywords: agent,calendar,concinno,drive,gmail,google,skills,youtube
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: concinno>=2.15.0
Requires-Dist: google-api-python-client>=2.100
Requires-Dist: google-auth-httplib2>=0.2
Requires-Dist: google-auth-oauthlib>=1.0
Requires-Dist: google-auth>=2.20
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pytest-cov>=5; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.7; extra == 'dev'
Description-Content-Type: text/markdown

# concinno-skills-google

Google ecosystem agent skills for [Concinno](https://pypi.org/project/concinno/).
Native Python API first, MCP fallback optional.

## Status

MVP (0.1.0) — `GoogleCalendar` only. Drive / Gmail / YouTube Data will
follow in subsequent minor releases under the same entry-point group so
no Concinno upgrade is required when new tools land.

## Install

```bash
pip install concinno-skills-google
```

`google-api-python-client` and `google-auth` are hard dependencies
(the tool is useless without them) and will be pulled in automatically.

## OAuth setup

This package does **not** run an interactive OAuth flow — tokens are a
one-shot user responsibility. Use any of the standard Google quickstart
flows to produce an authorized-user token JSON, then make it visible to
Concinno via either of:

**Option A — drop the file** (simplest):

```bash
mkdir -p ~/.concinno
cp path/to/your/token.json ~/.concinno/google_token.json
```

**Option B — Concinno `CredentialStore`** (preferred when you already
use it for other secrets):

```python
from concinno.core.credentials import get_default_store

store = get_default_store()
store.set("google_oauth_token", open("token.json").read())
```

Or persist it via the config file:

```jsonc
// ~/.concinno/credentials.json
{
  "google_oauth_token": "{...authorized-user token JSON as a string...}"
}
```

Expired access tokens are refreshed automatically; the refreshed JSON is
written back to whichever source provided it.

## Usage via Concinno `ToolRegistry`

When the consumer sets `CONCINNO_LOAD_PLUGINS=1`, the default registry
auto-mounts `GoogleCalendar`:

```python
import os
os.environ["CONCINNO_LOAD_PLUGINS"] = "1"

from concinno.tools.registry import get_default_registry

reg = get_default_registry()
assert "GoogleCalendar" in reg.list_deferred()

tool = reg.get("GoogleCalendar")
events = tool.call(
    action="list",
    time_min="2026-04-22T00:00:00Z",
    time_max="2026-04-23T00:00:00Z",
    max_results=50,
)
```

## Direct Python usage

No registry round-trip required; instantiate directly:

```python
from concinno_skills_google import GoogleCalendar

cal = GoogleCalendar()

# List
events = cal.call(
    action="list",
    calendar_id="primary",
    time_min="2026-04-22T00:00:00Z",
)

# Create
created = cal.call(
    action="create",
    event={
        "summary": "Deep work block",
        "start": {"dateTime": "2026-04-22T14:00:00+08:00"},
        "end":   {"dateTime": "2026-04-22T16:00:00+08:00"},
    },
)

# Delete
cal.call(action="delete", event_id=created["id"])
```

All methods return either a plain `list[dict]` (for `list`) or a small
status `dict`. On failure they return `{"error": "..."}` rather than
raising — same shape as the other Concinno built-in tools.

## License

Apache-2.0. See `LICENSE` in the Concinno monorepo.
