Knowledgator UTCA
KnowledgatorGitHubDiscord
  • Welcome to UTCA documentation!
  • Quickstart
  • Concepts
    • Components
    • Types of components
    • ExecutionSchema
    • Context
    • Scopes
  • Development and Contribution
    • Contribution
    • Future relises
  • Framework structure
  • Core
    • Component
    • BaseExecutor
    • Action
    • Executable
    • Evaluator
    • Memory management
    • Schemas
    • Exceptions
  • Structural components
    • ExecutionSchema
    • Switch
    • ForEach
    • Filter
    • While
    • Condition
    • BREAK
    • Log
  • Base Actions
    • Flush
    • AddData
    • RenameAttribute
    • RenameAttributeQuery
    • SetValue
    • UnpackValue
    • NestToKey
    • ExecuteFunction
  • Predictors
    • Predictor
    • Transformers predictors
    • Transformers schemas
    • TokenSearcherPredictor
    • ComprehendItPredictor
    • GLiNERPredictor
    • OpenAIChatGPTPredictor
    • OpenAIWhisperPredictor
  • Tasks
    • Task
    • ComprehendIt
    • TokenSearcherTextCleaner
    • TokenSearcherNER
    • TokenSearcherQandA
    • TokenSearcherRelationExtraction
    • GLiNER
    • GLiNERRelationExtraction
    • GLiNERQandA
    • OpenAIChat
    • WhisperSpeechToText
    • TransformersTextToSpeech
    • TransformersChartsAndPlotsAnalysis
    • TransformersDocumentQandA
    • TransformersImageClassification
    • TransformersVisualQandA
    • TransformersObjectDetection
    • TransformersTextEmbedding
    • TransformersEntityLinking
    • TransformersTokenClassifier
    • TransformersTextSummarization
    • TransformersTextualQandA
    • TransformersTextClassification
    • TransformersChat
    • Objects
    • Chat tasks utilities
    • Relation extraction tasks utilities
  • Executable Schemas
    • SemanticSearchSchema
    • Web2Meaning
    • RequestsHTML
  • Datasources
    • Audio
    • DB
      • SQL
      • Neo4j
      • Chroma
      • Qdrant
    • Google Documents
    • Google Sheets
    • Image
    • Index
    • JSON
    • PDF
    • Plain text
    • Video
  • Conditions
    • RePattern
    • SemanticCondition
  • APIs
    • GoogleCloudClient
  • Integrations
    • Google Cloud
  • Examples
    • Basic image classification
    • Text to speech
    • PDF document processing
Powered by GitBook
On this page
  • Module: implementation.datasources.google_sheets
  • GoogleSheetsAction
  • __init__
  • GoogleSheetsCreate
  • execute
  • GoogleSheetsRead
  • execute
  • GoogleSheetsReadBatch
  • execute
  • GoogleSheetsWrite
  • execute
  • GoogleSheetsWriteBatch
  • execute
  • GoogleSpreadsheetsAppend
  • execute
  • GoogleSheetsClientConfig
  • __init__
  • Dimension
  • ROWS
  • COLUMNS
  • InputOption
  • RAW
  • USER_ENTERED
  • InsertDataOption
  • INSERT_ROWS
  • OVERWRITE
  1. Datasources

Google Sheets

Actions for handling Google Sheets data

PreviousGoogle DocumentsNextImage

Last updated 1 year ago

To use this actions you need to configure Google Cloude. See more:

Module: .datasources.google_sheets



GoogleSheetsAction

Base Google Sheets action. Subclass of .


__init__

Arguments:

  • client (): Google client that will be used for access.

  • name (Optional[str], optional): Name for identification. If equals to None, class name will be used. Defaults to None.




GoogleSheetsCreate


execute

Arguments:

  • input_data (Dict[str, Any]): Expected keys:

    • "title" (str): Name of the spreadsheet;

    • "sheets" (List[str], optional): Sheets names to create. Defaults to ["Sheet1"].

Raises:

  • Exception: If unable to create spreadsheet.

Returns:

  • Dict[str, Any]: Expected keys:

    • "spreadsheet_id" (str): Spreadsheet ID;




GoogleSheetsRead


execute

