I'd like to create a word cloud on the linux command-line, similar to wordle and similar services. How can I do that? I have plain-text files and I'd like to create a word-cloud for each one.
2 Answers
See this word cloud generator written in Python:
https://github.com/amueller/word_cloud
It can be easily installed with pip using this command:
pip install wordcloud
-
3
-
I had to use
sudo pip install wordcloud
. From there,wordcloud_cli.py
worked from the command line. Thanks for the answer. Sep 26, 2017 at 17:33 -
@6005
pip install --user wordcloud
will work fine, if you also update yourPATH
variable to include$HOME/.local/bin
(on Linux) or$HOME/Library/Python/X.Y/bin
(on Mac), where X.Y are the major and minor versions of your Python version (check withpython -V
). Here is a guide for adding a directory to thePATH
environment variable on a Mac; "Method #1" works for Linux, too.– Kevin EOct 25, 2019 at 3:24
# install python package
pip install wordcloud
# show help message
wordcloud_cli --help
# a simple demo
wordcloud_cli --background white --text input.txt --imagefile output.png