Skip to content

nguyenminhduc9988/texttools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

texttools

Collection of text processing utilities — zero dependencies, stdlib only.

Installation

pip install texttools

Functions

Function Description
slugify(text) Convert text to a URL-safe slug
truncate(text, max_len, suffix) Smart truncation at word boundary
strip_html(text) Remove all HTML tags
word_count(text) Count words
reading_time(text, wpm) Estimated reading time in minutes
extract_emails(text) Find all email addresses
extract_urls(text) Find all URLs
mask_sensitive(text, mask_char) Mask emails, phones, and SSNs
table_format(headers, rows, padding) Format as aligned text table
json_safe(text) Make text JSON-safe (escape control chars)
normalize_whitespace(text) Collapse multiple whitespace
camel_to_snake(text) Convert CamelCase to snake_case
snake_to_camel(text) Convert snake_case to CamelCase
count_syllables(text) Estimate syllable count for reading level
fingerprint(text) Create fuzzy hash for near-duplicate detection

Quick Start

from texttools import slugify, truncate, reading_time

slugify("Hello World!")          # "hello-world"
truncate("A long text...", 15)   # "A long text..."
reading_time("word " * 400)      # 2 (minutes at 200 wpm)

Requirements

  • Python 3.8+
  • No external dependencies

License

MIT


Built by BigWinner.work — AI Tools & Tax Consulting Join our Discord for community support

About

Collection of text processing utilities for Python — zero dependencies, stdlib only

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages