Skip to main content

Library for wrapping text to widths

Project description

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.

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

texttool-0.0.3.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

texttool-0.0.3-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file texttool-0.0.3.tar.gz.

File metadata

  • Download URL: texttool-0.0.3.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for texttool-0.0.3.tar.gz
Algorithm Hash digest
SHA256 9be1cde2e61502b3d8cce57114b35b710a885d43535bb00753aed021c4064cd3
MD5 ed65a1f777acf76a191f644cb321e987
BLAKE2b-256 6e983a544224c5ab9f15d8b2921469f420c48c19cdfb74b2d2bdc616b0973644

See more details on using hashes here.

File details

Details for the file texttool-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: texttool-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for texttool-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 dfc731360096aadeb90af8b907b85f34a11f8da12411b509f5051ab16056f8af
MD5 e49f74c4eaa90a91e3e1c9c195b2f4c7
BLAKE2b-256 595c2f2276983c329d784ffdda55fdd7b8a4e19aa5d03ce984d44fab6f473fc7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page