How to create and send "wordcloud" using Kryon RPA and send it in an email body

  • 2 March 2020
  • 0 replies
  • 12 views

25713iABE418C09DE9E227.jpgProduct: Kryon RPA

Title: How to create and send "wordcloud" using Kryon RPA and send it in an email body

Product Version:19.1+

Components: Kryon Studio/Email account/ Python

Article Status: Completed

 

Steps:

 

1- Install following library to Kryon python interpreter:

 

python -m pip install --upgrade pip

 

python -m pip install wordcloud

 

python -m pip install pandas

 

 

2- Following python script:

 

Please use below code snippet in Run Script AC and select language as Python...

 

##------Python script starts here -------##

# Python program to generate WordCloud 

 

# importing all necessary modules 

from wordcloud import WordCloud, STOPWORDS 

import matplotlib.pyplot as plt 

import pandas as pd 

 

# Reads 'Youtube04-Eminem.csv' file 

df = pd.read_csv(r'C: empYoutube04-Eminem.csv', encoding ='latin-1') 

 

comment_words = ' '

stopwords = set(STOPWORDS) 

 

# iterate through the csv file 

for val in df.CONTENT: 

 

# typecaste each val to string 

val = str(val) 

 

# split the value 

tokens = val.split() 

 

# Converts each token into lowercase 

for i in range(len(tokens)): 

tokens[i] = tokens[i].lower() 

 

for words in tokens: 

comment_words = comment_words + words + ' '

 

 

wordcloud = WordCloud(width = 800, height = 800, 

background_color ='white', 

stopwords = stopwords, 

min_font_size = 10).generate(comment_words) 

 

# plot the WordCloud image 

plt.figure(figsize = (8, 8), facecolor = None) 

plt.imshow(wordcloud) 

plt.axis('off') 

plt.tight_layout(pad = 0) 

plt.savefig('C:\temp\kryonread.png')

 

##------Python script ends here -------##

 

For sending email as an image in body please follow below article where you will need to use Kryon Studio :)

 

https://community.kryonsystems.com/s/question/0D51o00006jCgkTCAS/how-to-insert-image-in-email-body

 

Feel free to post you question if you have any doubt.

 

 

Regards,

Zakir Khan


0 replies

Be the first to reply!

Reply