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

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.1.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.1-py3-none-any.whl (2.2 MB view details)

Uploaded Python 3

File details

Details for the file text_lens-1.0.1.tar.gz.

File metadata

  • Download URL: text_lens-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 01104ca784e2516a16f9f0a4787802c5103b16786e7c4dd6c869e1e3c00c0f7f
MD5 762462294f90b0985fce11b56d985cee
BLAKE2b-256 821d6c01668f8492124d0723ff6335e4d1de828b9e1507564c55f737cd33ce4b

See more details on using hashes here.

File details

Details for the file text_lens-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: text_lens-1.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9d007dfdd5ec48c29cefdf4325eb88ef9c3471a50cde0edea4da06de6f2f27d4
MD5 b279a0f336734b50f7d25212eb8c649b
BLAKE2b-256 e15168cb5a0777d4a32cbbccd79788b50f96b0d02fd1c368d06b524698bebed5

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