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,
elements=[
svg.Circle(
cx=30, cy=30, r=20,
stroke="red",
fill="white",
stroke_width=5,
),
],
)
print(canvas)
See examples for more.
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.2.0.tar.gz
(38.5 kB
view details)
Built Distribution
svg.py-1.2.0-py3-none-any.whl
(11.9 kB
view details)
File details
Details for the file svg.py-1.2.0.tar.gz
.
File metadata
- Download URL: svg.py-1.2.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2380a7887d26e8057294ce49ddf417c5aa02e4e72eaaf6facb9b4f6f16697b3e |
|
MD5 | e8da8b9f3bc8dcba0f1598330729d58a |
|
BLAKE2b-256 | 10ff45b9f03f12a743d9073523c3da8f2b0514a0a171b32ac44b3de353863b29 |
File details
Details for the file svg.py-1.2.0-py3-none-any.whl
.
File metadata
- Download URL: svg.py-1.2.0-py3-none-any.whl
- Upload date:
- Size: 11.9 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed714b719aeec2e5c035045a7fe7e857d10a5f0afc6e62016304f23a3cf11ed5 |
|
MD5 | af89bf8fc1905113e5da75f38cbd54de |
|
BLAKE2b-256 | eef90a1d320ab14abd7e36fc96428f1d3381eb173c2860336a50376bca076aa4 |