Skip to main content

SVG drawing library

Project description

svg.py

Python library to generate SVG files.

Features:

  • Compatible with all SVG standards: 1.1, 1.2, 2.0, Tiny.
  • 100% type safe.
  • Pure Python.
  • No third-party runtime dependencies.
  • No deprecated attributes, only what actually works.
  • The same names and structure as in the standard. If you know how to write SVG files, you know how to use this library.

Based on svg-xsd-schema and MDN reference.

Installation

python3 -m pip install --user svg.py

Usage

Try svg.py online: svg.orsinium.dev.

import svg
canvas = svg.SVG(
    width=60,
    height=60,
    elements=[
        svg.Circle(
            cx=30, cy=30, r=20,
            stroke="red",
            fill="white",
            stroke_width=5,
        ),
    ],
)
print(canvas)

See examples for more.

Projects using svg.py

The github topic svg-py contains some of the projects that use svg.py in one way or another. If you want your project to appear on the list, simply add svg-py into the list of project topics. Here is how.

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

svg_py-1.4.3.tar.gz (40.2 kB view details)

Uploaded Source

Built Distribution

svg_py-1.4.3-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file svg_py-1.4.3.tar.gz.

File metadata

  • Download URL: svg_py-1.4.3.tar.gz
  • Upload date:
  • Size: 40.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for svg_py-1.4.3.tar.gz
Algorithm Hash digest
SHA256 d03d87549fb12e1ddcf367420fc196703d725e50b81c44ec2388e0530fc8bab3
MD5 c4144b528a07b0500c624f8ad3a26221
BLAKE2b-256 df731e24a357536ca4e0af3172d83d3d3ccaa821c87c5f69cbf4052b5a99c39a

See more details on using hashes here.

File details

Details for the file svg_py-1.4.3-py3-none-any.whl.

File metadata

  • Download URL: svg_py-1.4.3-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for svg_py-1.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f76db56ff5439294b32e55f4151eb4b4fcad376dfbad70a989e29a5391994d76
MD5 42b1fe5f6511c3f33888d3639f064eac
BLAKE2b-256 83b2d8a57401dd954103c14cecf442ecc143e3b8d10a7d822d9904f34b252ae7

See more details on using hashes here.

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