14

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 2

22

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
  • 3
    Please add some content instead of just posting links Jan 16, 2015 at 3:35
  • 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 your PATH 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 with python -V). Here is a guide for adding a directory to the PATH environment variable on a Mac; "Method #1" works for Linux, too.
    – Kevin E
    Oct 25, 2019 at 3:24
8
# 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

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .