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

import svg
canvas = svg.SVG(
    width=60,
    height=60,
    xmlns="http://www.w3.org/2000/svg",
    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.1.0.tar.gz (38.5 kB view details)

Uploaded Source

Built Distribution

svg.py-1.1.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: svg.py-1.1.0.tar.gz
  • Upload date:
  • Size: 38.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.12

File hashes

Hashes for svg.py-1.1.0.tar.gz
Algorithm Hash digest
SHA256 33522612ea39dcab18546be19ae13e47c80193338f2aabea80a83f093ff7cbde
MD5 5bd3b294a031a94afce5d7c9e52775b5
BLAKE2b-256 15e8182bd0ae940ae2a96463182f8b6e59ac4254d25cfcbf02d560fa41ac0646

See more details on using hashes here.

File details

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

File metadata

  • Download URL: svg.py-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.12

File hashes

Hashes for svg.py-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d173358cda2d92a45e725bfb87c7279682ca45fdef18fa4e9d0e8f20237503e
MD5 33616431081c02dbb03a2a824489624c
BLAKE2b-256 70538ff57b054e8fbcb78a526a1c5732ee250dff5863ef874da830935e494187

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