Arguments:

  • input_data (Dict[str, Any]): Expected keys:

    • "spreadsheet_id" (str): Spreadsheet ID (can be found in url: https://docs.google.com/spreadsheets/d/spreadsheet_id/edit#gid=0);

    • "cells_range" (str): Range of cells provided in A1 notation. Examples: "B2:C2", "A1", "Sheet1", "Sheet1!A1:B1", etc..

Raises:

  • Exception: If unable to read spreadsheet.

Returns:

  • Dict[str, Any]: Expected keys:

    • "table" (List[List[Any]]): Table that represents sheet or part of it specified by "cells_range";




GoogleSheetsReadBatch


execute

Arguments:

  • input_data (Dict[str, Any]): Expected keys:

    • "spreadsheet_id" (str): Spreadsheet ID (can be found in url: https://docs.google.com/spreadsheets/d/spreadsheet_id/edit#gid=0);

    • "cells_ranges" (List[str]): Ranges of cells provided in A1 notation. Examples: "B2:C2", "A1", "Sheet1", "Sheet1!A1:B1", etc..

Raises:

  • Exception: If unable to read spreadsheet.

Returns:

  • List[Dict[str, Any]]: List of items containing tables. Items expected keys:

    • "table" (List[List[Any]]): Table that represents sheet or part of it specified by "cells_range";




GoogleSheetsWrite


execute

Arguments:

  • input_data (Dict[str, Any]): Expected keys:

    • "spreadsheet_id" (str): Spreadsheet ID (can be found in url: https://docs.google.com/spreadsheets/d/spreadsheet_id/edit#gid=0);

    • "cells_range" (str): Range of cells provided in A1 notation. Examples: "B2:C2", "A1", "Sheet1", "Sheet1!A1:B1", etc..

    • "table" (List[List[Any]]): Values to add to spreadsheet.

Raises:

  • Exception: If unable to update spreadsheet.

Returns:

  • Dict[str, Any]: Expected keys:

    • "spreadsheet" (Dict[str, Any]): Updated spreadsheet;




GoogleSheetsWriteBatch


execute

Arguments:

  • input_data (Dict[str, Any]): Expected keys:

    • "spreadsheet_id" (str): Spreadsheet ID (can be found in url: https://docs.google.com/spreadsheets/d/spreadsheet_id/edit#gid=0);

    • "inputs" (List[Dict[str, Any]]): List of write actions. Each action contain:

      • "cells_range" (str): Range of cells provided in A1 notation. Examples: "B2:C2", "A1", "Sheet1", "Sheet1!A1:B1", etc..

      • "table" (List[List[Any]]): Values to add to spreadsheet.

Raises:

  • Exception: If unable to update spreadsheet.

Returns:

  • Dict[str, Any]: Expected keys:

    • "spreadsheet" (Dict[str, Any]): Updated spreadsheet;




GoogleSpreadsheetsAppend


execute

Arguments:

  • input_data (Dict[str, Any]): Expected keys:

    • "spreadsheet_id" (str): Spreadsheet ID (can be found in url: https://docs.google.com/spreadsheets/d/spreadsheet_id/edit#gid=0);

    • "cells_range" (str): Range of cells provided in A1 notation. Examples: "B2:C2", "A1", "Sheet1", "Sheet1!A1:B1", etc..

    • "table" (List[List[Any]]): Values to add to spreadsheet.

Raises:

  • Exception: If unable to update spreadsheet.

Returns:

  • Dict[str, Any]: Expected keys:

    • "spreadsheet" (Dict[str, Any]): Updated spreadsheet;




GoogleSheetsClientConfig


__init__

Arguments:

  • scopes (List[str]): Access scopes. Defaults to ["https://www.googleapis.com/auth/spreadsheets"] (Read and write acess to all spreadsheets).

  • service (str): Service name. Defaults to "sheets" (Google Spreadsheets service).

  • version (str): API version. Defaults to "v4".




Dimension

Specify major dimension(i.e. what outer list represents)


ROWS


COLUMNS




InputOption

Specify how input data should be formatted


RAW

Inputs as is


USER_ENTERED

All inputs treated as input from the user (enabling formatting and formulas)




InsertDataOption

How data should be append to table


INSERT_ROWS

Insert new rows


OVERWRITE

Overwrite anything after table



Create spreadsheet. Subclass of . Type of [Dict[str, Any], Dict[str, Any]].

Read spreadsheet. Subclass of . Type of [Dict[str, Any], Dict[str, Any]].

"dimension" (, optional): Reading dimension. May be . or .. Defaults to..

Read spreadsheet batch. Subclass of . Type of [Dict[str, Any], List[Dict[str, Any]]].

"dimension" (, optional): Reading dimension. May be . or .. Defaults to..

Write to spreadsheet. Subclass of . Type of [Dict[str, Any], Dict[str, Any]].

"value_input_option" (, optional): Input option can be: . - All inputs treated as input from the user (enabling formatting and formulas), or. - all inputs as is. Defaults to ..

"dimension" (, optional): Reading dimension. May be . or .. Defaults to..

Write to spreadsheet batch. Subclass of . Type of [Dict[str, Any], Dict[str, Any]].

"value_input_option" (, optional): Input option can be: . - All inputs treated as input from the user (enabling formatting and formulas), or. - all inputs as is. Defaults to ..

"dimension" (, optional): Reading dimension. May be . or .. Defaults to..

Write to spreadsheet. Subclass of . Type of [Dict[str, Any], Dict[str, Any]].

"value_input_option" (, optional): Input option can be: . - All inputs treated as input from the user (enabling formatting and formulas), or. - all inputs as is. Defaults to ..

"insert_data_option" (, optional): Isert data option can be . - will overwrite anything after table, or . - will insert new rows. Defaults to ..

"dimension" (, optional): Reading dimension. May be . or .. Defaults to..

Google Sheets default configuration. Subclass of .

GoogleSheetsAction
GoogleSheetsAction
GoogleSheetsAction
GoogleSheetsAction
Dimension
Dimension
ROWS
Dimension
COLUMNS
Dimension
ROWS
GoogleSheetsAction
GoogleSheetsAction
Dimension
Dimension
ROWS
Dimension
COLUMNS
Dimension
ROWS
GoogleSheetsAction
GoogleSheetsAction
InputOption
InputOption
USER_ENTERED
InputOption
RAW
InputOption
USER_ENTERED
Dimension
Dimension
ROWS
Dimension
COLUMNS
Dimension
ROWS
GoogleSheetsAction
GoogleSheetsAction
InputOption
InputOption
USER_ENTERED
InputOption
RAW
InputOption
USER_ENTERED
Dimension
Dimension
ROWS
Dimension
COLUMNS
Dimension
ROWS
GoogleSheetsAction
GoogleSheetsAction
InputOption
InputOption
USER_ENTERED
InputOption
RAW
InputOption
USER_ENTERED
InsertDataOption
InsertDataOption
OVERWRITE
InsertDataOption
INSERT_ROWS
InsertDataOption
OVERWRITE
Dimension
Dimension
ROWS
Dimension
COLUMNS
Dimension
ROWS
Google Cloud
Action
GoogleCloudClient
implementation
GoogleCloudClientConfig