Skip to main content

A text analysis tool

Project description

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 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

  1. Clone the repository

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

    pip install -r requirements.txt
    
  3. Run the application

    python app.py
    

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 app.py
    • 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

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

text_lens-1.0.0.tar.gz (4.3 MB view details)

Uploaded Source

Built Distribution

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

text_lens-1.0.0-py3-none-any.whl (2.2 MB view details)

Uploaded Python 3

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

Hashes for text_lens-1.0.0.tar.gz
Algorithm Hash digest
SHA256 259d9d112dde29a81b6a539954a73d6feed7591353305800bdf3aebf18be93ab
MD5 6861aca83032e64142d738aab6ed9e1c
BLAKE2b-256 2827b0edade41a1db2e0e8eaffa4fbc0ef3bc1e5013710fc70fb64b84d5008b1

See more details on using hashes here.

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

Hashes for text_lens-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3787f874d19438c5c21e091a0e078844b291f76df8886d4e4d3a82dc1da51a1a
MD5 6a80134e10952bae03684764813221b3
BLAKE2b-256 a5b47b8fc3b28b30d7d52abde02b2643b904e75779539992ee34a2a4352aed7c

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