Skip to main content

A simple Python toolkit for text preprocessing, frequency analysis, and word cloud generation.

Project description

Wordwiz — Text Frequency & Word Cloud Generator

Wordwiz is a lightweight Python toolkit for analyzing and visualizing text data.

It allows you to:

  • Preprocess and clean text
  • Generate word frequency statistics
  • Create customizable word clouds

Features

  • Beginner-friendly API
  • Automatic stopword and punctuation removal
  • Word frequency counting and summary stats
  • Beautiful word cloud visualizations with custom colors and themes
  • Works with any text source, including .txt files

Installation

Install from PyPI:

pip install wordwiz

Upgrade to the latest version:

pip install --upgrade wordwiz

Usage Example

from wordwiz import get_word_frequencies, generate_wordcloud, show_wordcloud, show_basic_stats

text = """
Python makes data analysis simple and fun.
Machine learning, natural language processing, and visualization 
are powerful with Python and its amazing ecosystem of libraries.
"""

# Step 1: Compute word frequencies
freqs = get_word_frequencies(text)

# Step 2: View text stats
show_basic_stats(freqs)

# Step 3: Create and display the word cloud
wc = generate_wordcloud(freqs)
show_wordcloud(wc)

Example Output

📊 TEXT STATS
Total words (after cleaning): 18
Unique words: 13
Top 5 most common words:
  • python: 2
  • makes: 1
  • data: 1
  • analysis: 1
  • simple: 1

🖼️ A colorful word cloud will be displayed.


Customization

Adjust visualization options:

wc = generate_wordcloud(
    freqs,
    width=1000, height=500,
    bg_color='black', cmap='magma'
)
show_wordcloud(wc)

Show only the top 30 words:

top_words = dict(freqs.most_common(30))
wc = generate_wordcloud(top_words)
show_wordcloud(wc)

Upload and preprocess a document:

file_path = "example.docx"  # or "notes.txt"
text = read_file(file_path)
clean_tokens = preprocess_text(text)

Function Reference

Function Description
preprocess_text(text) Cleans text (lowercase, tokenize, remove stopwords)
get_word_frequencies(text) Returns a Counter with word frequency counts
generate_wordcloud(freqs, ...) Creates a WordCloud object from frequencies
show_wordcloud(wc) Displays the generated word cloud
show_basic_stats(freqs, top_n=5) Prints word statistics and top frequent words

Ideal For

  • Text data exploration and EDA
  • NLP preprocessing pipelines
  • Sentiment or content analysis (tweets, reviews, blogs)
  • Academic or presentation-ready visualizations

Requirements

  • Python ≥ 3.8
  • Dependencies: nltk, wordcloud, matplotlib

Installed automatically when you run:

pip install wordwiz

License

Licensed under the MIT License.
See the full text in LICENSE.txt.


Author

Dhruv Marwal
📧 dhruvmarwal@gmail.com
🌐 GitHub


⭐ Support

If you like WordViz, please ⭐ it on GitHub — it helps others discover it!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wordwiz-0.1.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wordwiz-0.1.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file wordwiz-0.1.1.tar.gz.

File metadata

  • Download URL: wordwiz-0.1.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for wordwiz-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ad452965a0c7b3a31c1868e30ed9b62b0a89e2f29cc629f11dcace9fd08380f1
MD5 88e617ecb27310178e23b9350634b21d
BLAKE2b-256 136aca9ca8da53e5e5f86b7dcccd786840a7128b45b133229f74c0101dc2b48c

See more details on using hashes here.

File details

Details for the file wordwiz-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: wordwiz-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for wordwiz-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 36ca6079512e9b32af8ae8f810b4f68c23fd30dadf0bb2b8d3a1fab698426a17
MD5 13b144578715804d45a35647508a0279
BLAKE2b-256 f21cacd0ffa87854178436c7746e21626f049adb675d8bc2e42f8c13c475953b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page