A text analysis tool
Project description
text-lens
Turn any block of text into clear, insight-packed charts.
Demo
Watch a quick preview below (GIF)
🔹 Preview (GIF)
Features
Core Features
- Text Analysis Engine: Analyzes word count, sentence count, unique words, and estimated reading time
- Interactive Text Input: Multi-line text box with scrollbar and custom right-click copy/paste menu
- Visual Data Charts: Generate bar charts, histograms, pie charts, and sentiment analysis graphs from text data
- Advanced Statistics: Calculate reading level, complexity scores, lexical diversity, OpenAI token counts, and more
- Dynamic Interface: Switches between input view and various visualization displays with state-aware controls
- Clear Functionality: One-click clearing of both input and output areas
Visualization Features
- Top Words Chart: Horizontal bar chart showing 10 most frequent words in text
- Sentence Length Distribution: Histogram displaying words per sentence patterns
- Punctuation Breakdown: Pie chart analyzing usage of periods, commas, questions, exclamations
- Sentiment Analysis: Line chart tracking emotional trajectory across sentences
- Advanced Stats: In-depth metrics including:
- Readability scores (Flesch-Kincaid, Gunning Fog, SMOG)
- OpenAI token count with cl100k_base encoding
- Vocabulary diversity metrics (Type-Token Ratio, rare words)
- Sentence pattern analysis (most/least common lengths)
- Word usage statistics (most/least common lengths)
- Punctuation density per 100 words
- Readability scores (Flesch-Kincaid, Gunning Fog, SMOG)
Installation
Prerequisites
- Python 3.8 or higher
Install with pip
pip install -r https://raw.githubusercontent.com/adrirubio/text-lens/main/requirements.txt
pip install --index-url https://test.pypi.org/simple/ text-lens
Install with uv
uv pip install -r https://raw.githubusercontent.com/adrirubio/text-lens/main/requirements.txt
uv pip install --index-url https://test.pypi.org/simple/ text-lens
Run the application
text-lens
Install from source
-
Clone the repository
git clone https://github.com/adrirubio/text-lens.git cd text-lens
-
Install dependencies
pip install -r requirements.txt
-
Run the application
python app.py
Optional: Global Hotkey Setup (F5)
To launch Text Lens with the F5 key from anywhere on your system
-
Start the hotkey daemon
python hotkey_daemon.py -
Keep it running in the background
- The daemon will listen for F5 key presses
- Press F5 anytime to launch Text Lens
- Press Ctrl-C to stop the daemon
-
Auto-start on boot (Linux) Add to your startup applications or create a systemd service:
# Create a systemd service file sudo nano /etc/systemd/system/text-lens-hotkey.service
Add the following content:
[Unit] Description=Text Lens Hotkey Daemon After=graphical.target [Service] Type=simple ExecStart=/usr/bin/python3 /path/to/text-lens/hotkey_daemon.py Restart=on-failure User=YOUR_USERNAME [Install] WantedBy=default.target
Enable and start service:
sudo systemctl enable text-lens-hotkey sudo systemctl start text-lens-hotkey
Usage
-
Launch the app using either:
- Direct command:
python app.py - F5 hotkey (if daemon is running)
- Direct command:
-
Enter your text in the large text area
- Type directly or paste from clipboard
- Right-click for copy/paste menu
-
Get instant analysis with the Analyze button
- Word count and reading time
- Sentence statistics
- Unique word count
-
Explore visualizations via the dropdown menu:
- Top Words: See your most common words
- Sentence Lengths: Understand your writing rhythm
- Punctuation: Analyze your punctuation patterns
- Sentiment: Track emotional flow across sentences
- Advanced Stats: Deep dive into readability metrics
-
Clear and start over with the Clear button
Screenshots
Home:
Copy and Paste:
Basic Insights:
Top Words:
Sentence Length:
Punctuation:
Sentiment:
Advanced Stats:
Goodbye:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file text_lens-1.0.0.tar.gz.
File metadata
- Download URL: text_lens-1.0.0.tar.gz
- Upload date:
- Size: 4.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
259d9d112dde29a81b6a539954a73d6feed7591353305800bdf3aebf18be93ab
|
|
| MD5 |
6861aca83032e64142d738aab6ed9e1c
|
|
| BLAKE2b-256 |
2827b0edade41a1db2e0e8eaffa4fbc0ef3bc1e5013710fc70fb64b84d5008b1
|
File details
Details for the file text_lens-1.0.0-py3-none-any.whl.
File metadata
- Download URL: text_lens-1.0.0-py3-none-any.whl
- Upload date:
- Size: 2.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3787f874d19438c5c21e091a0e078844b291f76df8886d4e4d3a82dc1da51a1a
|
|
| MD5 |
6a80134e10952bae03684764813221b3
|
|
| BLAKE2b-256 |
a5b47b8fc3b28b30d7d52abde02b2643b904e75779539992ee34a2a4352aed7c
|