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
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.0.0.tar.gz
(38.1 kB
view details)
Built Distribution
svg.py-1.0.0-py3-none-any.whl
(12.0 kB
view details)
File details
Details for the file svg.py-1.0.0.tar.gz
.
File metadata
- Download URL: svg.py-1.0.0.tar.gz
- Upload date:
- Size: 38.1 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.22.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e04cd8ba27d75ad079f5704ec29a43eaf6c4f3560be77bafd7399392129bcb1b |
|
MD5 | bdd7424a5a966738bc902834bfe2405e |
|
BLAKE2b-256 | b621528123a8dd1963f9f3f90b46c2df04a726139d2739b073df05c36c7a1014 |
File details
Details for the file svg.py-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: svg.py-1.0.0-py3-none-any.whl
- Upload date:
- Size: 12.0 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.22.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfa2df1f46bf9691460f083afe429b4471ad17c4449bcafcfcbcc20e9cbc1a45 |
|
MD5 | c684bb5adf65f30616b4da382db27f6e |
|
BLAKE2b-256 | 16b8c6a339e68eb6452f9da4143e4709713540f20e80776e8d934f5dc11010dd |