PySVG
The Python library for generating dynamic SVGs using Python3
Version: 0.0.5
Installation
pip install python-svg
Note: This library is still under development
Example:
import svg
from svg.canvas import Canvas
from svg.shapes import Rectangle
from svg.server import svg_server
canvas = Canvas(500, 500)
rect1 = Rectangle(200, 100, canvas)
svg_server(canvas=canvas, port=8000)
To Access the raw SVG in a form of a string
from svg.canvas import Canvas
from svg.shapes import Rectangle
from svg.server import svg_server
canvas = Canvas(500, 500)
rect1 = Rectangle(200, 100, canvas)
svg_code = canvas.svg_content()
print(svg_code)