Put your text in a stylish box.
Project description
steboxing
A Python library for drawing Unicode text boxes around strings — supports 36 border styles using thin, bold, double, and round line characters.
Installation
pip install steboxing
Usage
from steboxing import boxing
print(boxing("Hello, World!", box_type="thin"))
┌───────────────┐
│ Hello, World! │
└───────────────┘
Multi-line strings are supported:
print(boxing("Line one\nLine two\nLine three", box_type="double"))
╔════════════╗
║ Line one ║
║ Line two ║
║ Line three ║
╚════════════╝
box_type defaults to "thin" if omitted.
Box styles
box_type |
Preview |
|---|---|
thin |
┌───────┐│ lines │└───────┘ |
double |
╔═══════╗║ lines ║╚═══════╝ |
bold |
┏━━━━━━━┓┃ lines ┃┗━━━━━━━┛ |
round |
╭───────╮│ lines │╰───────╯ |
bold_top_and_bottom |
┍━━━━━━━┑│ lines │┕━━━━━━━┙ |
double_top_and_bottom |
╒═══════╕│ lines │╘═══════╛ |
bold_left_and_right |
┎───────┒┃ lines ┃┖───────┚ |
double_left_and_right |
╓───────╖║ lines ║╙───────╜ |
bold_top_only |
┍━━━━━━━┑│ lines │└───────┘ |
double_top_only |
╒═══════╕│ lines │└───────┘ |
bold_bottom_only |
┌───────┐│ lines │┕━━━━━━━┙ |
double_bottom_only |
┌───────┐│ lines │╘═══════╛ |
bold_right_only |
┌───────┒│ lines ┃└───────┚ |
double_right_only |
┌───────╖│ lines ║└───────╜ |
bold_left_only |
┎───────┐┃ lines │┖───────┘ |
double_left_only |
╓───────┐║ lines │╙───────┘ |
bold_left_and_top |
┏━━━━━━━┑┃ lines │┖───────┘ |
double_left_and_top |
╔═══════╕║ lines │╙───────┘ |
bold_right_and_top |
┍━━━━━━━┓│ lines ┃└───────┚ |
double_right_and_top |
╒═══════╗│ lines ║└───────╜ |
bold_right_and_bottom |
┌───────┒│ lines ┃┕━━━━━━━┛ |
double_right_and_bottom |
┌───────╖│ lines ║╘═══════╝ |
bold_left_and_bottom |
┎───────┐┃ lines │┗━━━━━━━┙ |
double_left_and_bottom |
╓───────┐║ lines │╚═══════╛ |
bold_but_bottom |
┏━━━━━━━┓┃ lines ┃┖───────┚ |
double_but_bottom |
╔═══════╗║ lines ║╙───────╜ |
bold_but_left |
┍━━━━━━━┓│ lines ┃┕━━━━━━━┛ |
double_but_left |
╒═══════╗│ lines ║╘═══════╝ |
bold_but_top |
┎───────┒┃ lines ┃┗━━━━━━━┛ |
double_but_top |
╓───────╖║ lines ║╚═══════╝ |
bold_but_right |
┏━━━━━━━┑┃ lines │┗━━━━━━━┙ |
double_but_right |
╔═══════╕║ lines │╚═══════╛ |
bold_corners_only |
┏───────┓│ lines │┗───────┛ |
double_corners_only |
╔───────╗│ lines │╚───────╝ |
bold_chain |
┏─━─━─━─┓│ lines │┗─━─━─━─┛ |
double_chain |
╔─═─═─═─╗│ lines │╚─═─═─═─╝ |
Error handling
Passing an invalid box_type raises a ValueError listing all valid options:
boxing("text", box_type="unknown")
# ValueError: box_type not supported: unknown. Use one of: thin, double, bold, ...
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file steboxing-1.0.0.tar.gz.
File metadata
- Download URL: steboxing-1.0.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac60bb5ce21c41c572bb6bef27d46e44d8895797820b365256646740d72478bf
|
|
| MD5 |
adb39415e2314e389b15a03417c777a8
|
|
| BLAKE2b-256 |
6d005f49f23c917c00b39efc4def2d4e7c17257b9e9dc6ce39b0decb80be6bb1
|
File details
Details for the file steboxing-1.0.0-py3-none-any.whl.
File metadata
- Download URL: steboxing-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
825becb25eaf776c8f966bac25d309f1b66f5a3a884d213f611f34ab67d85d0a
|
|
| MD5 |
2b71858fb6dbd5a7753e8e93432c35f0
|
|
| BLAKE2b-256 |
13636165afcec049d5a07b86b612bede394895cfe60fa1a08f427b8ca08611a3
|