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

Uploaded Source

Built Distribution

svg.py-1.4.2-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for svg.py-1.4.2.tar.gz
Algorithm Hash digest
SHA256 39911b9c77677fd00d7e268b2c37be17ef9c1562575c8c9d30a5849097dfb184
MD5 48ddab291f0f1717a7c2c9314d7390ea
BLAKE2b-256 d95ced67c6d0042e2eef2a764dd2659377bce95a2644fccc432a171fd184a579

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for svg.py-1.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 53e395bcd872f11d51d1cc78d18d57f8445536db7d09c4ccafeff4e3ba1a4074
MD5 e94d8ef9804bbb092b444299113ade2d
BLAKE2b-256 dbd68d2ba16b31f46c5bc37fe771934c0ea0a0b5569c1327254b4f1a1d1c3ede

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