SVG drawing library
Project Links
Meta
Author: Gram
Requires Python: >=3.7
Classifiers
Development Status
- 5 - Production/Stable
Intended Audience
- Developers
License
- OSI Approved :: MIT License
Programming Language
- Python
Topic
- Software Development
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.
1.9.2
Oct 18, 2025
1.9.1
Oct 03, 2025
1.9.0
Sep 30, 2025
1.8.0
Aug 11, 2025
1.7.0
Jul 04, 2025
1.6.0
Mar 16, 2025
1.5.0
Sep 23, 2024
1.4.3
Feb 20, 2024
1.4.2
Apr 25, 2023
1.4.1
Nov 22, 2022
1.4.0
Sep 22, 2022
1.3.0
Aug 08, 2022
1.2.0
Jun 30, 2022
1.1.0
Jun 11, 2022
1.0.0
Oct 25, 2021