Analyze Sentiment

Analyze sentiment in a text file

Arguments

Argument Type Default value Description
textstrNone
text_filestrNone
file_typeTextTypeTEXT
json_filestrNone
langstrNone
param text:source text
param text_file:
 source text file
param file_type:
 type of text, PLAIN_TEXT (default) or HTML
param json_file:
 json target to save result, defaults to None
param lang:language code of the source, defaults to None
return:analysis response

# For list of supported languages: # https://cloud.google.com/natural-language/docs/languages

Examples

Robot Framework

*** Tasks ***
${result}=   Analyze Sentiment  ${text}
${result}=   Analyze Sentiment  text_file=${CURDIR}${/}test.txt

Annotate Image

Annotate image

Arguments

Argument Type Default value Description
image_filestrnull
image_uristrnull
json_filestrNone
param image_file:
 source image file path
param image_uri:
 Google Cloud Storage URI
param json_file:
 json target to save result
return:detection response

Examples

Robot Framework

*** Tasks ***
${result}=   Annotate Image   image_file=${CURDIR}${/}test.png
...  json_file=${CURDIR}${/}result.json

Annotate Video

Annotate video

Arguments

Argument Type Default value Description
video_filestrNone
video_uristrNone
featuresstrNone
output_uristrNone
json_filestrNone
timeoutint300

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 given.

param video_file:
 local file path to input video
param video_uri:
 Google Cloud Storage URI to input video
param features:list of annotation features to detect, defaults to LABEL_DETECTION,SHOT_CHANGE_DETECTION
param output_uri:
 Google Cloud Storage URI to store response json
param json_file:
 json target to save result
param timeout:timeout for operation in seconds
return:annotate result

Examples

Robot Framework

*** Tasks ***
${result}=   Annotate Video   video_uri=gs://videointelligence/movie.mp4
...  features=TEXT_DETECTION,LABEL_DETECTION
...  output_uri=gs://videointelligence/movie_annotations.json
...  json_file=${CURDIR}${/}videoannotations.json

Classify Text

Classify text

Arguments

Argument Type Default value Description
textstrNone
text_filestrNone
file_typeTextTypeTEXT
json_filestrNone
langstrNone
param text:source text
param text_file:
 source text file
param file_type:
 type of text, PLAIN_TEXT (default) or HTML
param json_file:
 json target to save result, defaults to None
param lang:language code of the source, defaults to None
return:classify response

# For list of supported languages: # https://cloud.google.com/natural-language/docs/languages

Examples

Robot Framework

*** Tasks ***
${result}=   Classify Text  ${text}
${result}=   Classify Text  text_file=${CURDIR}${/}test.txt

Clear Sheet 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
return:operation result

Examples

Robot Framework

*** Tasks ***
${result}=  Clear Sheet Values  ${SHEET_ID}  A1:C1

Copy Sheet

Copy spreadsheet to target spreadsheet

Arguments

Argument Type Default value Description
sheet_idstrnull
target_sheet_idstrnull

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

param sheet_id:ID of the sheet to copy
param target_sheet_id:
 ID of the target sheet
return:operation result

Examples

Robot Framework

*** Tasks ***
${result}=  Copy Sheet   ${SHEET_ID}  ${NEW_SHEET}

Create Drive Directory

Create new directory to Google Drive

Arguments

Argument Type Default value Description
folderstrNone
parent_folderstrNone
param folder:name for the new directory
param parent_folder:
 top level directory for new directory
return:created file id

Create Sheet

Create empty sheet with a title

Arguments

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

Examples

Robot Framework

*** Tasks ***
${result}=  Create Sheet   Example Sheet

Create Storage Bucket

Create Google Cloud Storage bucket

Arguments

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

Examples

Robot Framework

*** Tasks ***
${result}=   Create Storage Bucket   visionfolder

Delete Drive File

Delete file specified by id, file dictionary or query string

Arguments

Argument Type Default value Description
file_idstrNone
file_dictdictNone
querystrNone
multiple_okboolFalse

Note. Be extra careful when calling this keyword!

param file_id:drive file id
param file_dict:
 file dictionary returned by Search Drive 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}=  Get Drive Folder Id   datafolder
${deleted}=    Delete Drive File  query=name contains '.json' and '${folder_id}' in parents
...            multiple_ok=True

Delete Storage 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

Examples

Robot Framework

*** Tasks ***
${result}=   Delete Storage Bucket   visionfolder

Delete Storage 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

Examples

Robot Framework

*** Tasks ***
${result}=   Delete Storage Files   ${BUCKET_NAME}   file1,file2

