A small package for printing boxes
Project description
Boxprint
A small package to print boxes
Usage
from boxprint import bprint
bprint("hello world")
╭──────────────────────────────────────────────────────────────────────────────╮
│ Hello World │
╰──────────────────────────────────────────────────────────────────────────────╯
Configurations
from boxprint import bprint, BoxTypes
"""
@param width
Max width of the box
@param box_type
The type of the box (LIGHT, HEAVY, DOUBLE, ROUND)
@param print_func
The print function to use
"""
bprint("hello_world", width=40, box_type=BoxTypes.HEAVY, print_func=print)
bprint("Text\nWith\nMultiple\nLines")
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Hello World ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
╭──────────────────────────────────────────────────────────────────────────────╮
│ Text │
│ With │
│ Multiple │
│ Lines │
╰──────────────────────────────────────────────────────────────────────────────╯
buf = []
def print_to_buf(string):
buf.append(string)
# Boxes apply 2 spaces of padding to the left and right width = (default=80 - 2*2)
bprint("Inner Box", width=76, print_func=print_to_buf)
inner_box = "".join(buf)
bprint(f"Outer box\n{inner_box}")
╭──────────────────────────────────────────────────────────────────────────────╮
│ Outer box │
│ ╭──────────────────────────────────────────────────────────────────────────╮ │
│ │ Inner Box │ │
│ ╰──────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────╯
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
boxprint-0.0.5.tar.gz
(2.4 kB
view details)
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 boxprint-0.0.5.tar.gz.
File metadata
- Download URL: boxprint-0.0.5.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
923522e409274fb5c5a743bd27c120eccd862c3ba173af010cf3707163edd735
|
|
| MD5 |
399ef5e598b2898e3afd6b4f93ec9002
|
|
| BLAKE2b-256 |
4812b54ef99386accd7527b1ceeb9a025775a570243fb16568bdd3b6900894df
|
File details
Details for the file boxprint-0.0.5-py3-none-any.whl.
File metadata
- Download URL: boxprint-0.0.5-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dabe59d80cda2df24544f9acbc9f4b0b2e46123e3ae39c174dc4ced7d4e06fab
|
|
| MD5 |
bd66061434c06d0df7de3a784de4b912
|
|
| BLAKE2b-256 |
8dcf1e512c85dff1e03459b2be91907edfb037dfc07e1d34c27bc0b9daa0d502
|