--- id: svgelements version: "1.9.6" license: MIT license_treatment: permissive maintenance: dormant --- # svgelements — Svg Elements Parsing License: permissive · Maintenance: dormant · Downloads: 956.9K/mo ## What it is and what it does svgelements is a Python library that parses SVG files according to the SVG specification and exposes their geometry as manipulable Python objects. It provides classes for SVG elements like Path, Matrix, Color, Point, and shapes (Rect, Circle, Ellipse, Polygon, Line), along with transformation and rendering capabilities. The library was originally developed for meerK40t (a laser-cutting application) and aims to handle edge cases that simpler SVG parsers miss. The package has no hard dependencies and can be used as a single-file module. It supports SVG/CSS lengths (px, pt, cm, mm, in, %), colors (keywords, hex, rgb, rgba, hsl), transformations, viewports, clipping paths, and groups. Optional soft dependencies (scipy for arc length, Pillow for image loading, numpy for fast linearization) enhance specific features. It does not currently support gradients, masks, markers, or full CSS stylesheets. Use it for: - Parse SVG files for laser-cutting or CNC machine control applications, extracting geometric data for toolpath generation. - Convert SVG shapes to Path objects and apply affine transformations (rotation, scaling, translation) for graphics manipulation. - Extract and manipulate SVG colors, angles, and lengths using robust spec-compliant parsing to avoid edge cases. - Build SVG analysis or transcoding tools that need to read, validate, and modify SVG content programmatically. - Integrate SVG geometry into custom graphics pipelines by converting SVG elements to your own internal data structures. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. svgelements parses SVG files and provides geometric objects (Path, Matrix, Color, Point, etc.) that conform to the SVG specification, enabling robust manipulation of SVG data as geometric structures. Yes, if you need robust SVG parsing with geometric manipulation. The library is stable (Production/Stable, no known vulnerabilities) and has low install friction. However, it is dormant—last release was 2023-08-17—so expect no active maintenance. Use it for parsing and geometric operations, but do not rely on it for new SVG 2.0 features or rapid bug fixes. Suitable for established projects with stable SVG workflows. ## Install pip install svgelements uv add svgelements poetry add svgelements ## Installing svgelements Before you install: Installation is straightforward with no hard dependencies. The package is dormant (last release 2023-08-17, last commit 2024-10-17), but remains in Production/Stable status with 171 repository stars. Soft dependencies (scipy, Pillow, numpy) are optional and enhance specific features. License in practice: MIT license is permissive, allowing commercial and private use with minimal restrictions. You may use, modify, and distribute the code freely as long as you include the original license notice. Quickstart: pip install svgelements from svgelements import SVG, Path, Color, Matrix # Parse an SVG file svg = SVG.parse('file.svg') # Access and manipulate elements for shape in svg.shapes(): print(shape.fill, shape.stroke_width) Verify before relying: - Whether soft dependencies (scipy, Pillow, numpy) are automatically detected and used when available, or require explicit configuration. - Current state of backwards compatibility with svg.path library, given the project is dormant. - Whether the package handles modern SVG 2.0 features beyond the stated SVG 1.1 conformance. ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: dormant - Downloads: 956.9K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags svg parsing and geometry, svg path manipulation, svg to geometric objects, svg spec compliant parser, vector graphics parsing, svg transformation and rendering, svg element extraction, svg-parsing, geometric-manipulation, spec-compliant [View on SkillFed](https://skillfed.io/packages/svgelements) · [View on PyPI](https://pypi.org/project/svgelements/)