Detect Document

Detect document

Arguments

Argument Type Default value Description
image_filestrNone
image_uristrNone
json_filestrNone
param image_file:
 source image file path
param image_uri:
 Google Cloud Storage URI
param json_file:
 json target to save result
return:detection response

Examples

Robot Framework

*** Tasks ***
${result}=   Detect Document   image_file=${CURDIR}${/}test.png
...  json_file=${CURDIR}${/}result.json

Detect Labels

Detect labels in the image

Arguments

Argument Type Default value Description
image_filestrNone
image_uristrNone
json_filestrNone
param image_file:
 source image file path
param image_uri:
 source image uri
param json_file:
 json target to save result
return:detection response

Examples

Robot Framework

*** Tasks ***
${result}=   Detect Labels   image_file=${CURDIR}${/}test.png
...  json_file=${CURDIR}${/}result.json

Detect Text

Detect text in the image

Arguments

Argument Type Default value Description
image_filestrNone
image_uristrNone
json_filestrNone
param image_file:
 source image file path
param image_uri:
 Google Cloud Storage URI
param json_file:
 json target to save result
return:detection response

Examples

Robot Framework

*** Tasks ***
${result}=   Detect Text   image_file=${CURDIR}${/}test.png
...  json_file=${CURDIR}${/}result.json

Download Drive Files

Download files specified by file dictionary or query string

Arguments

Argument Type Default value Description
file_dictdictNone
querystrNone
sourcestrNone
limitintNone
timeoutfloatNone

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

param file_dict:
 file dictionary returned by Search Drive Files
param query:drive query string to find target files, defaults to None
param source:source directory where query is executed
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}=    Search Drive Files    query=name contains '.json'
FOR    ${f}    IN    @{files}
    IF  ${f}[size] < 2000
        Download Drive Files  file_dict=${f}
    END
END

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

Download Storage 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

Examples

Robot Framework

*** Tasks ***
${result}=  Download Storage Files  ${BUCKET_NAME}   test1.txt,test2.txt

Export Drive File

Export Google Drive file using Drive export links

Arguments

Argument Type Default value Description
file_idstrNone
file_dictdictNone
target_filestrNone
mimetypestrapplication/pdf
param file_id:drive file id
param file_dict:
 file dictionary returned by Search Drive Files
param target_file:
 name for the exported file
param mimetype:export mimetype, defaults to "application/pdf"
return:file path to the exported file

Examples

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

Face Detection

Detect faces

Arguments

Argument Type Default value Description
image_filestrNone
image_uristrNone
json_filestrNone
param image_file:
 source image file path
param image_uri:
 Google Cloud Storage URI
param json_file:
 json target to save result
return:detection response

Examples

Robot Framework

*** Tasks ***
${result}=   Face Detection   image_uri=gs://vision/faces.png
...  json_file=${CURDIR}${/}result.json

Get Drive Folder Id

Get file id for the folder

Arguments

Argument Type Default value Description
folderstrNone
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}=    Get Drive Folder Id   # returns Drive root folder id
${folder_id}=  Get Drive Folder Id  subdir

Get Sheet 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
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"
return:operation result

Examples

Robot Framework

*** Tasks ***
${values}=  Get Sheet Values  ${SHEET_ID}  A1:C1

Get Storage Bucket

Get Google Cloud Storage bucket

Arguments

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

Examples

Robot Framework

*** Tasks ***
${result}=   Get Bucket   visionfolder

Init Apps Script

Initialize Google Apps Script client

Arguments

Argument Type Default value Description
service_accountstrNone
credentialsstrNone
use_robocorp_vaultboolNone
scopeslistNone
token_filestrNone
param service_account:
 file path to service account file
param credentials:
 file path to credentials file
param use_robocorp_vault:
 use credentials in Robocorp Vault
param scopes:list of extra authentication scopes
param token_file:
 file path to token file

Init Drive

Initialize Google Drive client

Arguments

Argument Type Default value Description
service_accountstrNone
credentialsstrNone
use_robocorp_vaultboolNone
scopeslistNone
token_filestrNone
param service_account:
 file path to service account file
param credentials:
 file path to credentials file
param use_robocorp_vault:
 use credentials in Robocorp Vault
param scopes:list of extra authentication scopes
param token_file:
 file path to token file

Init Gmail

Initialize Google Gmail client

Arguments

Argument Type Default value Description
service_accountstrNone
credentialsstrNone
use_robocorp_vaultboolNone
scopeslistNone
token_filestrNone
param service_account:
 file path to service account file
param credentials:
 file path to credentials file
