--- id: drawsvg version: "2.4.2" license: unclear license_treatment: permissive maintenance: active --- # drawsvg — A Python 3 library for programmatically generating SVG (vector) images and animations. Drawsvg can also render to PNG, MP4, and display your drawings in Jupyter notebook and Jupyter lab. License: permissive · Maintenance: active · Downloads: 895.5K/mo ## What it is and what it does drawsvg is a Python library for creating SVG vector graphics and animations through code rather than manual XML editing. It supports most common SVG elements (circles, rectangles, paths, text, arcs, markers) and nearly all SVG attributes via Python keyword arguments. The library integrates directly with Jupyter notebooks for inline display and includes an interactive widget for mouse-driven updates. The package handles both static drawings and native SVG animations with playback controls, and can export to multiple formats. It has no runtime dependencies, making installation straightforward. The coordinate system defaults to standard SVG conventions (y increases downward), and the API uses snake_case naming throughout. Use it for: - Generate diagrams, charts, and technical illustrations programmatically within data science notebooks - Create animated visualizations with SVG-native keyframe animations and playback controls - Build interactive drawing tools in Jupyter using the DrawingWidget for mouse event handling - Export vector graphics to PNG or video formats for presentations and reports - Define reusable drawing patterns with gradients, clip paths, and grouped elements ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Programmatically generate SVG images and animations in Python, with support for rendering in Jupyter notebooks and exporting to PNG, MP4, and GIF formats. Yes. Low install friction, no dependencies, active maintenance, permissive license, and a solid feature set for SVG generation and Jupyter integration make this a practical choice for anyone generating vector graphics programmatically. The recent release and 694 GitHub stars indicate a stable, used project. ## Install pip install drawsvg uv add drawsvg poetry add drawsvg ## Installing drawsvg Before you install: Low install friction with no runtime dependencies. Actively maintained with a recent release (2 days ago) and steady repository activity. License in practice: MIT license permits free use, modification, and distribution with minimal restrictions—suitable for most projects. Quickstart: import drawsvg as draw d = draw.Drawing(200, 100, origin='center') d.append(draw.Circle(0, 0, 30, fill='red', stroke='black')) d.save_svg('example.svg') d # Display in Jupyter Verify before relying: - Whether raster export (PNG, MP4, GIF) requires additional system dependencies beyond the base install - Current state of the interactive widget in Jupyter Lab (description notes it does not yet work there) ## Package facts - License: not declared (permissive) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 895.5K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags SVG generation Python, programmatic vector graphics, Jupyter drawing library, SVG animation Python, create SVG images code, jupyter-integration, vector-graphics, animation [View on SkillFed](https://skillfed.io/packages/drawsvg) · [View on PyPI](https://pypi.org/project/drawsvg/)