Skip to content

word_cloud

A Python library and command-line tool that turns text into word cloud images.

Stars
10.5k
Forks
2.3k
Licence
MIT
Language
Python
Last update
10 months ago
Type
Library

What it is

word_cloud is a Python library that draws word clouds, images where words appear larger the more often they occur in a text. You can use it from Python code or from a command-line tool that reads a text file, or piped text, and writes a PNG image. It depends on numpy, pillow, and matplotlib, and it is MIT licensed.

  • Generate a word cloud PNG from a text file with wordcloud_cli --text mytext.txt --imagefile wordcloud.png
  • Pipe the text of a PDF through pdftotext into wordcloud_cli to make a cloud from a document
  • Run examples/simple.py as a short starting point for your own code
  • Run examples/masked.py to shape the cloud using an image mask

Great for

  • Python developers who want to add word clouds to a script or report
  • People who want a quick picture of the most common words in a document
  • Users who can run a command-line tool to turn a text file into an image
  • Anyone who wants to shape a cloud into a custom image using a mask

Not ideal for

  • People who need a point-and-click tool with no coding or terminal use, since the README describes only code and command-line usage
  • Users who need word clouds in a browser; the README does not mention a web app
  • Projects needing an installation with no compiler, since the README says a C compiler may be required if no wheel exists for your Python version
Step-by-step guide: how to use word_cloudInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Python 3.7 or newer (the README says it is tested against 3.7 through 3.13)

    Install with pip

    pip install wordcloud

    Or install with conda from conda-forge

    conda install -c conda-forge wordcloud
  2. 2

    Run it

    • Install the package with pip install wordcloud
    • Save some text to a file such as mytext.txt
    • Run wordcloud_cli --text mytext.txt --imagefile wordcloud.png
    • Open wordcloud.png to see the result
  3. 3

    Get the most out of it

    • Run wordcloud_cli --help to see all available command-line options
    • Look at examples/masked.py to shape the cloud with an image mask
    • Use the font_path setting on a WordCloud object to change the font
    • Pipe PDF text through pdftotext for documents that are not plain text

Downloads

Strengths

  • Simple to start: the README shows a pip install and a single command-line example
  • Supports masks, colors, and non-Latin scripts such as Arabic, as shown in the README examples
  • MIT licensed and widely starred, with a long-running project behind it

Trade-offs

  • Documentation in the README is brief; deeper options are only pointed to through examples and --help
  • Installation may require a C compiler if prebuilt wheels are not available for your Python version
  • It produces static images only, as far as the README shows

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.