param use_robocorp_vault:
 use credentials in Robocorp Vault
param scopes:list of extra authentication scopes
param token_file:
 file path to token file

Init Natural Language

Initialize Google Cloud Natural Language client

Arguments

Argument Type Default value Description
service_accountstrNone
use_robocorp_vaultboolNone
token_filestrNone
param service_account:
 file path to service account file
param use_robocorp_vault:
 use credentials in Robocorp Vault
param token_file:
 file path to token file

Init Sheets

Initialize Google Sheets client

Arguments

Argument Type Default value Description
service_accountstrNone
credentialsstrNone
use_robocorp_vaultboolNone
scopeslistNone
token_filestrNone
param service_account:
 file path to service account file
param credentials:
 file path to credentials file
param use_robocorp_vault:
 use credentials in Robocorp Vault
param scopes:list of extra authentication scopes
param token_file:
 file path to token file

Init Speech To Text

Initialize Google Cloud Speech to Text client

Arguments

Argument Type Default value Description
service_accountstrNone
use_robocorp_vaultboolNone
token_filestrNone
param service_account:
 file path to service account file
param use_robocorp_vault:
 use credentials in Robocorp Vault
param token_file:
 file path to token file

Init Storage

Initialize Google Cloud Storage client

Arguments

Argument Type Default value Description
service_accountstrNone
use_robocorp_vaultboolNone
token_filestrNone
param service_account:
 file path to service account file
param use_robocorp_vault:
 use credentials in Robocorp Vault
param token_file:
 file path to token file

Init Text To Speech

Initialize Google Cloud Text to Speech client

Arguments

Argument Type Default value Description
service_accountstrNone
use_robocorp_vaultboolNone
token_filestrNone
param service_account:
 file path to service account file
param use_robocorp_vault:
 use credentials in Robocorp Vault
param token_file:
 file path to token file

Init Translation

Initialize Google Cloud Translation client

Arguments

Argument Type Default value Description
project_identifierstrnull
service_accountstrNone
use_robocorp_vaultboolNone
token_filestrNone
param project_identifier:
 identifier for Translation project
param service_account:
 file path to service account file
param use_robocorp_vault:
 use credentials in Robocorp Vault
param token_file:
 file path to token file

Init Video Intelligence

Initialize Google Cloud Video Intelligence client

Arguments

Argument Type Default value Description
service_accountstrNone
use_robocorp_vaultboolNone
token_filestrNone
param service_account:
 file path to service account file
param use_robocorp_vault:
 use credentials in Robocorp Vault
param token_file:
 file path to token file

Init Vision

Initialize Google Cloud Vision client

Arguments

Argument Type Default value Description
service_accountstrNone
use_robocorp_vaultboolNone
token_filestrNone
param service_account:
 file path to service account file
param use_robocorp_vault:
 use credentials in Robocorp Vault
param token_file:
 file path to token file

Insert Sheet 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
return:operation result

Examples

Robot Framework

*** Tasks ***
${values}   Evaluate   [[11, 12, 13], ['aa', 'bb', 'cc']]
${result}=  Insert Sheet Values   ${SHEET_ID}  A:B  ${values}
${result}=  Insert Sheet Values   ${SHEET_ID}  A:B  ${values}  ROWS

List Messages

List messages

Arguments

Argument Type Default value Description
user_idstrnull
querystrnull
folder_namestrNone
label_idslistNone
max_resultsintNone
include_jsonboolFalse
include_spamboolFalse
param user_id:user's email address. The special value me can be used to indicate the authenticated user.
param query:message query
param folder_name:
 path where attachments are saved, default current directory
param label_ids:
 message label ids
param max_results:
 maximum number of message to return
param include_json:
 include original response json
param include_spam:
 include messages from SPAM and TRASH
return:messages

Examples

*** Tasks ***
${messages}=    List Messages    me
...    from:mika@robocorp.com
...    folder_name=${CURDIR}${/}target
...    include_json=True
FOR    ${msg}    IN    @{messages}
    Log Many    ${msg}
END

List Storage Buckets

List Google Cloud Storage buckets

return:list of buckets

Examples

Robot Framework

*** Tasks ***
${buckets}=   List Storage Buckets
FOR  ${bucket}  IN   @{buckets}
    Log  ${bucket}
END

List Storage 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

Examples

Robot Framework

*** Tasks ***
${files}=   List Storage Files  ${BUCKET_NAME}
FOR  ${bucket}  IN   @{files}
    Log  ${file}
END

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

Examples

Robot Framework

*** Tasks ***
${result}=   List Supported Voices   en-US

