Skip to content

API Reference parrot_formdesigner.services.sinks.gsheet

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_formdesigner.services.sinks.gsheet

View source

GoogleSheetSink — a Google Sheets worksheet owned by a single form.

The cloud counterpart of :class:~parrot_formdesigner.services.sinks. csv_file.CsvFileSink. Unlike CSV, the Sheets API can append a column, so this sink declares EXTEND.

This is the only v1 sink needing a new dependency (google-api-python-client, the [gsheet] optional extra), so it must degrade cleanly: with the extra uninstalled, importing this module (and parrot-formdesigner as a whole) must still succeed — only USING the sink raises an actionable error.

googleapiclient is synchronous; every call to it is offloaded via asyncio.to_thread — never called directly on the event loop.

Alias AbstractSubmissionSink

Re-exported from parrot_formdesigner.services.sinks.base.AbstractSubmissionSink.

Alias FormSchema

Re-exported from parrot_formdesigner.core.schema.FormSchema.

Alias FormSubmission

Re-exported from parrot_formdesigner.services.submissions.FormSubmission.

Class GoogleSheetSink

A Google Sheets worksheet owned by a single form.

Capabilities are {WRITE, PROVISION, EXTEND} — no READ, no LIST (write-only by declaration).

Parameter Type Default Description
target GoogleSheetTarget The validated :class:GoogleSheetTarget this sink writes to.
alias_registry SinkAliasRegistry Resolves target.connection to service-account credentials.
tenant str Tenant scope used to resolve the connection alias.
client Any | None None An existing client implementing get_header/ write_header/append_row/append_column. When provided, this sink skips building its own — primarily for tests (a fake client).

Attributes:

Attribute Type Description
capabilities frozenset[SinkCapability] {WRITE, PROVISION, EXTEND} — no READ, no LIST.

Method GoogleSheetSink.ensure_target

Create the worksheet's header when absent; append new columns.

Existing columns are never reordered or deleted — a new form field appends a column at the trailing position.

ensure_target(form: FormSchema) -> None

Parameter Type Default Description
form FormSchema

Raises:

  • SinkUnavailableError — On extra-absent, auth, rate-limit (429), or transport failure. No retry is attempted.

Method GoogleSheetSink.write

Append one row. No retry on failure (including 429).

write(submission: FormSubmission, payload: Any) -> str

Parameter Type Default Description
submission FormSubmission The submission being persisted.
payload Any The flattened row dict for this submission.

Returns: str — The persisted submission_id.

Raises:

  • SinkUnavailableError — On rate-limit (429), auth, or transport failure.

Alias GoogleSheetTarget

Re-exported from parrot_formdesigner.core.persistence.GoogleSheetTarget.

Alias SinkAliasRegistry

Re-exported from parrot_formdesigner.services.sink_aliases.SinkAliasRegistry.

Alias SinkCapability

Re-exported from parrot_formdesigner.core.persistence.SinkCapability.

Alias SinkUnavailableError

Re-exported from parrot_formdesigner.services.sinks.base.SinkUnavailableError.

Alias column_names_for

Re-exported from parrot_formdesigner.services.sinks.mapper.column_names_for.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally