Skip to content
A little word cloud generator in Python
Python
Branch: master
Clone or download

Latest commit

amueller Merge pull request #529 from carlgieringer/feature/528-bigram-stopwor…
…d-aware

Fix #528: make bigram generation stopword aware
Latest commit d1ec087 Apr 9, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci ci: remove python3.4 from CircleCI Apr 8, 2020
.github/worksflows try to add circle link to docs Apr 8, 2020
doc Merge pull request #526 from amueller/doc_build_style Apr 8, 2020
examples add docstring to parrot example Nov 6, 2019
test Handle collocation correctly Apr 8, 2020
wordcloud Add file encoding Apr 8, 2020
.gitattributes setup: Simplify release process using "versioneer" Jul 25, 2018
.gitignore gitignore: added pycharm again, manually readded doc/... Jan 31, 2019
.travis.yml ci: remove python3.4 from travis Apr 8, 2020
CONTRIBUTING.md Handle collocation correctly Apr 8, 2020
ISSUE_TEMPLATE.md add issue template Nov 20, 2017
LICENSE Cleaned it up a little bit. Dec 11, 2013
MANIFEST.in setup: Simplify release process using "versioneer" Jul 25, 2018
README.md pep8 Nov 6, 2019
appveyor.yml ci: remove python3.4 from AppVeyor Apr 8, 2020
requirements-dev.txt requirements: Address pytest regression installing pytest<5.4.0 Apr 8, 2020
requirements.txt requirements: Re-add matplotlib as runtime requirements Jul 26, 2018
scikit-ci.yml circleci: Fix workspace issue avoiding to generate deprecated egg Jul 24, 2018
setup.cfg setup: Simplify release process using "versioneer" Jul 25, 2018
setup.py Require matplotlib. Jan 30, 2019
versioneer.py Fix deprecation warnings due to invalid escape sequences. Feb 1, 2020

README.md

licence DOI

Linux macOS Windows
PyPI CircleCI TravisCI AppVeyor

word_cloud

A little word cloud generator in Python. Read more about it on the blog post or the website.

The code is tested against Python 2.7, 3.4, 3.5, 3.6 and 3.7.

Installation

If you are using pip:

pip install wordcloud

If you are using conda, you can install from the conda-forge channel:

conda install -c conda-forge wordcloud

Installation notes

wordcloud depends on numpy and pillow.

To save the wordcloud into a file, matplotlib can also be installed. See examples below.

If there are no wheels available for your version of python, installing the package requires having a C compiler set up. Before installing a compiler, report an issue describing the version of python and operating system being used.

Examples

Check out examples/simple.py for a short intro. A sample output is:

Constitution

Or run examples/masked.py to see more options. A sample output is:

Alice in Wonderland

Getting fancy with some colors: Parrot with rainbow colors

Command-line usage

The wordcloud_cli tool can be used to generate word clouds directly from the command-line:

$ wordcloud_cli --text mytext.txt --imagefile wordcloud.png

If you're dealing with PDF files, then pdftotext, included by default with many Linux distribution, comes in handy:

$ pdftotext mydocument.pdf - | wordcloud_cli --imagefile wordcloud.png

In the previous example, the - argument orders pdftotext to write the resulting text to stdout, which is then piped to the stdin of wordcloud_cli.py.

Use wordcloud_cli --help so see all available options.

Licensing

The wordcloud library is MIT licenced, but contains DroidSansMono.ttf, a true type font by Google, that is apache licensed. The font is by no means integral, and any other font can be used by setting the font_path variable when creating a WordCloud object.

You can’t perform that action at this time.