Skip to main content

textwrapper

Installation

pip install texttool

Function signature

def wrap(
        # the text to wrap
        text,
        
        # a line's minimum width before wrapping
        min_width=1,
        
        # the max width of lines. default is shell width
        max_width=shutil.get_terminal_size().columns,
        
        # number of columns to pad off of max_width
        padding_size=0,
        
        # a string to start all wrapped lines with
        prefix='',
        
        # a string to end all lines which wrap with
        suffix='',
        
        # string of characters, in priority order, to wrap on
        delimiters=' ,.!',
        ):

Usage

import texttool

texttool.wrap('Lorem ipsum dolor sit amet.', max_width=6)
Hi
there,
 nice
to
foo
your
bar.

Metadata

Release files for texttool 0.0.3

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

Source distribution (sdist)

Source distribution for texttool 0.0.3
File Size Uploaded
texttool-0.0.3.tar.gz 3.6 kB Details

Built distribution (wheel)

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

Total release size: 7.7 kB

Release files / texttool-0.0.3.tar.gz

Download URL texttool-0.0.3.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9be1cde2e61502b3d8cce57114b35b710a885d43535bb00753aed021c4064cd3
BLAKE2b-256 checksum
How to use checksums
6e983a544224c5ab9f15d8b2921469f420c48c19cdfb74b2d2bdc616b0973644
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/57.0.0 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.9.0

Release files / texttool-0.0.3-py3-none-any.whl

Download URL texttool-0.0.3-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dfc731360096aadeb90af8b907b85f34a11f8da12411b509f5051ab16056f8af
BLAKE2b-256 checksum
How to use checksums
595c2f2276983c329d784ffdda55fdd7b8a4e19aa5d03ce984d44fab6f473fc7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/57.0.0 requests-toolbelt/0.9.1 tqdm/4.54.0 CPython/3.9.0

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

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