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
Release history Release notifications | RSS feed
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.1.tar.gz
(40.2 kB
view details)
Built Distribution
svg.py-1.4.1-py3-none-any.whl
(13.5 kB
view details)
File details
Details for the file svg.py-1.4.1.tar.gz
.
File metadata
- Download URL: svg.py-1.4.1.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62a891d97a7a93c6282858add00b22425a3a2df77b2b6569b23423e180a751dc |
|
MD5 | 4d999bdcb1af3e427bf6a794e0c50179 |
|
BLAKE2b-256 | 7fc69dbe9bf9e38adb2671598ea28c2057e9c2020359851bec87ffda6013757d |
File details
Details for the file svg.py-1.4.1-py3-none-any.whl
.
File metadata
- Download URL: svg.py-1.4.1-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e3952365e8aeb31c0ec73a8316bc6f263d050b23063fae99245cb8317fb403e |
|
MD5 | 134c3c8d4b41e153299a396e8b8d2851 |
|
BLAKE2b-256 | a7c7d96310e2a2c6d5a7ba14b9488730c3eab5be1c429e3261b0dd5b888d342e |