Create word cloud images easily and quickly from text files, with mask support, filtering, and a flexible command-line interface.
- Automatically reads all
.txtfiles in the current folder by default - Supports custom filename patterns
- Optional mask images for shaped word clouds
- Built-in filter terms + user-defined exclusions
- Optionally include or exclude stopwords
- Outputs a 1080p word cloud image and a text file containing word frequencies
- Simple command-line interface built with
click
Clone the repository:
git clone https://github.com/yourusername/easy-wordcloud.git
cd easy-wordcloudInstall dependencies:
pip install -r requirements.txtWithout any arguments, the tool:
- Reads all
.txtfiles in the current directory - Looks for mask.png
- Outputs both versions (with and without stopwords)
python easy-wordcloud.pyThis generates:
image_with_stopwords.png
image_without_stopwords.png
words_with_stopwords.txt
words_without_stopwords.txt
python easy-wordcloud.py --folder ./emailspython easy-wordcloud.py --pattern "*.log"
python easy-wordcloud.py --pattern "email_*.txt"python easy-wordcloud.py --mask ./shapes/circle.pngpython easy-wordcloud.py --output-dir ./out/python easy-wordcloud.py --exclude-stopwordspython easy-wordcloud.py --include-stopwordspython easy-wordcloud.py -t confidential -t regards -t thankspython easy-wordcloud.py \
--folder ./example \
--pattern "*.txt" \
--mask ./example/mask.png \
--output-dir results \
--max-words 200 \
-t hi -t thanks \
--exclude-stopwordsBy default, the tool processes:
*.txt
mask.png
in the current working directory.
You can override these with --folder, --pattern, and --mask.
- All text files matching the chosen pattern are read and merged.
- Only alphabetic words are extracted.
- Stopwords and filter terms are removed (depending on flags).
- Word frequencies are counted.
- A word cloud is generated using your mask (if provided).
- A PNG image and a text file of frequencies are written to the output directory.
Depending on what you choose to generate, you may get:
image_with_stopwords.png
image_without_stopwords.png
words_with_stopwords.txt
words_without_stopwords.txt