Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st. We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here. Need help or have questions? Drop us a line at [email protected]
Created on 08-06-201701:40 PM - edited 08-17-201911:47 AM
Python Word Cloud
Integrating existing Python libraries and scripts is very easy in Apache NiFi. I add the library for both version of Python I have on my system, while moving all new scripts to the 3.x branch.
For use in NiFi, I wrap my call with a shell script wc.sh
echo $1 | tr " " "\n" | wordcloud_cli.py
This will build a PNG for me that I can store in a file system or in HDFS, I updated the filename to add png at the end. This will take a parameter to a shell script (our Tweet) and convert it into words usable for a word cloud. You can use other sources or other methods of splitting words.
I am pulling twitter messages, so I use ReplaceText to replace the flow file with ${msg} which is just the tweet.