NOTICE: All information contained herein is, and remains
the property of TechnoCore Automate.
Updated : 2026-04-20
ObjServiceGoogle provides a reusable Google Workspace API integration for
the Axion platform. It wraps Gmail, Google Sheets, Google Drive, and Google
Calendar through OAuth2 service account credentials with domain-wide
delegation.
Each API service client is lazy-loaded on first use and cached for the
lifetime of the instance. Credentials and scopes are read from config.yaml
under base.google or {package}.google.
A shared def_integration_sync table tracks bidirectional mappings between
Axion records and Google external IDs (file IDs, spreadsheet IDs, event IDs),
enabling sync workflows across multiple providers.
| Area | Methods |
|---|---|
| Gmail | send_email(), list_messages(), get_message(), create_draft() |
| Sheets | create_spreadsheet(), read_range(), write_range(), append_rows(), export_to_sheet() |
| Drive | list_files(), upload_file(), create_folder(), share_file(), get_or_create_package_folder() |
| Calendar | create_event(), list_events(), create_reminder() |
| Sync | link_record(), get_external_id(), get_local_key() |
The service requires two Python packages (included in requirements.txt):
google-api-python-client -- Google API client librarygoogle-auth -- Google authentication libraryBoth are wrapped in a try/except import block. If unavailable, all API
methods return empty results and log a failure message.
base:
google:
service_account_file: resource.config/google-sa.json
delegated_user: admin@company.com
scopes:
- https://www.googleapis.com/auth/gmail.send
- https://www.googleapis.com/auth/spreadsheets
- https://www.googleapis.com/auth/drive
- https://www.googleapis.com/auth/calendar
resource.config/google-sa.json.delegated_user to the email of the user whose data the serviceCredentials can also be injected via environment variables using the standard
Axion $environment_KEY$ placeholders:
base:
google:
service_account_file: $environment_GOOGLE_SA_FILE$
delegated_user: $environment_GOOGLE_DELEGATED_USER$
export AXION_GOOGLE_SA_FILE="resource.config/google-sa.json"
export AXION_GOOGLE_DELEGATED_USER="admin@company.com"
The def_integration_sync table maps local records to Google objects
across multiple providers (google, bitbucket, asana, etc.):
| Column | Description |
|---|---|
| Guid | Primary key (auto-generated) |
| Package | Active Axion package |
| Provider | Integration provider (google) |
| SourceTable | Local table name |
| SourceKey | Local record key |
| ExternalId | Google object identifier (file ID, spreadsheet ID, etc.) |
| ExternalType | file, spreadsheet, folder, event, email |
| SyncStatus | synced, error, deleted |
| SyncedAt | Last sync timestamp |
# Verify service account credentials via Drive API
python ObjServiceGoogle.py test-connection
# List files in Google Drive (optionally by folder)
python ObjServiceGoogle.py list-drive-files
python ObjServiceGoogle.py list-drive-files --folder-id "abc123"
# Send a test email via Gmail API
python ObjServiceGoogle.py send-test-email "to@example.com" "Test subject"
# Create a new Google Spreadsheet
python ObjServiceGoogle.py create-sheet "Monthly Report"
from ObjServiceGoogle import ObjServiceApi
svc = ObjServiceApi()
# Send an email via Gmail
svc.send_email(
"user@company.com",
"Report Ready",
"<p>Your monthly report is attached.</p>",
)
# Create a spreadsheet and write data
sheet = svc.create_spreadsheet("Q1 Results")
sid = sheet.get("spreadsheetId", "")
if sid:
svc.write_range(sid, "Sheet1!A1", [
["Month", "Revenue"],
["Jan", "10000"],
["Feb", "12000"],
["Mar", "15000"],
])
svc.link_record(
"def_reports", "Q1-2026", sid, "spreadsheet"
)
# Upload a file to a package folder
folder_id = svc.get_or_create_package_folder(
"homechoice"
)
svc.upload_file(
"local.documents/export.csv",
folder_id=folder_id,
)
# Create a calendar event
from datetime import datetime, timezone
svc.create_event(
"Sprint Planning",
start=datetime(2026, 5, 1, 9, 0, tzinfo=timezone.utc),
end=datetime(2026, 5, 1, 10, 0, tzinfo=timezone.utc),
attendees=["dev@company.com"],
description="Weekly sprint planning session",
)
Updated : 2026-04-20