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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

svg_py-1.10.0-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: svg_py-1.10.0.tar.gz
  • Upload date:
  • Size: 43.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for svg_py-1.10.0.tar.gz
Algorithm Hash digest
SHA256 2e1391411a205220a0e72ca303f3c2d11dbd564cb1dbc445406c5e11421bcc4b
MD5 5ee20d57c66126a2bdcefadf01d9f3f5
BLAKE2b-256 bc1ef36612d46266942c351de904bd9928610c485baee61220892277ac37be65

See more details on using hashes here.

File details

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

File metadata

  • Download URL: svg_py-1.10.0-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for svg_py-1.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 54c7470347d5d79b30d059584a4f449da08b462903e8ce262981338bab755560
MD5 41b8a2ed117d29bf234539cd83bbc8c8
BLAKE2b-256 189f77a405e7b2a334ce774835263c3374d4ed307a3473f3925d9990a8c029e0

See more details on using hashes here.

Supported by

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