🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

txwrap

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

txwrap

Small helpers around the stdlib textwrap module: terminal-aware wrapping, column alignment, and simple CLI formatting.

pipPyPI
Version
1.0.1
Maintainers
1

txwrap

Thin utilities on top of Python's textwrap and shutil.get_terminal_size:

  • format_block — wrap text to terminal width (or a fixed width) with optional indent
  • align_columns — pad list items into aligned columns
  • dedent / fill — thin wrappers around textwrap.dedent / textwrap.fill
  • format_header / format_status — simple CLI banners and status lines

Installation

pip install txwrap

Usage

from txwrap import format_block, align_columns, format_header

print(format_block("Long line of text...", indent=2))
print(align_columns(["a", "bb", "ccc"]))
print(format_header("Done"))

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts