Skip to main content

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

🆕 What's New in 0.1.1

  • ✅ Now supports partial word clipping if sentence is too long
  • ✅ Won’t break words unless absolutely needed (e.g., if first word is too long)

👨‍💻 Author

Made with ❤️ by Vivek Appu


📝 License

MIT License – free to use, modify, and share.

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

cliptext-0.1.1.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

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

cliptext-0.1.1-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file cliptext-0.1.1.tar.gz.

File metadata

  • Download URL: cliptext-0.1.1.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for cliptext-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1f4f542a80a8fefc02f4287b457e199276cfb1eb558b1db69f607d0f3c22ee9e
MD5 f39bf19fa243b8deaf60b000e8fb73a2
BLAKE2b-256 f3c3b05f04948dd0ad4505d589e5c36fc058816ecae83b74cca0396f251067ec

See more details on using hashes here.

File details

Details for the file cliptext-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cliptext-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for cliptext-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e9176350c6df5e481e8e432522e2ed1aa5d0b080ddb01dfa6b9d2fa921351e34
MD5 219b70c754e3115194314f4ff6b7d25c
BLAKE2b-256 fa40f4680ea634e7033682e8654f3365e46222381683c524b365a7f536dbbc7e

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