svgwrite
A Python library to create SVG drawings.
What it is and what it does
svgwrite is a pure Python library for programmatically creating and writing SVG files. You instantiate a Drawing object, add SVG elements (lines, circles, text, paths, groups, etc.) via method calls, and save the result to an XML file. The library handles element construction, attribute validation, and XML serialization internally, with support for multiple SVG profiles and features like gradients, markers, animations, stylesheets, and embedded fonts.
The package has no external runtime dependencies and runs on any platform supporting Python 3.6+. However, it is now abandoned: as of version 1.4.2, no new features are being added and only bugfixes are merged. The repository is archived and the last release was 2022-07-14. This makes it suitable for stable use cases where the existing feature set is sufficient, but unsuitable for projects requiring active development or responsive maintainers.
Use it for:
- Generate static SVG diagrams or charts from data without manual XML editing.
- Create vector graphics programmatically in automated workflows or batch processing.
- Build SVG animations and interactive graphics with embedded stylesheets and fonts.
- Export visualizations from Python applications as scalable vector files.
- Construct complex SVG structures via Python API calls without writing raw XML.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Creates SVG drawings programmatically by building XML elements and writing them to files.
Yes, if your use case fits the existing feature set and you do not require active maintenance. The library is stable, has no dependencies, and works reliably for core SVG generation. No, if you need ongoing feature development, responsive bug fixes, or active community support—the project is archived. Evaluate whether the 1.4.3 feature set meets your needs before committing.
Install
svgwrite on PyPI
pip
pip install svgwriteuv
uv add svgwritepoetry
poetry add svgwriteInstalling svgwrite
Before you install
Installation is straightforward with no runtime dependencies. However, the package is abandoned as of version 1.4.2 and explicitly states no new features will be added—only bugfixes will be merged. Last release was 2022-07-14 and the repository is archived.
License in practice
Licensed under MIT License (permissive), which allows commercial and private use with minimal restrictions.
Quickstart
pip install svgwrite
import svgwrite
dwg = svgwrite.Drawing('test.svg', profile='tiny')
dwg.add(dwg.line((0, 0), (10, 0), stroke=svgwrite.rgb(10, 10, 16, '%')))
dwg.add(dwg.text('Test', insert=(0, 0.2), fill='red'))
dwg.save()
Requires Python 3.6 or later; Python 2 support was removed in version 1.4.
Verify before relying
- Whether the abandoned status and lack of active maintenance poses a risk for long-term production use.
- Whether any SVG reading or import capability exists despite design intent to create-only.
Package facts
| License | MIT License (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,492 days since the last release |
| Last repo commit | (repository archived) |
| First released | |
| Downloads | 2,399,791/month — #3,081 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: svgwrite-1.4.3-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
drawsvgProgrammatically generate SVG images and…
permissive · top 5,000 on PyPI
ezdxfezdxf creates, reads, modifies, and writes DXF…
permissive · top 5,000 on PyPI
svg.pyGenerates SVG files programmatically in Python…
permissive · top 15,000 on PyPI
svglibSvglib reads SVG files and converts them to…
copyleft · top 5,000 on PyPI
sphinxcontrib-svg2pdfconverterConverts SVG images to PDF or PNG for Sphinx…
permissive · top 15,000 on PyPI
svgelementssvgelements parses SVG files and provides…
permissive · top 5,000 on PyPI
svgpathtoolsReads, writes, and analyzes SVG Path objects…
permissive · top 5,000 on PyPI
dash-svgProvides SVG component primitives (Svg, G,…
permissive · top 15,000 on PyPI
napari-svgNapari-svg is a plugin that exports image data…
permissive · top 15,000 on PyPI
potracerConverts bitmap images to vector graphics by…
copyleft · top 15,000 on PyPI