svg.py
SVG drawing library
What it is and what it does
svg.py is a Python library for generating SVG files through a programmatic API. It provides type-safe, Pythonic bindings to SVG elements and attributes that follow the same names and structure as the SVG standard itself, so developers familiar with SVG markup can use the library intuitively. The library supports SVG standards 1.1, 1.2, 2.0, and Tiny, and includes only attributes that actually work—no deprecated features.
You construct SVG documents by instantiating element classes (Circle, Rectangle, Path, etc.) with their attributes, nest them into an SVG container, and print or serialize the result. With zero runtime dependencies and pure Python implementation, it installs and runs with minimal friction. The trade-off is that maintenance has slowed: the last release was 229 days ago, so you should verify that any SVG features you need are already supported.
Use it for:
- Generate diagrams, charts, or graphs programmatically for web applications or reports.
- Create vector graphics in data visualization pipelines without learning SVG markup syntax.
- Build design tools or editors that emit SVG output from user input or algorithmic generation.
- Produce scalable icons or illustrations as part of an automated build or content pipeline.
- Test or validate SVG rendering by generating test fixtures with known structure.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates SVG files programmatically in Python using a type-safe API that mirrors the SVG standard structure, with no external runtime dependencies.
Yes, if you need straightforward SVG generation and can tolerate aging maintenance. The library is stable (Production/Stable status), has no dependencies, and covers the SVG standard well. However, verify that your target SVG features are already implemented, since the last release was 229 days ago and there is no recent development activity. Not recommended if you need active bug fixes or cutting-edge SVG feature support.
Install
svg-py on PyPI
pip
pip install svg-pyuv
uv add svg-pypoetry
poetry add svg-pyInstalling svg.py
Before you install
Low friction: pure Python wheel with no runtime dependencies. Maintenance signal is aging—last release was 229 days ago and the repository shows no recent activity, though it remains archived=false with 395 stars.
License in practice
MIT license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects.
Quickstart
pip install svg.py
import svg
canvas = svg.SVG(
width=60, height=60,
elements=[svg.Circle(cx=30, cy=30, r=20, stroke="red", fill="white")]
)
print(canvas)
Verify before relying
- Whether the aging maintenance status (229 days since last release) affects real-world usability for current SVG standards.
- Performance characteristics when generating large or complex SVG documents.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 229 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 93,919/month — #13,360 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: svg_py-1.10.0-py3-none-any.whl
Keywords: svg, drawing, vector
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
drawsvgProgrammatically generate SVG images and…
permissive · top 5,000 on PyPI
svgwriteCreates SVG drawings programmatically by…
permissive · top 5,000 on PyPI
pictexPicTex generates high-quality PNG, JPEG, WebP,…
permissive · top 15,000 on PyPI
svglibSvglib reads SVG files and converts them to…
copyleft · top 5,000 on PyPI
CairoSVGCairoSVG converts SVG files to PDF, EPS, PS,…
copyleft · top 5,000 on PyPI
PyQRCodePyQRCode generates QR codes in pure Python and…
permissive · top 15,000 on PyPI
dash-svgProvides SVG component primitives (Svg, G,…
permissive · top 15,000 on PyPI
svgelementssvgelements parses SVG files and provides…
permissive · top 5,000 on PyPI
schemdrawSchemdraw generates high-quality electrical…
permissive · top 15,000 on PyPI
genbadgeGenerates SVG badges for CI/CD tools and test…
permissive · top 15,000 on PyPI