Skip to main content

text-lens

Turn any block of text into clear, insight-packed charts.

text-lens-logo

Demo

Watch a quick preview below (GIF)

🔹 Preview (GIF)

Text Lens - Preview

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

Installation

Prerequisites

  • Python 3.8 or higher

Install from PyPI

pip install text-lens

Or with uv:

uv pip install text-lens

Run the application

python -m text_lens

Or after installation:

text-lens

Install from source

  1. Clone the repository

    git clone https://github.com/adrirubio/text-lens.git
    cd text-lens
    
  2. Install the package

    pip install .
    
  3. Run the application

    python -m text_lens
    

Optional: Global Hotkey Setup (F5)

To launch Text Lens with the F5 key from anywhere on your system

  1. Start the hotkey daemon

    python hotkey_daemon.py
    
  2. 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
  3. 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

  1. Launch the app using either:

    • Direct command: python -m text_lens or text-lens
    • F5 hotkey (if daemon is running)
  2. Enter your text in the large text area

    • Type directly or paste from clipboard
    • Right-click for copy/paste menu
  3. Get instant analysis with the Analyze button

    • Word count and reading time
    • Sentence statistics
    • Unique word count
  4. 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
  5. Clear and start over with the Clear button

Screenshots

Home:
Home

Copy and Paste:
Copy and Paste

Basic Insights:
Basic Insights

Top Words:
Top Words

Sentence Length:
Sentence Length

Punctuation:
Punctuation

Sentiment:
Sentiment

Advanced Stats:
Advanced Stats

Goodbye:
Goodbye

Release files for text-lens 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for text-lens 1.0.1
File Size Uploaded
text_lens-1.0.1.tar.gz 4.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for text-lens 1.0.1
File Interpreter ABI Platform
text_lens-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 6.5 MB

Release files / text_lens-1.0.1.tar.gz

Download URL text_lens-1.0.1.tar.gz
Size 4.3 MB
Tags Source
SHA-256 checksum
How to use checksums
01104ca784e2516a16f9f0a4787802c5103b16786e7c4dd6c869e1e3c00c0f7f
BLAKE2b-256 checksum
How to use checksums
821d6c01668f8492124d0723ff6335e4d1de828b9e1507564c55f737cd33ce4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.19

Release files / text_lens-1.0.1-py3-none-any.whl

Download URL text_lens-1.0.1-py3-none-any.whl
Size 2.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
9d007dfdd5ec48c29cefdf4325eb88ef9c3471a50cde0edea4da06de6f2f27d4
BLAKE2b-256 checksum
How to use checksums
e15168cb5a0777d4a32cbbccd79788b50f96b0d02fd1c368d06b524698bebed5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.19

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page