svg-py is a Python library for creating and manipulating SVG documents. It provides a fluent API to build SVG elements, supports attributes, styling, and inline CSS. Compatible with Python 3.7+, current version 1.10.0, released on a rolling cadence.
pip install svg-pyNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Create a simple SVG with a rectangle and a circle, then save to file.
Migrate to the new Element API: use `from svg import SVG, Element, Rectangle, etc.` and the builder pattern.
Add `xmlns='http://www.w3.org/2000/svg'` when creating the SVG element or as attribute.
Use `svg.add_element(child)` instead of `svg.add(child)`.
Always use exact attribute names as per SVG spec (e.g., `viewBox`, `clipPath`).
Run `pip install svg-py` to install.
Upgrade to latest version: `pip install --upgrade svg-py`. Then use `from svg import SVG`.
Do not reassign the svg variable. Just call `svg.add_element(...)`.
No dependency data recorded yet.