Skip to main content

Text Box Wrapper

A simple Python package to wrap text with ASCII art or other characters. It also supports custom alignment (left, center, or right) and can be used as a decorator.

Installation

Install the package using pip:

pip install text-box-wrapper

Usage

Basic usage

Import the wrap_with_ascii_art function and use it to wrap your text:

from text_box_wrapper import wrap_with_ascii_art

text = "Hello, World!"
wrapped_text = wrap_with_ascii_art(text)
print(wrapped_text)

Example output:

###########################################
###########################################
#####                                 #####
#####                                 #####
#####          Hello, World!          #####
#####                                 #####
#####                                 #####
###########################################
###########################################

Customizing the wrapper

You can customize the padding, border string, and alignment:

from text_box_wrapper import wrap_with_ascii_art

text = "你好,成都"
border_string = "#"
wrapped_text = wrap_with_ascii_art(text, min_padding=5, vertical_padding=2, border_string=border_string, alignment="center")
print(wrapped_text)

Example output:

######################
#                    #
#                    #
#     你好,成都       #
#                    #
#                    #
######################

Using the decorator

You can also use the wrap decorator to automatically wrap the output of a function:

from text_box_wrapper import wrap

@wrap(min_padding=7, vertical_padding=1, border_string="*", alignment="center")
def greet(name):
    return f"Hello, {name}!"

print(greet("John"))

Example output:

****************************
*                          *
*       Hello, John!       *
*                          *
****************************

Contributing

Feel free to submit issues or pull requests if you have any suggestions, improvements, or bug reports.

License

This project is licensed under the MIT License.

Metadata

Release files for text-box-wrapper 0.1.5

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

Source distribution (sdist)

Source distribution for text-box-wrapper 0.1.5
File Size Uploaded Provenance Actions
text-box-wrapper-0.1.5.tar.gz 4.0 kB Without provenance Details for text-box-wrapper-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for text-box-wrapper 0.1.5
File Interpreter ABI Platform Actions
text_box_wrapper-0.1.5-py3-none-any.whl Python 3 none any Details for text_box_wrapper-0.1.5-py3-none-any.whl

Total release size: 8.4 kB

Release files / text-box-wrapper-0.1.5.tar.gz

Download URL text-box-wrapper-0.1.5.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4443678cd7bfb06dee4d3a243ce73e2adba07570f660369a5634d6966c5daf18
BLAKE2b-256 checksum
How to use checksums
d9df725c690894e9815b883ed8be5fc546c99ceafd38e33dedc3adc7a53ab802
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.8

Release files / text_box_wrapper-0.1.5-py3-none-any.whl

Download URL text_box_wrapper-0.1.5-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
675b55073b0caa7475369880a74716f132d6fe0cbbf845f336f449a44807c414
BLAKE2b-256 checksum
How to use checksums
bf1a427543360edc9bbb3831fa589857cf2cd2930296055c2dd610099a49c636
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.8

Security for text-box-wrapper 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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