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.

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.0.tar.gz (38.5 kB view details)

Uploaded Source

Built Distribution

svg.py-1.4.0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file svg.py-1.4.0.tar.gz.

File metadata

  • Download URL: svg.py-1.4.0.tar.gz
  • Upload date:
  • Size: 38.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for svg.py-1.4.0.tar.gz
Algorithm Hash digest
SHA256 f91979738229768a9de33082fc8ec8aba6dbd4906d03f4af9de488d970aa8904
MD5 01e1c5e3b32a4d1481081cf89dfa8434
BLAKE2b-256 9afccff7b75c976ace10704519c9962bdfa17ee501e5edc12990c5687ba76d00

See more details on using hashes here.

File details

Details for the file svg.py-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: svg.py-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for svg.py-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 415353375e929e3ff30cc97344a28ba209a8627a5bcf982832599a0a43a7c52e
MD5 0febd4df8fa23b4a49b11dbdcb238628
BLAKE2b-256 38c635dfbbf09d09249e22197f27651ecb5194a6da4458827d6cb3fc17d207eb

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