Skip to content

A webservice for generating style boxes

License

Notifications You must be signed in to change notification settings

LightSoar/pystylebox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pystylebox

A webservice for generating style boxes, inspired by the Morningstar Style Box.

In a script

SVG

from stylebox import SVGStyleBoxBuilder

svg_as_str = SVGStyleBoxBuilder([0, 1], [0, 1], size=50, color="#000000").grid(2,2).point(0.5,0.5).build()

with open("/tmp/stylebox.svg", "w") as svg_file:
    svg_file.write(svg_as_str)

Result

pystylebox example

ASCII

from stylebox import ASCIIStyleBoxBuilder
print(ASCIIStyleBoxBuilder([0,1],[0,1], size=7).grid(1).point(0.25,0.75).build())
print(ASCIIStyleBoxBuilder([0,1],[0,1], size=7).grid(2).point(0.25,0.75).build())
print(ASCIIStyleBoxBuilder([0,1],[0,1], size=7).grid(5).point(0.25,0.75).build())

Result

┌──┬──┐
│  │  │
│  │  │
├──┼──┤
│ *│  │
│  │  │
└──┴──┘
┌─┬─┬─┐
│ │ │ │
├─┼─┼─┤
│ │ │ │
├─*─┼─┤
│ │ │ │
└─┴─┴─┘
┌┬┬┬┬┬┐
├┼┼┼┼┼┤
├┼┼┼┼┼┤
├┼┼┼┼┼┤
├┼*┼┼┼┤
├┼┼┼┼┼┤
└┴┴┴┴┴┘

As a webservice

Run ./stylebox-webservice.py and navigate to:

About

A webservice for generating style boxes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages