Skip to main content

Create Dynamic SVGs using Python3

Project description

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)

The browser will redirect you to localhost:port and you can see the SVG ouput!

There will be a RestAPI Version for the same library soon ;)

By KrishnaKanth1729

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_svg-0.1.1.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

python_svg-0.1.1-py3-none-any.whl (5.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page