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.0.tar.gz (2.1 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.0-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: txwrap-1.0.0.tar.gz
  • Upload date:
  • Size: 2.1 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.0.tar.gz
Algorithm Hash digest
SHA256 1625c7329655e9ad4a89959dda3451bdbb2dc86db9acafb48f153e0f685f0b51
MD5 9a94f7544da95dda2203628e0f5a342a
BLAKE2b-256 64e97b030a7c3381ca1e4a577a63a2b9d29790586deff36cb48619b70ab3dbb6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: txwrap-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.5 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5fbdd0ffff439603d2d93b56730d63e2891f33cc7fae7b618869da1379703629
MD5 ab914dba7e0356c50a36aa1ce326ae19
BLAKE2b-256 966894206dcf8f092610db9226d8d9c3bc8a9ef90fb9f3781f183d233ee1c6b5

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