Skip to main content

textdivider

Split long text into chunks without breaking words. Useful for social media, messaging platforms, or UI components with length limits.

Installation

pip install textdivider

Features

✅ Split text by max characters, preserving whole words

✅ Optional numbering (e.g. "1/3: ...")

✅ Split text by max number of words

Usage

from textdivider import split_text, split_by_words

text = "This is a long message that you want to divide into parts without cutting words in the middle."

# Split by character count
chunks = split_text(text, max_length=50)
print(chunks)

# With numbering
numbered = split_text(text, max_length=50, numbered=True)
print(numbered)

# Split by word count
word_chunks = split_by_words(text, max_words=5)
print(word_chunks)

Metadata

Release files for textdivider 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for textdivider 0.2.1
File Size Uploaded Provenance Actions
textdivider-0.2.1.tar.gz 2.2 kB Without provenance Details for textdivider-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for textdivider 0.2.1
File Interpreter ABI Platform Actions
textdivider-0.2.1-py3-none-any.whl Python 3 none any Details for textdivider-0.2.1-py3-none-any.whl

Total release size: 4.6 kB

Release files / textdivider-0.2.1.tar.gz

Download URL textdivider-0.2.1.tar.gz
Size 2.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a21496b1a7b49c0abb7d6e35a1fcbf117dee0c1051101fd2cea1e464ebc20b04
BLAKE2b-256 checksum
How to use checksums
3ff80436f977eb84966c3017eef0629adab19725aa9365da3634d011553abf72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Release files / textdivider-0.2.1-py3-none-any.whl

Download URL textdivider-0.2.1-py3-none-any.whl
Size 2.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a2703dfe62ebc7dd79b683fc7cb129d9f14c420f21902ca35bcc31d1e9559aa9
BLAKE2b-256 checksum
How to use checksums
bfd3c26c3f868471145d1ec9f0728b447a33c6ffc67aeb04121793808638bf2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.12

Security for textdivider 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page