Smart sentence-based text clipper that respects meaning and punctuation.
Project description
cliptext
Smart sentence-based text clipper for Python.
Cuts long text without breaking sentences. Great for YouTube descriptions, SEO titles, social posts, and more.
✨ Features
- Clips text at punctuation (".", "!", "?")
- Keeps sentences whole — no awkward mid-cut phrases
- Adds
...if text is trimmed - Simple, lightweight — no dependencies
📦 Installation
pip install cliptext
🧠 Usage
from cliptext import clip_text
text = "This is a long description. It has many sentences! But not all will fit?"
short = clip_text(text, limit=50)
print(short) # Output: "This is a long description..."
clip_text(text: str, limit: int) -> str
| Parameter | Type | Description |
|---|---|---|
text |
str |
The text you want to clip |
limit |
int |
Max number of characters allowed |
👨💻 Author
Made with ❤️ by Vivek Appu
📝 License
MIT License – free to use, modify, and share.
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 cliptext-0.1.0.tar.gz.
File metadata
- Download URL: cliptext-0.1.0.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c96a995b3840a8d671f6b63af0379c66d88f19d397ad7bd3643fc375e9816458
|
|
| MD5 |
83d143e1f215d4f964847ddcb272a8b4
|
|
| BLAKE2b-256 |
c14755639ceb9650ccb60cddd65c0c29ba61ac8b3f0527c9679e76d14a3d09d9
|
File details
Details for the file cliptext-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cliptext-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
073b3e096b25f1eea945b7a9d3278bc02db3aea7e35e1d39954818ea18c2e01c
|
|
| MD5 |
173089843bb5951e389b9f4d194ed1ec
|
|
| BLAKE2b-256 |
8a54d0ca4d4721c136578d1376757565a8938499c5cb80408ada2f3b79cfa181
|