Analyze Sentiment

Analyze sentiment in a text file

Arguments

Argument Type Default value Description
text_filestrnull
file_typestrtext
json_filestrNone
langNone
param text_file:
 source text file
param json_file:
 json target to save result, defaults to None
param lang:language code of the source, defaults to None
return:analysis response

Annotate Image

Annotate image

Arguments

Argument Type Default value Description
image_uristrnull
json_filestrNone
param image_file:
 source image file
param json_file:
 json target to save result, defaults to None
return:detection response

Annotate Video

Annotate video

Arguments

Argument Type Default value Description
video_uristrNone
video_filestrNone
json_filestrNone
featureslistNone

Possible values for features:

  • FEATURE_UNSPECIFIED, Unspecified.
  • LABEL_DETECTION, Label detection. Detect objects, such as dog or flower.
  • SHOT_CHANGE_DETECTION, Shot change detection.
  • EXPLICIT_CONTENT_DETECTION, Explicit content detection.
  • SPEECH_TRANSCRIPTION, Speech transcription.
  • TEXT_DETECTION, OCR text detection and tracking.
  • OBJECT_TRACKING, Object detection and tracking.
  • LOGO_RECOGNITION, Logo detection, tracking, and recognition.

If video_uri is given then that is used even if video_file is None.

param video_uri:
 Google Cloud Storage URI
param video_file:
 filepath to video
param json_file:
 json target to save result, defaults to None
param features:list of annotation features to detect, defaults to ["LABEL_DETECTION", "SHOT_CHANGE_DETECTION"]
return:annotate result

Classify Text

Classify text

Arguments

Argument Type Default value Description
text_filenull
json_filenull
langNone
param text_file:
 source text file
param json_file:
 json target to save result, defaults to None
param lang:language code of the source, defaults to None
return:classify response

Clear Values

Clear cell values for range of cells within a sheet

Arguments

Argument Type Default value Description
sheet_idstrnull
sheet_rangestrnull
param sheet_id:target sheet
param sheet_range:
 target sheet range

Copy Sheet

Copy spreadsheet to target spreadsheet

Arguments

Argument Type Default value Description
spreadsheet_idnull
target_sheet_idnull

NOTE: service account user must have access to target sheet also

param spreadsheet_id:
 ID of the sheet to copy
param target_sheet_id:
 ID of the target sheet
return:request response

Create Bucket

Create Google Cloud Storage bucket

Arguments

Argument Type Default value Description
bucket_namestrnull
param bucket_name:
 name as string
return:bucket

Create Sheet

Create empty sheet with a title

Arguments

Argument Type Default value Description
titlestrnull
param title:name as string
return:created sheet_id

Delete Bucket

Delete Google Cloud Storage bucket

Arguments

Argument Type Default value Description
bucket_namestrnull

Bucket needs to be empty before it can be deleted.

param bucket_name:
 name as string

Delete Files

Delete files in the bucket

Arguments

Argument Type Default value Description
bucket_namestrnull
filesAnynull

Files need to be object name in the bucket.

param bucket_name:
 name as string
param files:single file, list of files or comma separated list of files
return:list of files which could not be deleted, or True if all were deleted

Detect Document

Detect document

Arguments

Argument Type Default value Description
image_filestrnull
json_filestrNone
param image_file:
 source image file
param json_file:
 json target to save result, defaults to None
return:detection response

Detect Labels

Detect labels in the image

Arguments

Argument Type Default value Description
image_filestrnull
json_filestrNone
param image_file:
 source image file
param json_file:
 json target to save result, defaults to None
return:detection response

Detect Text

Detect text in the image

Arguments

Argument Type Default value Description
image_filestrnull
json_filestrNone
param image_file:
 source image file
param json_file:
 json target to save result, defaults to None
return:detection response

Download Files

Download files from a bucket

Arguments

Argument Type Default value Description
bucket_namestrnull
filesAnynull

Example files: files = {"mytestimg": "image1.png", "mydoc": "google.pdf

param bucket_name:
 name as string
param files:list of object names or dictionary of object names and target files
return:list of files which could not be downloaded, or True if all were downloaded

Drive Create Directory

Create new directory to Google Drive

Arguments

Argument Type Default value Description
folderstr, NoneNone
param folder:name for the new directory
raises GoogleDriveError:
 if folder name is not given
return:created file id

Drive Delete File

Delete file specified by id, file dictionary or query string

Arguments

Argument Type Default value Description
file_idstr, NoneNone
file_dictdict, NoneNone
querystr, NoneNone
multiple_okboolFalse

Note. Be extra careful when calling this keyword!

param file_id:drive file id
param file_dict:
 file dictionary returned by Drive Search Files
param query:drive query string to find target file, needs to match 1 file unless parameter multiple_ok is set to True
param multiple_ok:
 set to True if it is ok to perform delete on more than 1 file
return:how many files where deleted

Examples

*** Tasks ***
${folder_id}=  Drive Get Folder Id   datafolder
${deleted}=    Drive Delete File   query=name contains '.json' and '${folder_id}' in parents
...            multiple_ok=True

Drive Download Files

Download files specified by file dictionary or query string

Arguments

Argument Type Default value Description
file_dictdict, NoneNone
querystr, NoneNone
limitint, NoneNone
timeoutfloat, NoneNone

Parameters start, limit and timeout are used only when downloading files defined by query parameter.

param file_dict:
 file dictionary returned by Drive Search Files
param query:drive query string to find target files, defaults to None
param start:start index from which to start download files
param limit:maximum amount of files that are downloaded, defaults to None
param timeout:maximum allowed time in seconds for download process
return:list of downloaded files

Examples

*** Tasks ***
${files}=    Drive Search Files    query=name contains '.json'
FOR    ${f}    IN    @{files}
    Run Keyword If  ${f}[size] < 2000  Drive Download Files  file_dict=${f}
END

${folder_id}=   Drive Get Folder Id   datafolder
Drive Download Files  query=name contains '.json' and '${folder_id}' in parents  recurse=True

Drive Export File

Export Google Drive file using Drive export links

Arguments

Argument Type Default value Description
file_idstr, NoneNone
file_dictdict, NoneNone
target_filestr, NoneNone
mimetypestrapplication/pdf
param file_id:drive file id
param file_dict:
 file dictionary returned by Drive Search Files
param target_file:
 name for the exported file
param mimetype:export mimetype, defaults to "application/pdf"

Examples

*** Tasks ***
${files}=  Drive Search Files  query=name contains 'my example worksheet'
Drive Export File  file_dict=${files}[0]

Drive Get Folder Id

Get file id for the folder

Arguments

Argument Type Default value Description
folderstr, NoneNone
param folder:name of the folder to identify, by default returns drive's root folder id
return:file id of the folder

Examples

*** Tasks ***
${root_id}=    Drive Get Folder Id   # returns Drive root folder id
${folder_id}=  Drive Get Folder Id  subdir

Drive Move File

Move file specified by id, file dictionary or query string into target folder

Arguments

Argument Type Default value Description
file_idstr, NoneNone
file_dictdict, NoneNone
querystr, NoneNone
folderstr, NoneNone
folder_idstr, NoneNone
multiple_okboolFalse
param file_id:drive file id
param file_dict:
 file dictionary returned by Drive Search Files
param query:drive query string to find target file, needs to match 1 file
param folder:name of the folder to move file into, is by default drive's root folder id
param folder_id:
 id of the folder to move file into, if set the folder parameter is ignored
param multiple_ok:
 if True then moving more than 1 file
return:list of file ids
raises GoogleDriveError:
 if there are no files to move or target folder can't be found

Examples

*** Tasks ***
${source_id}=  Drive Get Folder Id  sourcefolder
${query}=      Set Variable  name contains '.json' and '${sourceid}' in parents
${files}=      Drive Move File  query=${query}  folder=target_folder  multiple_ok=True

Drive Search Files

Search Google Drive for files matching query string

Arguments

Argument Type Default value Description
querystr, NoneNone
recurseboolFalse
folder_namestr, NoneNone
param query:search string, defaults to None which means that all files and folders are returned
param recurse:set to True if search should recursive
param folder_name:
 search files in this directory
raises GoogleDriveError:
 if there is a request error
return:list of files

Examples

*** Tasks ***
${files}=  Drive Search Files   query=name contains 'hello'
${files}=  Drive Search Files   query=modifiedTime > '2020-06-04T12:00:00'
${files}=  Drive Search Files   query=mimeType contains 'image/' or mimeType contains 'video/'
${files}=  Drive Search Files   query=name contains '.yaml'  recurse=True
${files}=  Drive Search Files   query=name contains '.yaml'  folder_name=datadirectory

Drive Update File

Update file specified by id, file dictionary or query string

Arguments

Argument Type Default value Description
file_idstr, NoneNone
file_dictdict, NoneNone
querystr, NoneNone
actionUpdatestar
multiple_okboolFalse

Possible actions: - star - unstar - trash - untrash

param file_id:drive file id
param file_dict:
 file dictionary returned by Drive Search Files
param query:drive query string to find target file, needs to match 1 file
param action:update action, default star file
param multiple_ok:
 set to True if it is ok to perform update on more than 1 file
return:number of updated files

Examples

*** Tasks ***
${folder_id}=  Drive Get Folder Id   datafolder
${updated}=    Drive Update File   query=name contains '.json' and '${folder_id}' in parents
...            action=star
...            multiple_ok=True

Drive Upload File

Upload files into Drive

Arguments

Argument Type Default value Description
filenamestr, NoneNone
folderstr, NoneNone
overwriteboolFalse
make_dirboolFalse
param filename:name of the file to upload
param folder:target folder for upload
param overwrite:
 set to True if already existing file should be overwritten
param make_dir:set to True if folder should be created if it does not exist
raises GoogleDriveError:
 if target_folder does not exist or trying to upload directory
return:uploaded file id

Examples

*** Tasks ***
${file1_id}=  Drive Upload File   data.json  # Upload file to drive root
${file2_id}=  Drive Upload File   newdata.json  new_folder  make_dir=True
${file3_id}=  Drive Upload File   data.json  overwrite=True

Face Detection

Detect faces

Arguments

Argument Type Default value Description
image_uristrnull
json_filestrNone
param image_uri:
 Google Cloud Storage URI
param json_file:
 json target to save result, defaults to None
return:detection response

Get Bucket

Get Google Cloud Storage bucket

Arguments

Argument Type Default value Description
bucket_namestrnull
param bucket_name:
 name as string
return:bucket

Get Values

Get values from the range in the sheet

Arguments

Argument Type Default value Description
sheet_idstrnull
sheet_rangestrnull
value_render_optionstrUNFORMATTED_VALUE
datetime_render_optionstrFORMATTED_STRING
default_value_for_emptyint, float, strNone
param sheet_id:target sheet
param sheet_range:
 target sheet range
param value_render_option:
 how values should be represented in the output defaults to "UNFORMATTED_VALUE"
param datetime_render_option:
 how dates, times, and durations should be represented in the output, defaults to "FORMATTED_STRING"
param default_value_for_empty:
 value for empty field if it does not have any in Sheets, default None

Init Apps Script Client

Initialize Google Apps Script client

Arguments

Argument Type Default value Description
credentials_filestrcredentials.json
token_filestroauth.token
use_robocloud_vaultboolFalse
scopeslistNone
save_tokenboolFalse
param credentials_file:
 filepath to credentials JSON
param token_file:
 filepath to OAuth token file
param use_robocloud_vault:
 if True the token is read from Robocloud
param scopes:authenticated scopes, for example. ['forms', 'spreadsheets']
param save_token:
 set to True if token should be saved to local file

Init Apps Script Client Service Account

Initialize Google Apps Script client with service account

Arguments

Argument Type Default value Description
service_credentials_filestrNone
use_robocloud_vaultboolFalse
scopeslistNone
param service_credentials_file:
 filepath to credentials JSON
param use_robocloud_vault:
 use json stored into Robocloud Vault

Init Drive Client

Initialize Google Drive client

Arguments

Argument Type Default value Description
credentials_filestrcredentials.json
token_filestroauth.token
use_robocloud_vaultboolFalse
scopeslistNone
save_tokenboolFalse
param credentials_file:
 filepath to credentials JSON
param token_file:
 filepath to OAuth token file
param use_robocloud_vault:
 if True the token is read from Robocloud
param scopes:authenticated scopes, for example. ['forms', 'spreadsheets']
param save_token:
 set to True if token should be saved to local file

Init Drive Client Service Account

Initialize Google Drive client with service account

Arguments

Argument Type Default value Description
service_credentials_filestrNone
use_robocloud_vaultboolFalse
param service_credentials_file:
 filepath to credentials JSON
param use_robocloud_vault:
 use json stored into Robocloud Vault

Init Natural Language Client

Initialize Google Cloud Natural Language client

Arguments

Argument Type Default value Description
service_credentials_filestrNone
use_robocloud_vaultboolFalse
param service_credentials_file:
 filepath to credentials JSON
param use_robocloud_vault:
 use json stored into Robocloud Vault

Init Sheets Client

Initialize Google Sheets client

Arguments

Argument Type Default value Description
service_credentials_filestrNone
use_robocloud_vaultboolFalse
param service_credentials_file:
 filepath to credentials JSON
param use_robocloud_vault:
 use json stored into Robocloud Vault

Init Speech To Text Client

Initialize Google Cloud Speech to Text client

Arguments

Argument Type Default value Description
service_credentials_filestrNone
use_robocloud_vaultboolFalse
param service_credentials_file:
 filepath to credentials JSON
param use_robocloud_vault:
 use json stored into Robocloud Vault

Init Storage Client

Initialize Google Cloud Storage client

Arguments

Argument Type Default value Description
service_credentials_filestrNone
use_robocloud_vaultboolFalse
param service_credentials_file:
 filepath to credentials JSON
param use_robocloud_vault:
 use json stored into Robocloud Vault

Init Text To Speech Client

Initialize Google Cloud Text to Speech client

Arguments

Argument Type Default value Description
service_credentials_filestrNone
use_robocloud_vaultboolFalse
param service_credentials_file:
 filepath to credentials JSON
param use_robocloud_vault:
 use json stored into Robocloud Vault

Init Translation Client

Initialize Google Cloud Translation client

Arguments

Argument Type Default value Description
service_credentials_filestrNone
project_identifierstrNone
use_robocloud_vaultboolFalse
param service_credentials_file:
 filepath to credentials JSON
param project_identifier:
 identifier for Translation project
param use_robocloud_vault:
 use json stored into Robocloud Vault

Init Video Intelligence Client

Initialize Google Cloud Video Intelligence client

Arguments

Argument Type Default value Description
service_credentials_filestrNone
use_robocloud_vaultboolFalse
param service_credentials_file:
 filepath to credentials JSON
param use_robocloud_vault:
 use json stored into Robocloud Vault

Init Vision Client

Initialize Google Cloud Vision client

Arguments

Argument Type Default value Description
service_credentials_filestrNone
use_robocloud_vaultboolFalse
param service_credentials_file:
 filepath to credentials JSON
param use_robocloud_vault:
 use json stored into Robocloud Vault

Insert Values

Insert values into sheet cells

Arguments

Argument Type Default value Description
sheet_idstrnull
sheet_rangestrnull
valueslistnull
major_dimensionstrCOLUMNS
value_input_optionstrUSER_ENTERED
param sheet_id:target sheet
param sheet_range:
 target sheet range
param values:list of values to insert into sheet
param major_dimension:
 major dimension of the values, default COLUMNS
param value_input_option:
 controls whether input strings are parsed or not, default USER_ENTERED

List Buckets

List Google Cloud Storage buckets

return:list of buckets

List Files

List files in the bucket

Arguments

Argument Type Default value Description
bucket_namestrnull
param bucket_name:
 name as string
return:list of object names in the bucket

List Supported Voices

List supported voices for the speech

Arguments

Argument Type Default value Description
language_codestrNone
param language_code:
 voice languages to list, defaults to None (all)
return:list of supported voices

Recognize

Recognize text in the audio file

Arguments

Argument Type Default value Description
audio_file_urinull
encodingstrFLAC
language_codestren_US
audio_channel_count2
param audio_file_uri:
 Google Cloud Storage URI
return:recognized texts

Run Script

Run the Google Apps Script

Arguments

Argument Type Default value Description
script_idstrnull
function_namestrnull
parametersdictnull
param script_id:
 Google Script identifier
param function_name:
 name of the script function
param parameters:
 script function parameters as a dictionary
raises AssertionError:
 thrown when Google Script returns errors

Examples

*** Tasks ***
&{params}=    Create Dictionary  formid=aaad4232  formvalues=1,2,3
${response}=  Run Script    abc21397283712da  submit_form   ${params}
Log Many   ${response}

Set Global Scopes

Set global Google authentication scopes

Arguments

Argument Type Default value Description
scopeslist, NoneNone

Useful when using numerous services with different scopes

param scopes:list of authentication scopes

Set Robocloud Vault

Set Robocloud Vault name and secret key name

Arguments

Argument Type Default value Description
vault_namestr, NoneNone
vault_secret_keystr, NoneNone
param vault_name:
 Robocloud Vault name
param vault_secret_key:
 Rococloud Vault secret key name

Synthesize Speech

Synthesize speech synchronously

Arguments

Argument Type Default value Description
textnull
languageen-US
nameen-US-Standard-B
genderMALE
encodingMP3
target_filesynthesized.mp3
param text:input text to synthesize
param language:voice language, defaults to "en-US"
param name:voice name, defaults to "en-US-Standard-B"
param gender:voice gender, defaults to "MALE"
param encoding:result encoding type, defaults to "MP3"
param target_file:
 save synthesized output to file, defaults to "synthesized.mp3"
return:synthesized output in bytes

Translate

Translate text

Arguments

Argument Type Default value Description
textAnynull
source_languagestrNone
target_languagestrNone
param text:text to translate
param source_language:
 language code, defaults to None
param target_language:
 language code, defaults to None
return:translated text

Update Values

Update values in the sheet cells

Arguments

Argument Type Default value Description
sheet_idstrnull
sheet_rangestrnull
valueslistnull
major_dimensionstrCOLUMNS
value_input_optionstrUSER_ENTERED
param sheet_id:target sheet
param sheet_range:
 target sheet range
param values:list of values to insert into sheet
param major_dimension:
 major dimension of the values, default COLUMNS
param value_input_option:
 controls whether input strings are parsed or not, default USER_ENTERED

Upload File

Upload a file into a bucket

Arguments

Argument Type Default value Description
bucket_namestrnull
filenamestrnull
target_namestrnull
param bucket_name:
 name as string
param filename:filepath to upload file
param target_name:
 target object name

Upload Files

Upload files into a bucket

Arguments

Argument Type Default value Description
bucket_namestrnull
filesdictnull

Example files: files = {"mytestimg": "image1.png", "mydoc": "google.pdf"}

param bucket_name:
 name as string
param files:dictionary of object names and filepaths