Move Drive File

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

Arguments

Argument Type Default value Description
file_idstrNone
file_dictdictNone
querystrNone
sourcestrNone
targetstrNone
multiple_okboolFalse
param file_id:drive file id
param file_dict:
 file dictionary returned by Search Drive Files
param query:drive query string to find target file, needs to match 1 file
param source:name of the folder to move file from, is by default drive's root folder id
param target:name of the folder to move file into, is by default drive's root folder id
param multiple_ok:
 if True then moving more than 1 file
return:list of file ids

Examples

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

Recognize Text From Audio

Recognize text in the audio file

Arguments

Argument Type Default value Description
audio_filestrNone
audio_uristrNone
encodingstrNone
language_codestren_US
audio_channel_countint2
sample_rateintNone
param audio_file:
 local audio file path
param audio_uri:
 Google Cloud Storage URI
param encoding:audio file encoding
param language_code:
 language in the audio
param audio_channel_count:
 number of audio channel
param sample_rate:
 rate in hertz, for example 16000
return:recognized texts

Examples

Robot Framework

*** Tasks ***
${result}=  Recognize Text From Audio   audio_file=${CURDIR}${/}test.mp3

Run Script

Run the Google Apps Script function

Arguments

Argument Type Default value Description
script_idstrnull
function_namestrnull
parametersdictNone
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}

Search Drive Files

Search Google Drive for files matching query string

Arguments

Argument Type Default value Description
querystrNone
recurseboolFalse
sourcestrNone
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 source:source directory where query is executed
return:list of files

Examples

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

Send Message

Send an email message.

Arguments

Argument Type Default value Description
senderstrnull
tostrnull
subjectstrnull
message_textstrnull
attachmentslistNone
param sender:message sender
param to:message recipient
param subject:message subject
param message_text:
 message body text
param attachment:
 list of files to add as message attachments
return:sent message

Examples

*** Tasks ***
${attachments}=  Create List
...  ${CURDIR}${/}random.txt
...  ${CURDIR}${/}source.png
Send Message    me
...    mika@robocorp.com
...    message subject
...    body of the message
...    ${attachments}

Set Robocorp Vault

Set Robocorp Vault name and secret key name :param vault_name: Robocorp Vault name :param vault_secret_key: Robocorp Vault secret key name

Arguments

Argument Type Default value Description
vault_namestrNone
vault_secret_keystrNone
auth_typestrserviceaccount

Set Robocorp Vault name and secret key name :param vault_name: Robocorp Vault name :param vault_secret_key: Robocorp Vault secret key name

Synthesize Speech

Synthesize speech synchronously

Arguments

Argument Type Default value Description
textstrnull
languagestren-US
namestren-US-Standard-B
genderstrMALE
encodingstrMP3
target_filestrsynthesized.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

Examples

Robot Framework

*** Tasks ***
${result}=   Synthesize Speech   ${text}

Translate

Translate text

Arguments

Argument Type Default value Description
textlist, strnull
source_languagestrNone
target_languagestrNone
mime_typeTextTypeNone
param text:text to translate
param source_language:
 language code
param target_language:
 language code
param mime_type:
 text or html
return:translated text

Examples

Robot Framework

*** Tasks ***
${result}=   Translate   ${TEXT}  target_language=de

Update Drive File

Update file specified by id, file dictionary or query string

Arguments

Argument Type Default value Description
file_idstrNone
file_dictdictNone
querystrNone
sourcestrNone
actionUpdateActionstar
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 source:source directory where query is executed
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}=  Get Drive Folder Id   datafolder
${updated}=    Update Drive File  query=name contains '.json' and '${folder_id}' in parents
...            action=star
...            multiple_ok=True

Update Sheet 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
return:operation result

Examples

Robot Framework

*** Tasks ***
${row}  Evaluate   [[22, 33 ,44]]
${result}=  Update Sheet Values  ${SHEET_ID}  A6:C6  ${row}   ROWS

Upload Drive File

Upload files into Drive

Arguments

Argument Type Default value Description
filenamestrNone
folderstrNone
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
return:uploaded file id

Examples

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

Upload Storage 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

Examples

Robot Framework

*** Tasks ***
Upload Storage File  ${BUCKET_NAME}
...   ${CURDIR}${/}test.txt    test.txt

Upload Storage 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

Examples

Robot Framework

*** Tasks ***
${files}=   Create Dictionary
...   test1.txt   ${CURDIR}${/}test1.txt
...   test2.txt   ${CURDIR}${/}test2.txt
Upload Storage Files   ${BUCKET_NAME}   ${files}