Skip to main content

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

This project has been quarantined.

PyPI Admins need to review this project before it can be restored. While in quarantine, the project is not installable by clients, and cannot be being modified by its maintainers.

Read more in the project in quarantine help article.

Project description

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"))

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

txwrap-1.0.1.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

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

txwrap-1.0.1-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file txwrap-1.0.1.tar.gz.

File metadata

  • Download URL: txwrap-1.0.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for txwrap-1.0.1.tar.gz
Algorithm Hash digest
SHA256 ee7b2ba8fccd2d09539ba6a5a6d846a8ba82b89ebef3e06b1b865f2d0174ef19
MD5 1044633adbede2a707ac2d8832907383
BLAKE2b-256 3468bfc257eb95a4307ae947a17d5bc70fd654545dbfb5d39f1c7eb236d13e9e

See more details on using hashes here.

File details

Details for the file txwrap-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: txwrap-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for txwrap-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ae5be56e33d6dd7a77e749a5e5ef78f07aca38de693a8aafc316a0b5154f2efa
MD5 9aa40800346484043aa247d730d6f293
BLAKE2b-256 7f349a0c9144f82a80c40ab994c9778809951a55a4fe3c8acace08ba7786068a

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