Analyze Sentiment

Analyze sentiment in a text file

Arguments

Argument Type Default value Description
text_file strsource text file
file_type str text
json_file str Nonejson target to save result, defaults to None
langNonelanguage code of the source, defaults to None
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_uri str
json_file str Nonejson target to save result, defaults to None
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_uri str NoneGoogle Cloud Storage URI
video_file str Nonefilepath to video
json_file str Nonejson target to save result, defaults to None
features list Nonelist of annotation features to detect, defaults to ["LABEL_DETECTION", "SHOT_CHANGE_DETECTION"]

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_filesource text file
json_filejson target to save result, defaults to None
langNonelanguage code of the source, defaults to None
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_id strtarget sheet
sheet_range strtarget sheet range
param sheet_id:target sheet
param sheet_range:
 target sheet range

Create Bucket

Create Google Cloud Storage bucket

Arguments

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

Create Sheet

Create empty sheet with a title

Arguments

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

Delete Bucket

Delete Google Cloud Storage bucket

Arguments

Argument Type Default value Description
bucket_name strname as string

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_name strname as string
files typing.Anysingle file, list of files or comma separated list of files

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_file strsource image file
json_file str Nonejson target to save result, defaults to None
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_file strsource image file
json_file str Nonejson target to save result, defaults to None
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_file strsource image file
json_file str Nonejson target to save result, defaults to None
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_name strname as string
files typing.Anylist of object names or dictionary of object names and target files

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
folder str Nonename for the new directory
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_id str Nonedrive file id
file_dict dict Nonefile dictionary returned by Drive Search Files
query str Nonedrive query string to find target file, needs to match 1 file unless parameter multiple_ok is set to True
multiple_ok bool Falseset to True if it is ok to perform delete on more than 1 file

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_dict dict Nonefile dictionary returned by Drive Search Files
query str Nonedrive query string to find target files, defaults to None
limit int Nonemaximum amount of files that are downloaded, defaults to None
timeout float Nonemaximum allowed time in seconds for download process

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_id str Nonedrive file id
file_dict dict Nonefile dictionary returned by Drive Search Files
target_file str Nonename for the exported file
mimetype str application/pdfexport mimetype, defaults to "application/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
folder str Nonename of the folder to identify, by default returns drive's root folder id
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_id str Nonedrive file id
file_dict dict Nonefile dictionary returned by Drive Search Files
query str Nonedrive query string to find target file, needs to match 1 file
folder str Nonename of the folder to move file into, is by default drive's root folder id
folder_id str Noneid of the folder to move file into, if set the folder parameter is ignored
multiple_ok bool Falseif True then moving more than 1 file
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
query str Nonesearch string, defaults to None which means that all files and folders are returned
recurse bool Falseset to True if search should recursive
folder_name str Nonesearch files in this directory
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_id str Nonedrive file id
file_dict dict Nonefile dictionary returned by Drive Search Files
query str Nonedrive query string to find target file, needs to match 1 file
action Update { trash | untrash | star | unstar } Update.starupdate action, default star file
multiple_ok bool Falseset to True if it is ok to perform update on more than 1 file

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
filename str Nonename of the file to upload
folder str Nonetarget folder for upload
overwrite bool Falseset to True if already existing file should be overwritten
make_dir bool Falseset to True if folder should be created if it does not exist
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_uri strGoogle Cloud Storage URI
json_file str Nonejson target to save result, defaults to None
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_name strname as string
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_id strtarget sheet
sheet_range strtarget sheet range
value_render_option str UNFORMATTED_VALUEhow values should be represented in the output defaults to "UNFORMATTED_VALUE"
datetime_render_option str FORMATTED_STRINGhow dates, times, and durations should be represented in the output, defaults to "FORMATTED_STRING"
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"

Init Apps Script Client

Initialize Google Apps Script client

Arguments

Argument Type Default value Description
credentials_file str credentials.jsonfilepath to credentials JSON
token_file str oauth.tokenfilepath to OAuth token file
use_robocloud_vault bool Falseif True the token is read from Robocloud
scopes list Noneauthenticated scopes, for example. ['forms', 'spreadsheets']
save_token bool Falseset to True if token should be saved to local file
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

Initialize Google Drive client

Arguments

Argument Type Default value Description
credentials_file str credentials.jsonfilepath to credentials JSON
token_file str oauth.tokenfilepath to OAuth token file
use_robocloud_vault bool Falseif True the token is read from Robocloud
scopes list Noneauthenticated scopes, for example. ['forms', 'spreadsheets']
save_token bool Falseset to True if token should be saved to local file
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 Natural Language Client

Initialize Google Cloud Natural Language client

Arguments

Argument Type Default value Description
service_credentials_file str Nonefilepath to credentials JSON
use_robocloud_vault bool Falseuse json stored into Robocloud Vault
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_file str Nonefilepath to credentials JSON
use_robocloud_vault bool Falseuse json stored into Robocloud Vault
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_file str Nonefilepath to credentials JSON
use_robocloud_vault bool Falseuse json stored into Robocloud Vault
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_file str Nonefilepath to credentials JSON
use_robocloud_vault bool Falseuse json stored into Robocloud Vault
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_file str Nonefilepath to credentials JSON
use_robocloud_vault bool Falseuse json stored into Robocloud Vault
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_file str Nonefilepath to credentials JSON
project_identifier str Noneidentifier for Translation project
use_robocloud_vault bool Falseuse json stored into Robocloud Vault
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_file str Nonefilepath to credentials JSON
use_robocloud_vault bool Falseuse json stored into Robocloud Vault
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_file str Nonefilepath to credentials JSON
use_robocloud_vault bool Falseuse json stored into Robocloud Vault
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_id strtarget sheet
sheet_range strtarget sheet range
values listlist of values to insert into sheet
major_dimension str COLUMNSmajor dimension of the values, default COLUMNS
value_input_option str USER_ENTEREDcontrols whether input strings are parsed or not, default USER_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_name strname as string
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_code str Nonevoice languages to list, defaults to None (all)
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_uriGoogle Cloud Storage URI
encoding str FLAC
language_code str en_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_id strGoogle Script identifier
function_name strname of the script function
parameters dictscript function parameters as a dictionary
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
scopes list Nonelist of authentication scopes

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_name str NoneRobocloud Vault name
vault_secret_key str NoneRococloud Vault secret key name
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
textinput text to synthesize
languageen-USvoice language, defaults to "en-US"
nameen-US-Standard-Bvoice name, defaults to "en-US-Standard-B"
genderMALEvoice gender, defaults to "MALE"
encodingMP3result encoding type, defaults to "MP3"
target_filesynthesized.mp3save synthesized output to file, defaults to "synthesized.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
text typing.Anytext to translate
source_language str Nonelanguage code, defaults to None
target_language str Nonelanguage code, defaults to None
param text:text to translate
param source_language:
 language code, defaults to None
param target_language:
 language code, defaults to None
return:translated text

Upload File

Upload a file into a bucket

Arguments

Argument Type Default value Description
bucket_name strname as string
filename strfilepath to upload file
target_name strtarget object name
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_name strname as string
files dictdictionary of object names and filepaths

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

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