Skip to content

rackodo/PyLayoutTools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pylayouttools

PyLayoutTools (PLT)

Simple library for organising text into boxes and tables.

Boxes

Wrap strings of text in a simple ASCII box. Define the max width to have the text automatically confine to any terminal width.

Example Code

from PyLayoutTools import pltBox

box = pltBox(
  "This is a box.",
  "It holds a lot of text.",
  "If the text is wider than the maxwidth limit (default 80) it'll wrap the text.",
  "Neat, huh?")
box.maxwidth = 40

print(box())
carbon

Tables

Collate data into a table, with headers.

Example Code

from PyLayoutTools import pltTable

tbl = pltTable(["First Name", "Last Name", "Employee", "Salary"],
  ["Bart", "Simpson", "12345", "$4,500"], 
  ["John", "Smith", "12346", "$5,000"], 
  ["Steven", "Goldfish", "12347", "$5,000"],
  ["Paula", "Brown", "12348", "$3,500"],
  ["James", "Smith", "12349", "$4,500"])

print(tbl())
carbon-2

About

Library for Python Layouts.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages