pysvgwriter 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pysvgwriter-1.0.0/LICENSE +21 -0
- pysvgwriter-1.0.0/PKG-INFO +149 -0
- pysvgwriter-1.0.0/README.md +90 -0
- pysvgwriter-1.0.0/pyproject.toml +143 -0
- pysvgwriter-1.0.0/pysvgwriter.egg-info/PKG-INFO +149 -0
- pysvgwriter-1.0.0/pysvgwriter.egg-info/SOURCES.txt +467 -0
- pysvgwriter-1.0.0/pysvgwriter.egg-info/dependency_links.txt +1 -0
- pysvgwriter-1.0.0/pysvgwriter.egg-info/entry_points.txt +2 -0
- pysvgwriter-1.0.0/pysvgwriter.egg-info/requires.txt +40 -0
- pysvgwriter-1.0.0/pysvgwriter.egg-info/top_level.txt +1 -0
- pysvgwriter-1.0.0/setup.cfg +4 -0
- pysvgwriter-1.0.0/svgwriter/__init__.py +195 -0
- pysvgwriter-1.0.0/svgwriter/__init__.pyi +526 -0
- pysvgwriter-1.0.0/svgwriter/__main__.py +12 -0
- pysvgwriter-1.0.0/svgwriter/__main__.pyi +3 -0
- pysvgwriter-1.0.0/svgwriter/_document/__init__.py +3 -0
- pysvgwriter-1.0.0/svgwriter/_document/__init__.pyi +0 -0
- pysvgwriter-1.0.0/svgwriter/_document/_constants.py +16 -0
- pysvgwriter-1.0.0/svgwriter/_document/_constants.pyi +6 -0
- pysvgwriter-1.0.0/svgwriter/_document/access.py +125 -0
- pysvgwriter-1.0.0/svgwriter/_document/access.pyi +21 -0
- pysvgwriter-1.0.0/svgwriter/_document/ingest.py +114 -0
- pysvgwriter-1.0.0/svgwriter/_document/ingest.pyi +7 -0
- pysvgwriter-1.0.0/svgwriter/_document/output.py +374 -0
- pysvgwriter-1.0.0/svgwriter/_document/output.pyi +66 -0
- pysvgwriter-1.0.0/svgwriter/_document/sizing.py +120 -0
- pysvgwriter-1.0.0/svgwriter/_document/sizing.pyi +12 -0
- pysvgwriter-1.0.0/svgwriter/_internal/__init__.py +5 -0
- pysvgwriter-1.0.0/svgwriter/_internal/__init__.pyi +0 -0
- pysvgwriter-1.0.0/svgwriter/_internal/_constants.py +80 -0
- pysvgwriter-1.0.0/svgwriter/_internal/_constants.pyi +55 -0
- pysvgwriter-1.0.0/svgwriter/_internal/_drawable.py +82 -0
- pysvgwriter-1.0.0/svgwriter/_internal/_drawable.pyi +4 -0
- pysvgwriter-1.0.0/svgwriter/_internal/_escape.py +19 -0
- pysvgwriter-1.0.0/svgwriter/_internal/_escape.pyi +5 -0
- pysvgwriter-1.0.0/svgwriter/_internal/_hybrid.py +45 -0
- pysvgwriter-1.0.0/svgwriter/_internal/_hybrid.pyi +16 -0
- pysvgwriter-1.0.0/svgwriter/_internal/_ids.py +33 -0
- pysvgwriter-1.0.0/svgwriter/_internal/_ids.pyi +10 -0
- pysvgwriter-1.0.0/svgwriter/_internal/_numbers.py +25 -0
- pysvgwriter-1.0.0/svgwriter/_internal/_numbers.pyi +3 -0
- pysvgwriter-1.0.0/svgwriter/_internal/_registry.py +72 -0
- pysvgwriter-1.0.0/svgwriter/_internal/_registry.pyi +23 -0
- pysvgwriter-1.0.0/svgwriter/_internal/_sentinels.py +25 -0
- pysvgwriter-1.0.0/svgwriter/_internal/_sentinels.pyi +12 -0
- pysvgwriter-1.0.0/svgwriter/_internal/_stack.py +40 -0
- pysvgwriter-1.0.0/svgwriter/_internal/_stack.pyi +15 -0
- pysvgwriter-1.0.0/svgwriter/_internal/_typing.py +97 -0
- pysvgwriter-1.0.0/svgwriter/_internal/_typing.pyi +56 -0
- pysvgwriter-1.0.0/svgwriter/aliases.py +259 -0
- pysvgwriter-1.0.0/svgwriter/aliases.pyi +236 -0
- pysvgwriter-1.0.0/svgwriter/attributes/__init__.py +52 -0
- pysvgwriter-1.0.0/svgwriter/attributes/__init__.pyi +78 -0
- pysvgwriter-1.0.0/svgwriter/attributes/_constants.py +70 -0
- pysvgwriter-1.0.0/svgwriter/attributes/_constants.pyi +29 -0
- pysvgwriter-1.0.0/svgwriter/attributes/_selectors.py +60 -0
- pysvgwriter-1.0.0/svgwriter/attributes/_selectors.pyi +7 -0
- pysvgwriter-1.0.0/svgwriter/attributes/angle.py +181 -0
- pysvgwriter-1.0.0/svgwriter/attributes/angle.pyi +47 -0
- pysvgwriter-1.0.0/svgwriter/attributes/cascade.py +370 -0
- pysvgwriter-1.0.0/svgwriter/attributes/cascade.pyi +35 -0
- pysvgwriter-1.0.0/svgwriter/attributes/descriptors.py +132 -0
- pysvgwriter-1.0.0/svgwriter/attributes/descriptors.pyi +35 -0
- pysvgwriter-1.0.0/svgwriter/attributes/length.py +391 -0
- pysvgwriter-1.0.0/svgwriter/attributes/length.pyi +98 -0
- pysvgwriter-1.0.0/svgwriter/attributes/names.py +160 -0
- pysvgwriter-1.0.0/svgwriter/attributes/names.pyi +21 -0
- pysvgwriter-1.0.0/svgwriter/attributes/protocols.py +72 -0
- pysvgwriter-1.0.0/svgwriter/attributes/protocols.pyi +11 -0
- pysvgwriter-1.0.0/svgwriter/attributes/reference.py +188 -0
- pysvgwriter-1.0.0/svgwriter/attributes/reference.pyi +26 -0
- pysvgwriter-1.0.0/svgwriter/attributes/style.py +224 -0
- pysvgwriter-1.0.0/svgwriter/attributes/style.pyi +39 -0
- pysvgwriter-1.0.0/svgwriter/attributes/values.py +113 -0
- pysvgwriter-1.0.0/svgwriter/attributes/values.pyi +6 -0
- pysvgwriter-1.0.0/svgwriter/attributes/viewbox.py +248 -0
- pysvgwriter-1.0.0/svgwriter/attributes/viewbox.pyi +51 -0
- pysvgwriter-1.0.0/svgwriter/builder/__init__.py +26 -0
- pysvgwriter-1.0.0/svgwriter/builder/__init__.pyi +29 -0
- pysvgwriter-1.0.0/svgwriter/builder/_constants.py +66 -0
- pysvgwriter-1.0.0/svgwriter/builder/_constants.pyi +57 -0
- pysvgwriter-1.0.0/svgwriter/builder/_effects.py +208 -0
- pysvgwriter-1.0.0/svgwriter/builder/_effects.pyi +160 -0
- pysvgwriter-1.0.0/svgwriter/builder/_functions.py +19 -0
- pysvgwriter-1.0.0/svgwriter/builder/_functions.pyi +149 -0
- pysvgwriter-1.0.0/svgwriter/builder/_motion.py +245 -0
- pysvgwriter-1.0.0/svgwriter/builder/_motion.pyi +171 -0
- pysvgwriter-1.0.0/svgwriter/builder/_shapes.py +218 -0
- pysvgwriter-1.0.0/svgwriter/builder/_shapes.pyi +157 -0
- pysvgwriter-1.0.0/svgwriter/cli/__init__.py +83 -0
- pysvgwriter-1.0.0/svgwriter/cli/__init__.pyi +9 -0
- pysvgwriter-1.0.0/svgwriter/cli/_basic.py +139 -0
- pysvgwriter-1.0.0/svgwriter/cli/_basic.pyi +11 -0
- pysvgwriter-1.0.0/svgwriter/cli/_constants.py +30 -0
- pysvgwriter-1.0.0/svgwriter/cli/_constants.pyi +23 -0
- pysvgwriter-1.0.0/svgwriter/cli/_media.py +175 -0
- pysvgwriter-1.0.0/svgwriter/cli/_media.pyi +14 -0
- pysvgwriter-1.0.0/svgwriter/color/__init__.py +21 -0
- pysvgwriter-1.0.0/svgwriter/color/__init__.pyi +29 -0
- pysvgwriter-1.0.0/svgwriter/color/_blending.py +186 -0
- pysvgwriter-1.0.0/svgwriter/color/_blending.pyi +16 -0
- pysvgwriter-1.0.0/svgwriter/color/_channels.py +129 -0
- pysvgwriter-1.0.0/svgwriter/color/_channels.pyi +24 -0
- pysvgwriter-1.0.0/svgwriter/color/_constants.py +76 -0
- pysvgwriter-1.0.0/svgwriter/color/_constants.pyi +31 -0
- pysvgwriter-1.0.0/svgwriter/color/_named.py +25 -0
- pysvgwriter-1.0.0/svgwriter/color/_named.pyi +6 -0
- pysvgwriter-1.0.0/svgwriter/color/_parsing.py +49 -0
- pysvgwriter-1.0.0/svgwriter/color/_parsing.pyi +9 -0
- pysvgwriter-1.0.0/svgwriter/color/color.py +393 -0
- pysvgwriter-1.0.0/svgwriter/color/color.pyi +64 -0
- pysvgwriter-1.0.0/svgwriter/color/paint.py +153 -0
- pysvgwriter-1.0.0/svgwriter/color/paint.pyi +30 -0
- pysvgwriter-1.0.0/svgwriter/document.py +384 -0
- pysvgwriter-1.0.0/svgwriter/document.pyi +164 -0
- pysvgwriter-1.0.0/svgwriter/elements/__init__.py +186 -0
- pysvgwriter-1.0.0/svgwriter/elements/__init__.pyi +267 -0
- pysvgwriter-1.0.0/svgwriter/elements/_behavior/__init__.py +36 -0
- pysvgwriter-1.0.0/svgwriter/elements/_behavior/__init__.pyi +30 -0
- pysvgwriter-1.0.0/svgwriter/elements/_behavior/_boolean.py +183 -0
- pysvgwriter-1.0.0/svgwriter/elements/_behavior/_boolean.pyi +23 -0
- pysvgwriter-1.0.0/svgwriter/elements/_behavior/_constants.py +12 -0
- pysvgwriter-1.0.0/svgwriter/elements/_behavior/_constants.pyi +6 -0
- pysvgwriter-1.0.0/svgwriter/elements/_behavior/_convert.py +375 -0
- pysvgwriter-1.0.0/svgwriter/elements/_behavior/_convert.pyi +48 -0
- pysvgwriter-1.0.0/svgwriter/elements/_behavior/_geometry.py +358 -0
- pysvgwriter-1.0.0/svgwriter/elements/_behavior/_geometry.pyi +21 -0
- pysvgwriter-1.0.0/svgwriter/elements/_behavior/_measure.py +194 -0
- pysvgwriter-1.0.0/svgwriter/elements/_behavior/_measure.pyi +22 -0
- pysvgwriter-1.0.0/svgwriter/elements/_behavior/_mixins.py +393 -0
- pysvgwriter-1.0.0/svgwriter/elements/_behavior/_mixins.pyi +136 -0
- pysvgwriter-1.0.0/svgwriter/elements/_behavior/_moves.py +329 -0
- pysvgwriter-1.0.0/svgwriter/elements/_behavior/_moves.pyi +71 -0
- pysvgwriter-1.0.0/svgwriter/elements/_behavior/_placement.py +191 -0
- pysvgwriter-1.0.0/svgwriter/elements/_behavior/_placement.pyi +32 -0
- pysvgwriter-1.0.0/svgwriter/elements/_behavior/_styling.py +139 -0
- pysvgwriter-1.0.0/svgwriter/elements/_behavior/_styling.pyi +20 -0
- pysvgwriter-1.0.0/svgwriter/elements/_behavior/_transformable.py +198 -0
- pysvgwriter-1.0.0/svgwriter/elements/_behavior/_transformable.pyi +41 -0
- pysvgwriter-1.0.0/svgwriter/elements/_behavior/_viewport.py +162 -0
- pysvgwriter-1.0.0/svgwriter/elements/_behavior/_viewport.pyi +47 -0
- pysvgwriter-1.0.0/svgwriter/elements/animation/__init__.py +37 -0
- pysvgwriter-1.0.0/svgwriter/elements/animation/__init__.pyi +31 -0
- pysvgwriter-1.0.0/svgwriter/elements/animation/_elements.py +402 -0
- pysvgwriter-1.0.0/svgwriter/elements/animation/_elements.pyi +241 -0
- pysvgwriter-1.0.0/svgwriter/elements/animation/_smil.py +137 -0
- pysvgwriter-1.0.0/svgwriter/elements/animation/_smil.pyi +54 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/__init__.py +22 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/__init__.pyi +22 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/_access.py +324 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/_access.pyi +33 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/_categories.py +51 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/_categories.pyi +25 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/_compose.py +78 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/_compose.pyi +10 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/_constants.py +42 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/_constants.pyi +29 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/_construct.py +160 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/_construct.pyi +16 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/_container.py +289 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/_container.pyi +34 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/_display.py +126 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/_display.pyi +34 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/_element.py +268 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/_element.pyi +57 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/_errors.py +78 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/_errors.pyi +15 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/_factory.py +145 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/_factory.pyi +4 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/_query.py +188 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/_query.pyi +26 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/_tree.py +203 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/_tree.pyi +15 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/_unknown.py +41 -0
- pysvgwriter-1.0.0/svgwriter/elements/core/_unknown.pyi +20 -0
- pysvgwriter-1.0.0/svgwriter/elements/filters/__init__.py +83 -0
- pysvgwriter-1.0.0/svgwriter/elements/filters/__init__.pyi +95 -0
- pysvgwriter-1.0.0/svgwriter/elements/filters/_colormatrix.py +121 -0
- pysvgwriter-1.0.0/svgwriter/elements/filters/_colormatrix.pyi +14 -0
- pysvgwriter-1.0.0/svgwriter/elements/filters/_compositing.py +269 -0
- pysvgwriter-1.0.0/svgwriter/elements/filters/_compositing.pyi +331 -0
- pysvgwriter-1.0.0/svgwriter/elements/filters/_constants.py +14 -0
- pysvgwriter-1.0.0/svgwriter/elements/filters/_constants.pyi +8 -0
- pysvgwriter-1.0.0/svgwriter/elements/filters/_effects.py +343 -0
- pysvgwriter-1.0.0/svgwriter/elements/filters/_effects.pyi +328 -0
- pysvgwriter-1.0.0/svgwriter/elements/filters/base.py +336 -0
- pysvgwriter-1.0.0/svgwriter/elements/filters/base.pyi +223 -0
- pysvgwriter-1.0.0/svgwriter/elements/filters/lighting.py +359 -0
- pysvgwriter-1.0.0/svgwriter/elements/filters/lighting.pyi +240 -0
- pysvgwriter-1.0.0/svgwriter/elements/filters/transfer.py +300 -0
- pysvgwriter-1.0.0/svgwriter/elements/filters/transfer.pyi +156 -0
- pysvgwriter-1.0.0/svgwriter/elements/paint/__init__.py +19 -0
- pysvgwriter-1.0.0/svgwriter/elements/paint/__init__.pyi +19 -0
- pysvgwriter-1.0.0/svgwriter/elements/paint/_clip.py +203 -0
- pysvgwriter-1.0.0/svgwriter/elements/paint/_clip.pyi +163 -0
- pysvgwriter-1.0.0/svgwriter/elements/paint/_servers.py +348 -0
- pysvgwriter-1.0.0/svgwriter/elements/paint/_servers.pyi +289 -0
- pysvgwriter-1.0.0/svgwriter/elements/paint/_stops.py +116 -0
- pysvgwriter-1.0.0/svgwriter/elements/paint/_stops.pyi +53 -0
- pysvgwriter-1.0.0/svgwriter/elements/paint/_tiling.py +172 -0
- pysvgwriter-1.0.0/svgwriter/elements/paint/_tiling.pyi +23 -0
- pysvgwriter-1.0.0/svgwriter/elements/shapes/__init__.py +18 -0
- pysvgwriter-1.0.0/svgwriter/elements/shapes/__init__.pyi +6 -0
- pysvgwriter-1.0.0/svgwriter/elements/shapes/_base.py +87 -0
- pysvgwriter-1.0.0/svgwriter/elements/shapes/_base.pyi +16 -0
- pysvgwriter-1.0.0/svgwriter/elements/shapes/_basic.py +361 -0
- pysvgwriter-1.0.0/svgwriter/elements/shapes/_basic.pyi +332 -0
- pysvgwriter-1.0.0/svgwriter/elements/shapes/_commands.py +327 -0
- pysvgwriter-1.0.0/svgwriter/elements/shapes/_commands.pyi +84 -0
- pysvgwriter-1.0.0/svgwriter/elements/shapes/_constants.py +16 -0
- pysvgwriter-1.0.0/svgwriter/elements/shapes/_constants.pyi +7 -0
- pysvgwriter-1.0.0/svgwriter/elements/shapes/_path.py +209 -0
- pysvgwriter-1.0.0/svgwriter/elements/shapes/_path.pyi +132 -0
- pysvgwriter-1.0.0/svgwriter/elements/shapes/_poly.py +273 -0
- pysvgwriter-1.0.0/svgwriter/elements/shapes/_poly.pyi +133 -0
- pysvgwriter-1.0.0/svgwriter/elements/shapes/_rectbuild.py +131 -0
- pysvgwriter-1.0.0/svgwriter/elements/shapes/_rectbuild.pyi +31 -0
- pysvgwriter-1.0.0/svgwriter/elements/structure/__init__.py +27 -0
- pysvgwriter-1.0.0/svgwriter/elements/structure/__init__.pyi +31 -0
- pysvgwriter-1.0.0/svgwriter/elements/structure/_constants.py +14 -0
- pysvgwriter-1.0.0/svgwriter/elements/structure/_constants.pyi +8 -0
- pysvgwriter-1.0.0/svgwriter/elements/structure/_containers.py +396 -0
- pysvgwriter-1.0.0/svgwriter/elements/structure/_containers.pyi +247 -0
- pysvgwriter-1.0.0/svgwriter/elements/structure/_descriptive.py +82 -0
- pysvgwriter-1.0.0/svgwriter/elements/structure/_descriptive.pyi +40 -0
- pysvgwriter-1.0.0/svgwriter/elements/structure/_external.py +135 -0
- pysvgwriter-1.0.0/svgwriter/elements/structure/_external.pyi +72 -0
- pysvgwriter-1.0.0/svgwriter/elements/structure/_image.py +287 -0
- pysvgwriter-1.0.0/svgwriter/elements/structure/_image.pyi +150 -0
- pysvgwriter-1.0.0/svgwriter/elements/structure/_pixels.py +488 -0
- pysvgwriter-1.0.0/svgwriter/elements/structure/_pixels.pyi +51 -0
- pysvgwriter-1.0.0/svgwriter/elements/structure/_use.py +186 -0
- pysvgwriter-1.0.0/svgwriter/elements/structure/_use.pyi +15 -0
- pysvgwriter-1.0.0/svgwriter/elements/text/__init__.py +44 -0
- pysvgwriter-1.0.0/svgwriter/elements/text/__init__.pyi +48 -0
- pysvgwriter-1.0.0/svgwriter/elements/text/_character.py +399 -0
- pysvgwriter-1.0.0/svgwriter/elements/text/_character.pyi +88 -0
- pysvgwriter-1.0.0/svgwriter/elements/text/_clusters.py +42 -0
- pysvgwriter-1.0.0/svgwriter/elements/text/_clusters.pyi +3 -0
- pysvgwriter-1.0.0/svgwriter/elements/text/_constants.py +39 -0
- pysvgwriter-1.0.0/svgwriter/elements/text/_constants.pyi +27 -0
- pysvgwriter-1.0.0/svgwriter/elements/text/_fontbase.py +135 -0
- pysvgwriter-1.0.0/svgwriter/elements/text/_fontbase.pyi +135 -0
- pysvgwriter-1.0.0/svgwriter/elements/text/_fonts.py +371 -0
- pysvgwriter-1.0.0/svgwriter/elements/text/_fonts.pyi +200 -0
- pysvgwriter-1.0.0/svgwriter/elements/text/_text.py +360 -0
- pysvgwriter-1.0.0/svgwriter/elements/text/_text.pyi +254 -0
- pysvgwriter-1.0.0/svgwriter/elements/text/_textaccess.py +284 -0
- pysvgwriter-1.0.0/svgwriter/elements/text/_textaccess.pyi +63 -0
- pysvgwriter-1.0.0/svgwriter/elements/text/_textbase.py +87 -0
- pysvgwriter-1.0.0/svgwriter/elements/text/_textbase.pyi +39 -0
- pysvgwriter-1.0.0/svgwriter/elements/text/_textlayout.py +388 -0
- pysvgwriter-1.0.0/svgwriter/elements/text/_textlayout.pyi +29 -0
- pysvgwriter-1.0.0/svgwriter/export/__init__.py +49 -0
- pysvgwriter-1.0.0/svgwriter/export/__init__.pyi +27 -0
- pysvgwriter-1.0.0/svgwriter/export/_constants.py +68 -0
- pysvgwriter-1.0.0/svgwriter/export/_constants.pyi +53 -0
- pysvgwriter-1.0.0/svgwriter/export/_diagram/__init__.py +363 -0
- pysvgwriter-1.0.0/svgwriter/export/_diagram/__init__.pyi +31 -0
- pysvgwriter-1.0.0/svgwriter/export/_diagram/_constants.py +71 -0
- pysvgwriter-1.0.0/svgwriter/export/_diagram/_constants.pyi +79 -0
- pysvgwriter-1.0.0/svgwriter/export/_diagram/_mermaid.py +374 -0
- pysvgwriter-1.0.0/svgwriter/export/_diagram/_mermaid.pyi +63 -0
- pysvgwriter-1.0.0/svgwriter/export/_exchange.py +152 -0
- pysvgwriter-1.0.0/svgwriter/export/_exchange.pyi +29 -0
- pysvgwriter-1.0.0/svgwriter/export/_flatten.py +284 -0
- pysvgwriter-1.0.0/svgwriter/export/_flatten.pyi +65 -0
- pysvgwriter-1.0.0/svgwriter/export/_html.py +112 -0
- pysvgwriter-1.0.0/svgwriter/export/_html.pyi +15 -0
- pysvgwriter-1.0.0/svgwriter/export/_office/__init__.py +234 -0
- pysvgwriter-1.0.0/svgwriter/export/_office/__init__.pyi +4 -0
- pysvgwriter-1.0.0/svgwriter/export/_office/_constants.py +38 -0
- pysvgwriter-1.0.0/svgwriter/export/_office/_constants.pyi +49 -0
- pysvgwriter-1.0.0/svgwriter/export/_office/_docx.py +88 -0
- pysvgwriter-1.0.0/svgwriter/export/_office/_docx.pyi +3 -0
- pysvgwriter-1.0.0/svgwriter/export/_office/_pptx.py +358 -0
- pysvgwriter-1.0.0/svgwriter/export/_office/_pptx.pyi +5 -0
- pysvgwriter-1.0.0/svgwriter/export/_paints.py +103 -0
- pysvgwriter-1.0.0/svgwriter/export/_paints.pyi +20 -0
- pysvgwriter-1.0.0/svgwriter/export/_patterns.py +119 -0
- pysvgwriter-1.0.0/svgwriter/export/_patterns.pyi +7 -0
- pysvgwriter-1.0.0/svgwriter/export/_plotter/__init__.py +213 -0
- pysvgwriter-1.0.0/svgwriter/export/_plotter/__init__.pyi +47 -0
- pysvgwriter-1.0.0/svgwriter/export/_plotter/_cnc.py +248 -0
- pysvgwriter-1.0.0/svgwriter/export/_plotter/_cnc.pyi +34 -0
- pysvgwriter-1.0.0/svgwriter/export/_plotter/_cnc_read.py +380 -0
- pysvgwriter-1.0.0/svgwriter/export/_plotter/_cnc_read.pyi +21 -0
- pysvgwriter-1.0.0/svgwriter/export/_plotter/_constants.py +31 -0
- pysvgwriter-1.0.0/svgwriter/export/_plotter/_constants.pyi +37 -0
- pysvgwriter-1.0.0/svgwriter/export/_raster/__init__.py +318 -0
- pysvgwriter-1.0.0/svgwriter/export/_raster/__init__.pyi +42 -0
- pysvgwriter-1.0.0/svgwriter/export/_raster/_animated.py +175 -0
- pysvgwriter-1.0.0/svgwriter/export/_raster/_animated.pyi +18 -0
- pysvgwriter-1.0.0/svgwriter/export/_raster/_constants.py +92 -0
- pysvgwriter-1.0.0/svgwriter/export/_raster/_constants.pyi +133 -0
- pysvgwriter-1.0.0/svgwriter/export/_raster/_encoders.py +82 -0
- pysvgwriter-1.0.0/svgwriter/export/_raster/_encoders.pyi +10 -0
- pysvgwriter-1.0.0/svgwriter/export/_raster/_gif.py +256 -0
- pysvgwriter-1.0.0/svgwriter/export/_raster/_gif.pyi +13 -0
- pysvgwriter-1.0.0/svgwriter/export/_raster/_icons.py +178 -0
- pysvgwriter-1.0.0/svgwriter/export/_raster/_icons.pyi +21 -0
- pysvgwriter-1.0.0/svgwriter/export/_raster/_pixels.py +53 -0
- pysvgwriter-1.0.0/svgwriter/export/_raster/_pixels.pyi +5 -0
- pysvgwriter-1.0.0/svgwriter/export/_raster/_pnm.py +193 -0
- pysvgwriter-1.0.0/svgwriter/export/_raster/_pnm.pyi +15 -0
- pysvgwriter-1.0.0/svgwriter/export/_registry.py +369 -0
- pysvgwriter-1.0.0/svgwriter/export/_registry.pyi +82 -0
- pysvgwriter-1.0.0/svgwriter/export/_scene/__init__.py +73 -0
- pysvgwriter-1.0.0/svgwriter/export/_scene/__init__.pyi +10 -0
- pysvgwriter-1.0.0/svgwriter/export/_scene/_constants.py +28 -0
- pysvgwriter-1.0.0/svgwriter/export/_scene/_constants.pyi +29 -0
- pysvgwriter-1.0.0/svgwriter/export/_scene/_excalidraw.py +236 -0
- pysvgwriter-1.0.0/svgwriter/export/_scene/_excalidraw.pyi +11 -0
- pysvgwriter-1.0.0/svgwriter/export/_svg.py +106 -0
- pysvgwriter-1.0.0/svgwriter/export/_svg.pyi +13 -0
- pysvgwriter-1.0.0/svgwriter/export/_text.py +153 -0
- pysvgwriter-1.0.0/svgwriter/export/_text.pyi +7 -0
- pysvgwriter-1.0.0/svgwriter/export/_text_runs.py +132 -0
- pysvgwriter-1.0.0/svgwriter/export/_text_runs.pyi +33 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/__init__.py +270 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/__init__.pyi +33 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_constants.py +204 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_constants.pyi +245 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_eps.py +194 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_eps.pyi +9 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_eps_images.py +104 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_eps_images.pyi +0 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_eps_machine.py +263 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_eps_machine.pyi +60 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_eps_paths.py +74 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_eps_paths.pyi +0 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_eps_read.py +83 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_eps_read.pyi +5 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_eps_syntax.py +144 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_eps_syntax.pyi +32 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_eps_text.py +144 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_eps_text.pyi +0 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_pdf_content.py +307 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_pdf_content.pyi +8 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_pdf_objects.py +273 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_pdf_objects.pyi +23 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_pdf_paint.py +150 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_pdf_paint.pyi +20 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_pdf_painter.py +260 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_pdf_painter.pyi +68 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_pdf_read.py +92 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_pdf_read.pyi +9 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_reading.py +311 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_reading.pyi +95 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz.py +179 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz.pyi +10 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz_nodes.py +75 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz_nodes.pyi +34 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz_paths.py +257 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz_paths.pyi +40 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz_read.py +121 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz_read.pyi +5 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz_scopes.py +231 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz_scopes.pyi +32 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz_styles.py +166 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz_styles.pyi +49 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz_syntax.py +131 -0
- pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz_syntax.pyi +6 -0
- pysvgwriter-1.0.0/svgwriter/io/__init__.py +49 -0
- pysvgwriter-1.0.0/svgwriter/io/__init__.pyi +33 -0
- pysvgwriter-1.0.0/svgwriter/io/_async.py +114 -0
- pysvgwriter-1.0.0/svgwriter/io/_async.pyi +29 -0
- pysvgwriter-1.0.0/svgwriter/io/_constants.py +25 -0
- pysvgwriter-1.0.0/svgwriter/io/_constants.pyi +9 -0
- pysvgwriter-1.0.0/svgwriter/io/_markup.py +46 -0
- pysvgwriter-1.0.0/svgwriter/io/_markup.pyi +18 -0
- pysvgwriter-1.0.0/svgwriter/io/parser.py +224 -0
- pysvgwriter-1.0.0/svgwriter/io/parser.pyi +25 -0
- pysvgwriter-1.0.0/svgwriter/io/writer.py +383 -0
- pysvgwriter-1.0.0/svgwriter/io/writer.pyi +114 -0
- pysvgwriter-1.0.0/svgwriter/ops/__init__.py +75 -0
- pysvgwriter-1.0.0/svgwriter/ops/__init__.pyi +83 -0
- pysvgwriter-1.0.0/svgwriter/ops/_canvas.py +52 -0
- pysvgwriter-1.0.0/svgwriter/ops/_canvas.pyi +22 -0
- pysvgwriter-1.0.0/svgwriter/ops/_constants.py +168 -0
- pysvgwriter-1.0.0/svgwriter/ops/_constants.pyi +135 -0
- pysvgwriter-1.0.0/svgwriter/ops/_fonts.py +146 -0
- pysvgwriter-1.0.0/svgwriter/ops/_fonts.pyi +30 -0
- pysvgwriter-1.0.0/svgwriter/ops/_image_effects.py +148 -0
- pysvgwriter-1.0.0/svgwriter/ops/_image_effects.pyi +14 -0
- pysvgwriter-1.0.0/svgwriter/ops/_layers.py +378 -0
- pysvgwriter-1.0.0/svgwriter/ops/_layers.pyi +21 -0
- pysvgwriter-1.0.0/svgwriter/ops/_native_text.py +220 -0
- pysvgwriter-1.0.0/svgwriter/ops/_native_text.pyi +15 -0
- pysvgwriter-1.0.0/svgwriter/ops/_renderable.py +107 -0
- pysvgwriter-1.0.0/svgwriter/ops/_renderable.pyi +17 -0
- pysvgwriter-1.0.0/svgwriter/ops/_shaping.py +121 -0
- pysvgwriter-1.0.0/svgwriter/ops/_shaping.pyi +20 -0
- pysvgwriter-1.0.0/svgwriter/ops/_skia.py +168 -0
- pysvgwriter-1.0.0/svgwriter/ops/_skia.pyi +17 -0
- pysvgwriter-1.0.0/svgwriter/ops/boolean.py +241 -0
- pysvgwriter-1.0.0/svgwriter/ops/boolean.pyi +28 -0
- pysvgwriter-1.0.0/svgwriter/ops/composite.py +165 -0
- pysvgwriter-1.0.0/svgwriter/ops/composite.pyi +18 -0
- pysvgwriter-1.0.0/svgwriter/ops/graph.py +158 -0
- pysvgwriter-1.0.0/svgwriter/ops/graph.pyi +20 -0
- pysvgwriter-1.0.0/svgwriter/ops/interpolate.py +292 -0
- pysvgwriter-1.0.0/svgwriter/ops/interpolate.pyi +11 -0
- pysvgwriter-1.0.0/svgwriter/ops/measure.py +262 -0
- pysvgwriter-1.0.0/svgwriter/ops/measure.pyi +41 -0
- pysvgwriter-1.0.0/svgwriter/ops/parallel.py +81 -0
- pysvgwriter-1.0.0/svgwriter/ops/parallel.pyi +15 -0
- pysvgwriter-1.0.0/svgwriter/ops/plot.py +121 -0
- pysvgwriter-1.0.0/svgwriter/ops/plot.pyi +12 -0
- pysvgwriter-1.0.0/svgwriter/ops/render.py +518 -0
- pysvgwriter-1.0.0/svgwriter/ops/render.pyi +96 -0
- pysvgwriter-1.0.0/svgwriter/ops/text.py +423 -0
- pysvgwriter-1.0.0/svgwriter/ops/text.pyi +145 -0
- pysvgwriter-1.0.0/svgwriter/pathdata/__init__.py +44 -0
- pysvgwriter-1.0.0/svgwriter/pathdata/__init__.pyi +44 -0
- pysvgwriter-1.0.0/svgwriter/pathdata/_affine.py +103 -0
- pysvgwriter-1.0.0/svgwriter/pathdata/_affine.pyi +9 -0
- pysvgwriter-1.0.0/svgwriter/pathdata/_builder_curves.py +195 -0
- pysvgwriter-1.0.0/svgwriter/pathdata/_builder_curves.pyi +51 -0
- pysvgwriter-1.0.0/svgwriter/pathdata/_builder_shapes.py +137 -0
- pysvgwriter-1.0.0/svgwriter/pathdata/_builder_shapes.pyi +21 -0
- pysvgwriter-1.0.0/svgwriter/pathdata/_command_forms.py +113 -0
- pysvgwriter-1.0.0/svgwriter/pathdata/_command_forms.pyi +26 -0
- pysvgwriter-1.0.0/svgwriter/pathdata/_constants.py +45 -0
- pysvgwriter-1.0.0/svgwriter/pathdata/_constants.pyi +27 -0
- pysvgwriter-1.0.0/svgwriter/pathdata/_geometry.py +336 -0
- pysvgwriter-1.0.0/svgwriter/pathdata/_geometry.pyi +18 -0
- pysvgwriter-1.0.0/svgwriter/pathdata/arc.py +194 -0
- pysvgwriter-1.0.0/svgwriter/pathdata/arc.pyi +37 -0
- pysvgwriter-1.0.0/svgwriter/pathdata/builder.py +264 -0
- pysvgwriter-1.0.0/svgwriter/pathdata/builder.pyi +94 -0
- pysvgwriter-1.0.0/svgwriter/pathdata/commands.py +444 -0
- pysvgwriter-1.0.0/svgwriter/pathdata/commands.pyi +214 -0
- pysvgwriter-1.0.0/svgwriter/pathdata/data.py +357 -0
- pysvgwriter-1.0.0/svgwriter/pathdata/data.pyi +75 -0
- pysvgwriter-1.0.0/svgwriter/pathdata/parser.py +208 -0
- pysvgwriter-1.0.0/svgwriter/pathdata/parser.pyi +13 -0
- pysvgwriter-1.0.0/svgwriter/py.typed +0 -0
- pysvgwriter-1.0.0/svgwriter/transform/__init__.py +24 -0
- pysvgwriter-1.0.0/svgwriter/transform/__init__.pyi +33 -0
- pysvgwriter-1.0.0/svgwriter/transform/_constants.py +28 -0
- pysvgwriter-1.0.0/svgwriter/transform/_constants.pyi +8 -0
- pysvgwriter-1.0.0/svgwriter/transform/_matrix_constructors.py +201 -0
- pysvgwriter-1.0.0/svgwriter/transform/_matrix_constructors.pyi +24 -0
- pysvgwriter-1.0.0/svgwriter/transform/_matrix_text.py +94 -0
- pysvgwriter-1.0.0/svgwriter/transform/_matrix_text.pyi +12 -0
- pysvgwriter-1.0.0/svgwriter/transform/_transform_builders.py +157 -0
- pysvgwriter-1.0.0/svgwriter/transform/_transform_builders.pyi +4 -0
- pysvgwriter-1.0.0/svgwriter/transform/matrix.py +378 -0
- pysvgwriter-1.0.0/svgwriter/transform/matrix.pyi +64 -0
- pysvgwriter-1.0.0/svgwriter/transform/ops.py +304 -0
- pysvgwriter-1.0.0/svgwriter/transform/ops.pyi +86 -0
- pysvgwriter-1.0.0/svgwriter/transform/transform.py +327 -0
- pysvgwriter-1.0.0/svgwriter/transform/transform.pyi +40 -0
- pysvgwriter-1.0.0/svgwriter/video/__init__.py +55 -0
- pysvgwriter-1.0.0/svgwriter/video/__init__.pyi +45 -0
- pysvgwriter-1.0.0/svgwriter/video/_constants.py +67 -0
- pysvgwriter-1.0.0/svgwriter/video/_constants.pyi +49 -0
- pysvgwriter-1.0.0/svgwriter/video/_ffmpeg.py +223 -0
- pysvgwriter-1.0.0/svgwriter/video/_ffmpeg.pyi +32 -0
- pysvgwriter-1.0.0/svgwriter/video/_smil.py +256 -0
- pysvgwriter-1.0.0/svgwriter/video/_smil.pyi +5 -0
- pysvgwriter-1.0.0/svgwriter/video/animation.py +338 -0
- pysvgwriter-1.0.0/svgwriter/video/animation.pyi +53 -0
- pysvgwriter-1.0.0/svgwriter/video/frames.py +181 -0
- pysvgwriter-1.0.0/svgwriter/video/frames.pyi +39 -0
- pysvgwriter-1.0.0/svgwriter/video/reader.py +156 -0
- pysvgwriter-1.0.0/svgwriter/video/reader.pyi +26 -0
- pysvgwriter-1.0.0/tests/test_package.py +136 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Josue N Rivera
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pysvgwriter
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: SVG 1.1 as Python objects: draw, transform, combine, render and convert vector graphics.
|
|
5
|
+
Author: Josue N Rivera
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/wzjoriv/svgwriter
|
|
8
|
+
Project-URL: Repository, https://github.com/wzjoriv/svgwriter
|
|
9
|
+
Project-URL: Documentation, https://wzjoriv.github.io/svgwriter
|
|
10
|
+
Project-URL: Bug Tracker, https://github.com/wzjoriv/svgwriter/issues
|
|
11
|
+
Keywords: svg,vector,graphics,drawing,animation
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Classifier: Topic :: Multimedia :: Graphics
|
|
22
|
+
Classifier: Topic :: Multimedia :: Graphics :: Editors :: Vector-Based
|
|
23
|
+
Classifier: Typing :: Typed
|
|
24
|
+
Requires-Python: >=3.10
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: skia-python>=87
|
|
28
|
+
Requires-Dist: numpy>=1.24
|
|
29
|
+
Requires-Dist: uharfbuzz>=0.40
|
|
30
|
+
Provides-Extra: office
|
|
31
|
+
Requires-Dist: python-pptx>=1.0; extra == "office"
|
|
32
|
+
Requires-Dist: python-docx>=1.1; extra == "office"
|
|
33
|
+
Requires-Dist: openpyxl>=3.1; extra == "office"
|
|
34
|
+
Requires-Dist: pillow>=10; extra == "office"
|
|
35
|
+
Provides-Extra: plot
|
|
36
|
+
Requires-Dist: matplotlib>=3.7; extra == "plot"
|
|
37
|
+
Provides-Extra: graph
|
|
38
|
+
Requires-Dist: networkx>=3.0; extra == "graph"
|
|
39
|
+
Provides-Extra: math
|
|
40
|
+
Requires-Dist: ziamath>=0.11; extra == "math"
|
|
41
|
+
Provides-Extra: test
|
|
42
|
+
Requires-Dist: pysvgwriter[graph,math,office,plot]; extra == "test"
|
|
43
|
+
Requires-Dist: pytest>=7; extra == "test"
|
|
44
|
+
Requires-Dist: ezdxf>=1.0; extra == "test"
|
|
45
|
+
Requires-Dist: pillow>=10; extra == "test"
|
|
46
|
+
Requires-Dist: fonttools>=4.40; extra == "test"
|
|
47
|
+
Provides-Extra: dev
|
|
48
|
+
Requires-Dist: pysvgwriter[docs,test]; extra == "dev"
|
|
49
|
+
Requires-Dist: stubpy; extra == "dev"
|
|
50
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
51
|
+
Requires-Dist: ruff>=0.6; extra == "dev"
|
|
52
|
+
Requires-Dist: typer>=0.12; extra == "dev"
|
|
53
|
+
Requires-Dist: tomli; python_version < "3.11" and extra == "dev"
|
|
54
|
+
Provides-Extra: docs
|
|
55
|
+
Requires-Dist: sphinx>=7.0; extra == "docs"
|
|
56
|
+
Requires-Dist: furo>=2024.1.29; extra == "docs"
|
|
57
|
+
Requires-Dist: myst-parser>=2.0; extra == "docs"
|
|
58
|
+
Dynamic: license-file
|
|
59
|
+
|
|
60
|
+
# svgwriter
|
|
61
|
+
|
|
62
|
+
[](https://github.com/wzjoriv/svgwriter/actions/workflows/ci.yml)
|
|
63
|
+
[](https://wzjoriv.github.io/svgwriter)
|
|
64
|
+
[](https://pypi.org/project/pysvgwriter/)
|
|
65
|
+
[](https://pypi.org/project/pysvgwriter/)
|
|
66
|
+
[](https://github.com/wzjoriv/svgwriter/actions/workflows/ci.yml)
|
|
67
|
+
[](https://github.com/wzjoriv/svgwriter/actions/workflows/ci.yml)
|
|
68
|
+
[](LICENSE)
|
|
69
|
+
|
|
70
|
+
Build, edit and render vector graphics in Python with a complete SVG 1.1 object model. Shapes move,
|
|
71
|
+
rotate and scale through one transform; geometry has boolean operations and measurement; text, images
|
|
72
|
+
and colors are first-class (numpy-backed); documents render with skia and export to PNG, PDF, TikZ, DXF
|
|
73
|
+
and more. Python 3.10+, `pip install pysvgwriter` (brings skia-python, numpy and uharfbuzz), then `import svgwriter`.
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
import svgwriter as svg
|
|
77
|
+
|
|
78
|
+
doc = svg.Document() # sized to its content when saved or shown
|
|
79
|
+
doc.rect(0, 0, 160, 60, rx=12, fill=svg.LinearGradient.horizontal("gold", "tomato"))
|
|
80
|
+
doc.circle(30, 30, 18, fill=(1, 1, 1, 0.8)) # colors: names, CSS, or 0-1 tuples (alpha too)
|
|
81
|
+
title = doc.text("svgwriter", x=88, y=36, font_size=18, text_anchor="middle")
|
|
82
|
+
title[3:].fill = "navy" # style a character range (becomes a <tspan>)
|
|
83
|
+
|
|
84
|
+
star = svg.builder.star(0, 0, 10, points=5, fill="navy")
|
|
85
|
+
doc += star.place(30, 30).rotate(15) # placement and rotation go through `t`
|
|
86
|
+
|
|
87
|
+
doc.save("badge.svg") # also .png .pdf .tex .eps .dxf .ico ...
|
|
88
|
+
pixels = doc.rasterize(scale=2) # numpy float32 RGBA, shape (rows, cols, 4)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Feature overview
|
|
92
|
+
|
|
93
|
+
| Area | What you get |
|
|
94
|
+
| --- | --- |
|
|
95
|
+
| Elements | Every static SVG 1.1 element as a class with a lowercase alias (`svg.Circle` / `svg.circle`); every attribute readable and writable by its Python name (`el.stroke_width`, `el.view_box`) |
|
|
96
|
+
| Placement | `el.t` is one affine `Matrix`; `translate`, `rotate`, `scale`, `skew`, `flip_x`/`flip_y` (parent or `local=True` frame) about an `anchor` (bounding-box centre unless pinned); `place(x, y)`, `position`, `bounds()` |
|
|
97
|
+
| Operators | `el + (dx, dy)`, `el * 2`, `el @ 30` (rotate), `M @ el`; `a \| b`, `a & b`, `a - b`, `a ^ b` boolean ops on shapes, text, groups and `<use>` |
|
|
98
|
+
| Paths | Fluent `svg.path().move_to(0, 0).line_to(10, 0).arc_to(5, 5, 10, 10).close()`; `path.nodes` as an `(N, 2)` array; length, point at length, contains, exact bounds, stroke-to-path, simplify |
|
|
99
|
+
| Conversions | `to_path()` (text via glyph outlines, groups merged, clips flattened), `to_image()`, `rasterize()`, `to_group()`, `clone(linked=True)` for `<use>`; clear errors when impossible |
|
|
100
|
+
| Clipping | `art.clip(svg.circle(50, 50, 40))` on any element; `flatten_clip()` |
|
|
101
|
+
| Text | `text[i]` / `text[a:b]` move, rotate or style characters while staying real text; `tspan` layout, CSS and inherited fonts; `text.glyphs()` for free-form outlines |
|
|
102
|
+
| Colors and images | `Color` in 0-1 floats with alpha (auto `*-opacity`); `Image(numpy_array)` with color channels and broadcastable alpha; `Image.open("photo.png")`; Porter-Duff compositing `a \| b` (over), `a & b` (in), `a - b` (out), `a ^ b`, `a * b` (multiply), `a.composite(b, "screen")` |
|
|
103
|
+
| Documents | `doc[0]`, `doc["logo"]`, `for el in doc`; auto-size to content; definitions land in `<defs>` when referenced; plots and anything with `_repr_svg_` or `savefig` can be added; notebook display |
|
|
104
|
+
| Rendering | skia: `rasterize(size=..., padding=...)` to numpy, embedded and linked images, text, CSS `<style>`; deterministic output |
|
|
105
|
+
| Export / import | Registry by name or extension. Out: SVG, SVGZ, PNG, JPEG, WebP, BMP, GIF, PPM, PDF (vector), TikZ, EPS, DXF, HPGL, G-code, Excalidraw, ICO, ICNS. In: SVG, SVGZ, PNG, JPEG, WebP, GIF, BMP, PNM, PDF, TikZ, EPS (their vector paths), DXF, HPGL, G-code, Excalidraw, ICO, ICNS, Graphviz DOT and Mermaid diagrams through their tools, and with `pysvgwriter[office]` PowerPoint (editable shapes, both ways) plus Word and Excel (picture). `svg.export.register(...)` for more |
|
|
106
|
+
| Animation | SMIL elements; `doc.render_animation("out.mp4", update=...)` through ffmpeg; `svg.interpolate(a, b, t)` tweens numbers, colors, transforms and morphs any two shapes |
|
|
107
|
+
|
|
108
|
+
## Geometry in one minute
|
|
109
|
+
|
|
110
|
+
SVG coordinates are an element's own geometry and are written exactly as given; everything after that
|
|
111
|
+
goes through the transform, so the output stays the SVG a person would write.
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
import svgwriter as svg
|
|
115
|
+
|
|
116
|
+
c = svg.circle(50, 50, 10) # writes cx="50" cy="50" r="10"
|
|
117
|
+
c.translate(20, 0).rotate(45) # parent axes by default; local=True for the shape's own axes
|
|
118
|
+
print(c.cx, c.position) # 50.0 (local geometry) and where its centre is now: (70, 50)
|
|
119
|
+
print(c.t) # shortest equivalent transform text
|
|
120
|
+
|
|
121
|
+
ring = svg.circle(0, 0, 40) - svg.circle(0, 0, 25) # boolean difference, a <path>
|
|
122
|
+
print(round(ring.total_length(), 1), ring.contains_point(0, 0))
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
`*` and `@` never bake coordinates: `el * 2` is a scaled copy, `el @ 30` a rotated copy and `M @ el` a
|
|
126
|
+
copy with matrix `M` applied. Baking is explicit: `el.to_path()` folds the transform into `d`.
|
|
127
|
+
|
|
128
|
+
## Export and import
|
|
129
|
+
|
|
130
|
+
```python
|
|
131
|
+
doc.save("figure.pdf") # vector PDF
|
|
132
|
+
doc.save("figure.tex", standalone=True) # TikZ picture
|
|
133
|
+
doc.save("plate.dxf") # CAD/CNC polylines in millimetres
|
|
134
|
+
doc.save("icon.ico", sizes=(16, 32, 48), padding=4)
|
|
135
|
+
svg.Document.open("sketch.excalidraw").save("sketch.svg")
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Development
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
pip install -e ".[dev]"
|
|
142
|
+
python scripts/dev.py test # test tiers
|
|
143
|
+
python scripts/dev.py check # ruff, tests, docs
|
|
144
|
+
python scripts/dev.py stub generate # refresh the shipped .pyi stubs after API changes (stub check verifies)
|
|
145
|
+
python scripts/dev.py svgwriter conformance # W3C SVG 1.1 suite (after: svgwriter fetch-suite)
|
|
146
|
+
python scripts/dev.py svgwriter bench # timing of the hot paths
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
MIT licensed.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# svgwriter
|
|
2
|
+
|
|
3
|
+
[](https://github.com/wzjoriv/svgwriter/actions/workflows/ci.yml)
|
|
4
|
+
[](https://wzjoriv.github.io/svgwriter)
|
|
5
|
+
[](https://pypi.org/project/pysvgwriter/)
|
|
6
|
+
[](https://pypi.org/project/pysvgwriter/)
|
|
7
|
+
[](https://github.com/wzjoriv/svgwriter/actions/workflows/ci.yml)
|
|
8
|
+
[](https://github.com/wzjoriv/svgwriter/actions/workflows/ci.yml)
|
|
9
|
+
[](LICENSE)
|
|
10
|
+
|
|
11
|
+
Build, edit and render vector graphics in Python with a complete SVG 1.1 object model. Shapes move,
|
|
12
|
+
rotate and scale through one transform; geometry has boolean operations and measurement; text, images
|
|
13
|
+
and colors are first-class (numpy-backed); documents render with skia and export to PNG, PDF, TikZ, DXF
|
|
14
|
+
and more. Python 3.10+, `pip install pysvgwriter` (brings skia-python, numpy and uharfbuzz), then `import svgwriter`.
|
|
15
|
+
|
|
16
|
+
```python
|
|
17
|
+
import svgwriter as svg
|
|
18
|
+
|
|
19
|
+
doc = svg.Document() # sized to its content when saved or shown
|
|
20
|
+
doc.rect(0, 0, 160, 60, rx=12, fill=svg.LinearGradient.horizontal("gold", "tomato"))
|
|
21
|
+
doc.circle(30, 30, 18, fill=(1, 1, 1, 0.8)) # colors: names, CSS, or 0-1 tuples (alpha too)
|
|
22
|
+
title = doc.text("svgwriter", x=88, y=36, font_size=18, text_anchor="middle")
|
|
23
|
+
title[3:].fill = "navy" # style a character range (becomes a <tspan>)
|
|
24
|
+
|
|
25
|
+
star = svg.builder.star(0, 0, 10, points=5, fill="navy")
|
|
26
|
+
doc += star.place(30, 30).rotate(15) # placement and rotation go through `t`
|
|
27
|
+
|
|
28
|
+
doc.save("badge.svg") # also .png .pdf .tex .eps .dxf .ico ...
|
|
29
|
+
pixels = doc.rasterize(scale=2) # numpy float32 RGBA, shape (rows, cols, 4)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Feature overview
|
|
33
|
+
|
|
34
|
+
| Area | What you get |
|
|
35
|
+
| --- | --- |
|
|
36
|
+
| Elements | Every static SVG 1.1 element as a class with a lowercase alias (`svg.Circle` / `svg.circle`); every attribute readable and writable by its Python name (`el.stroke_width`, `el.view_box`) |
|
|
37
|
+
| Placement | `el.t` is one affine `Matrix`; `translate`, `rotate`, `scale`, `skew`, `flip_x`/`flip_y` (parent or `local=True` frame) about an `anchor` (bounding-box centre unless pinned); `place(x, y)`, `position`, `bounds()` |
|
|
38
|
+
| Operators | `el + (dx, dy)`, `el * 2`, `el @ 30` (rotate), `M @ el`; `a \| b`, `a & b`, `a - b`, `a ^ b` boolean ops on shapes, text, groups and `<use>` |
|
|
39
|
+
| Paths | Fluent `svg.path().move_to(0, 0).line_to(10, 0).arc_to(5, 5, 10, 10).close()`; `path.nodes` as an `(N, 2)` array; length, point at length, contains, exact bounds, stroke-to-path, simplify |
|
|
40
|
+
| Conversions | `to_path()` (text via glyph outlines, groups merged, clips flattened), `to_image()`, `rasterize()`, `to_group()`, `clone(linked=True)` for `<use>`; clear errors when impossible |
|
|
41
|
+
| Clipping | `art.clip(svg.circle(50, 50, 40))` on any element; `flatten_clip()` |
|
|
42
|
+
| Text | `text[i]` / `text[a:b]` move, rotate or style characters while staying real text; `tspan` layout, CSS and inherited fonts; `text.glyphs()` for free-form outlines |
|
|
43
|
+
| Colors and images | `Color` in 0-1 floats with alpha (auto `*-opacity`); `Image(numpy_array)` with color channels and broadcastable alpha; `Image.open("photo.png")`; Porter-Duff compositing `a \| b` (over), `a & b` (in), `a - b` (out), `a ^ b`, `a * b` (multiply), `a.composite(b, "screen")` |
|
|
44
|
+
| Documents | `doc[0]`, `doc["logo"]`, `for el in doc`; auto-size to content; definitions land in `<defs>` when referenced; plots and anything with `_repr_svg_` or `savefig` can be added; notebook display |
|
|
45
|
+
| Rendering | skia: `rasterize(size=..., padding=...)` to numpy, embedded and linked images, text, CSS `<style>`; deterministic output |
|
|
46
|
+
| Export / import | Registry by name or extension. Out: SVG, SVGZ, PNG, JPEG, WebP, BMP, GIF, PPM, PDF (vector), TikZ, EPS, DXF, HPGL, G-code, Excalidraw, ICO, ICNS. In: SVG, SVGZ, PNG, JPEG, WebP, GIF, BMP, PNM, PDF, TikZ, EPS (their vector paths), DXF, HPGL, G-code, Excalidraw, ICO, ICNS, Graphviz DOT and Mermaid diagrams through their tools, and with `pysvgwriter[office]` PowerPoint (editable shapes, both ways) plus Word and Excel (picture). `svg.export.register(...)` for more |
|
|
47
|
+
| Animation | SMIL elements; `doc.render_animation("out.mp4", update=...)` through ffmpeg; `svg.interpolate(a, b, t)` tweens numbers, colors, transforms and morphs any two shapes |
|
|
48
|
+
|
|
49
|
+
## Geometry in one minute
|
|
50
|
+
|
|
51
|
+
SVG coordinates are an element's own geometry and are written exactly as given; everything after that
|
|
52
|
+
goes through the transform, so the output stays the SVG a person would write.
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
import svgwriter as svg
|
|
56
|
+
|
|
57
|
+
c = svg.circle(50, 50, 10) # writes cx="50" cy="50" r="10"
|
|
58
|
+
c.translate(20, 0).rotate(45) # parent axes by default; local=True for the shape's own axes
|
|
59
|
+
print(c.cx, c.position) # 50.0 (local geometry) and where its centre is now: (70, 50)
|
|
60
|
+
print(c.t) # shortest equivalent transform text
|
|
61
|
+
|
|
62
|
+
ring = svg.circle(0, 0, 40) - svg.circle(0, 0, 25) # boolean difference, a <path>
|
|
63
|
+
print(round(ring.total_length(), 1), ring.contains_point(0, 0))
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`*` and `@` never bake coordinates: `el * 2` is a scaled copy, `el @ 30` a rotated copy and `M @ el` a
|
|
67
|
+
copy with matrix `M` applied. Baking is explicit: `el.to_path()` folds the transform into `d`.
|
|
68
|
+
|
|
69
|
+
## Export and import
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
doc.save("figure.pdf") # vector PDF
|
|
73
|
+
doc.save("figure.tex", standalone=True) # TikZ picture
|
|
74
|
+
doc.save("plate.dxf") # CAD/CNC polylines in millimetres
|
|
75
|
+
doc.save("icon.ico", sizes=(16, 32, 48), padding=4)
|
|
76
|
+
svg.Document.open("sketch.excalidraw").save("sketch.svg")
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Development
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
pip install -e ".[dev]"
|
|
83
|
+
python scripts/dev.py test # test tiers
|
|
84
|
+
python scripts/dev.py check # ruff, tests, docs
|
|
85
|
+
python scripts/dev.py stub generate # refresh the shipped .pyi stubs after API changes (stub check verifies)
|
|
86
|
+
python scripts/dev.py svgwriter conformance # W3C SVG 1.1 suite (after: svgwriter fetch-suite)
|
|
87
|
+
python scripts/dev.py svgwriter bench # timing of the hot paths
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
MIT licensed.
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "pysvgwriter"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "SVG 1.1 as Python objects: draw, transform, combine, render and convert vector graphics."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
authors = [{ name = "Josue N Rivera" }]
|
|
14
|
+
dependencies = [
|
|
15
|
+
"skia-python>=87",
|
|
16
|
+
"numpy>=1.24",
|
|
17
|
+
"uharfbuzz>=0.40",
|
|
18
|
+
]
|
|
19
|
+
keywords = ["svg", "vector", "graphics", "drawing", "animation"]
|
|
20
|
+
classifiers = [
|
|
21
|
+
"Development Status :: 4 - Beta",
|
|
22
|
+
"Intended Audience :: Developers",
|
|
23
|
+
"Intended Audience :: Science/Research",
|
|
24
|
+
"Programming Language :: Python :: 3",
|
|
25
|
+
"Programming Language :: Python :: 3.10",
|
|
26
|
+
"Programming Language :: Python :: 3.11",
|
|
27
|
+
"Programming Language :: Python :: 3.12",
|
|
28
|
+
"Programming Language :: Python :: 3.13",
|
|
29
|
+
"Programming Language :: Python :: 3.14",
|
|
30
|
+
"Topic :: Multimedia :: Graphics",
|
|
31
|
+
"Topic :: Multimedia :: Graphics :: Editors :: Vector-Based",
|
|
32
|
+
"Typing :: Typed",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
[project.urls]
|
|
36
|
+
Homepage = "https://github.com/wzjoriv/svgwriter"
|
|
37
|
+
Repository = "https://github.com/wzjoriv/svgwriter"
|
|
38
|
+
Documentation = "https://wzjoriv.github.io/svgwriter"
|
|
39
|
+
"Bug Tracker" = "https://github.com/wzjoriv/svgwriter/issues"
|
|
40
|
+
|
|
41
|
+
[project.optional-dependencies]
|
|
42
|
+
office = [
|
|
43
|
+
"python-pptx>=1.0",
|
|
44
|
+
"python-docx>=1.1",
|
|
45
|
+
"openpyxl>=3.1",
|
|
46
|
+
"pillow>=10",
|
|
47
|
+
]
|
|
48
|
+
plot = [
|
|
49
|
+
"matplotlib>=3.7",
|
|
50
|
+
]
|
|
51
|
+
graph = [
|
|
52
|
+
"networkx>=3.0",
|
|
53
|
+
]
|
|
54
|
+
math = [
|
|
55
|
+
"ziamath>=0.11",
|
|
56
|
+
]
|
|
57
|
+
test = [
|
|
58
|
+
"pysvgwriter[office,plot,graph,math]",
|
|
59
|
+
"pytest>=7",
|
|
60
|
+
"ezdxf>=1.0",
|
|
61
|
+
"pillow>=10",
|
|
62
|
+
"fonttools>=4.40",
|
|
63
|
+
]
|
|
64
|
+
dev = [
|
|
65
|
+
"pysvgwriter[test,docs]",
|
|
66
|
+
"stubpy",
|
|
67
|
+
"pytest-cov",
|
|
68
|
+
"ruff>=0.6",
|
|
69
|
+
"typer>=0.12",
|
|
70
|
+
"tomli; python_version < '3.11'",
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
docs = [
|
|
74
|
+
"sphinx>=7.0",
|
|
75
|
+
"furo>=2024.1.29",
|
|
76
|
+
"myst-parser>=2.0",
|
|
77
|
+
]
|
|
78
|
+
|
|
79
|
+
[project.scripts]
|
|
80
|
+
svgwriter = "svgwriter.__main__:main"
|
|
81
|
+
|
|
82
|
+
[tool.setuptools.dynamic]
|
|
83
|
+
version = { attr = "svgwriter.__version__" }
|
|
84
|
+
|
|
85
|
+
[tool.setuptools.packages.find]
|
|
86
|
+
include = ["svgwriter*"]
|
|
87
|
+
|
|
88
|
+
[tool.setuptools.package-data]
|
|
89
|
+
svgwriter = ["py.typed", "*.pyi", "**/*.pyi"]
|
|
90
|
+
|
|
91
|
+
[tool.pytest.ini_options]
|
|
92
|
+
testpaths = ["tests"]
|
|
93
|
+
|
|
94
|
+
[tool.ruff]
|
|
95
|
+
line-length = 110
|
|
96
|
+
target-version = "py310"
|
|
97
|
+
include = ["svgwriter/**/*.py", "tests/**/*.py", "scripts/**/*.py", "examples/**/*.py"]
|
|
98
|
+
extend-exclude = ["build", "*.egg-info", "scripts/devkit", ".venv"]
|
|
99
|
+
|
|
100
|
+
[tool.ruff.lint]
|
|
101
|
+
select = ["E", "F", "W", "I", "UP", "B", "C4", "ANN001", "ANN002", "ANN003", "ANN201", "ANN202", "ANN204", "ANN205", "ANN206"]
|
|
102
|
+
ignore = ["E501"]
|
|
103
|
+
|
|
104
|
+
[tool.ruff.lint.per-file-ignores]
|
|
105
|
+
"scripts/**/*.py" = ["B008", "ANN"]
|
|
106
|
+
"tests/**/*.py" = ["ANN", "UP006", "UP007", "UP035", "UP037", "UP045", "E701", "E702", "E741"]
|
|
107
|
+
|
|
108
|
+
[tool.devkit]
|
|
109
|
+
tools = ["svgwriter_tools:app"]
|
|
110
|
+
|
|
111
|
+
[tool.devkit.stub]
|
|
112
|
+
targets = ["svgwriter"]
|
|
113
|
+
output = "."
|
|
114
|
+
|
|
115
|
+
[tool.devkit.version]
|
|
116
|
+
file = "svgwriter/__init__.py"
|
|
117
|
+
tag = "{version}"
|
|
118
|
+
|
|
119
|
+
[tool.devkit.docs]
|
|
120
|
+
source = "docs"
|
|
121
|
+
out = "docs/_build/html"
|
|
122
|
+
|
|
123
|
+
[tool.devkit.check]
|
|
124
|
+
lint = ["svgwriter", "scripts", "tests", "examples"]
|
|
125
|
+
tests = ["-q", "-p", "no:cacheprovider"]
|
|
126
|
+
docs = "docs"
|
|
127
|
+
|
|
128
|
+
[tool.devkit.tiers]
|
|
129
|
+
default = "quick"
|
|
130
|
+
log_dir = "build/test-logs"
|
|
131
|
+
|
|
132
|
+
[tool.devkit.tiers.quick]
|
|
133
|
+
help = "The whole suite, quiet."
|
|
134
|
+
args = ["tests", "-q", "-p", "no:cacheprovider"]
|
|
135
|
+
|
|
136
|
+
[tool.devkit.tiers.cov]
|
|
137
|
+
help = "The whole suite with a coverage report."
|
|
138
|
+
args = ["tests", "-q", "--cov=svgwriter", "--cov-report=term-missing"]
|
|
139
|
+
|
|
140
|
+
[tool.devkit.logo]
|
|
141
|
+
source = "examples.logo:logo"
|
|
142
|
+
variants = { dark = { theme = "dark" }, mono = { mono = true } }
|
|
143
|
+
output = "docs/_static/logo"
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pysvgwriter
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: SVG 1.1 as Python objects: draw, transform, combine, render and convert vector graphics.
|
|
5
|
+
Author: Josue N Rivera
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/wzjoriv/svgwriter
|
|
8
|
+
Project-URL: Repository, https://github.com/wzjoriv/svgwriter
|
|
9
|
+
Project-URL: Documentation, https://wzjoriv.github.io/svgwriter
|
|
10
|
+
Project-URL: Bug Tracker, https://github.com/wzjoriv/svgwriter/issues
|
|
11
|
+
Keywords: svg,vector,graphics,drawing,animation
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Classifier: Topic :: Multimedia :: Graphics
|
|
22
|
+
Classifier: Topic :: Multimedia :: Graphics :: Editors :: Vector-Based
|
|
23
|
+
Classifier: Typing :: Typed
|
|
24
|
+
Requires-Python: >=3.10
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: skia-python>=87
|
|
28
|
+
Requires-Dist: numpy>=1.24
|
|
29
|
+
Requires-Dist: uharfbuzz>=0.40
|
|
30
|
+
Provides-Extra: office
|
|
31
|
+
Requires-Dist: python-pptx>=1.0; extra == "office"
|
|
32
|
+
Requires-Dist: python-docx>=1.1; extra == "office"
|
|
33
|
+
Requires-Dist: openpyxl>=3.1; extra == "office"
|
|
34
|
+
Requires-Dist: pillow>=10; extra == "office"
|
|
35
|
+
Provides-Extra: plot
|
|
36
|
+
Requires-Dist: matplotlib>=3.7; extra == "plot"
|
|
37
|
+
Provides-Extra: graph
|
|
38
|
+
Requires-Dist: networkx>=3.0; extra == "graph"
|
|
39
|
+
Provides-Extra: math
|
|
40
|
+
Requires-Dist: ziamath>=0.11; extra == "math"
|
|
41
|
+
Provides-Extra: test
|
|
42
|
+
Requires-Dist: pysvgwriter[graph,math,office,plot]; extra == "test"
|
|
43
|
+
Requires-Dist: pytest>=7; extra == "test"
|
|
44
|
+
Requires-Dist: ezdxf>=1.0; extra == "test"
|
|
45
|
+
Requires-Dist: pillow>=10; extra == "test"
|
|
46
|
+
Requires-Dist: fonttools>=4.40; extra == "test"
|
|
47
|
+
Provides-Extra: dev
|
|
48
|
+
Requires-Dist: pysvgwriter[docs,test]; extra == "dev"
|
|
49
|
+
Requires-Dist: stubpy; extra == "dev"
|
|
50
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
51
|
+
Requires-Dist: ruff>=0.6; extra == "dev"
|
|
52
|
+
Requires-Dist: typer>=0.12; extra == "dev"
|
|
53
|
+
Requires-Dist: tomli; python_version < "3.11" and extra == "dev"
|
|
54
|
+
Provides-Extra: docs
|
|
55
|
+
Requires-Dist: sphinx>=7.0; extra == "docs"
|
|
56
|
+
Requires-Dist: furo>=2024.1.29; extra == "docs"
|
|
57
|
+
Requires-Dist: myst-parser>=2.0; extra == "docs"
|
|
58
|
+
Dynamic: license-file
|
|
59
|
+
|
|
60
|
+
# svgwriter
|
|
61
|
+
|
|
62
|
+
[](https://github.com/wzjoriv/svgwriter/actions/workflows/ci.yml)
|
|
63
|
+
[](https://wzjoriv.github.io/svgwriter)
|
|
64
|
+
[](https://pypi.org/project/pysvgwriter/)
|
|
65
|
+
[](https://pypi.org/project/pysvgwriter/)
|
|
66
|
+
[](https://github.com/wzjoriv/svgwriter/actions/workflows/ci.yml)
|
|
67
|
+
[](https://github.com/wzjoriv/svgwriter/actions/workflows/ci.yml)
|
|
68
|
+
[](LICENSE)
|
|
69
|
+
|
|
70
|
+
Build, edit and render vector graphics in Python with a complete SVG 1.1 object model. Shapes move,
|
|
71
|
+
rotate and scale through one transform; geometry has boolean operations and measurement; text, images
|
|
72
|
+
and colors are first-class (numpy-backed); documents render with skia and export to PNG, PDF, TikZ, DXF
|
|
73
|
+
and more. Python 3.10+, `pip install pysvgwriter` (brings skia-python, numpy and uharfbuzz), then `import svgwriter`.
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
import svgwriter as svg
|
|
77
|
+
|
|
78
|
+
doc = svg.Document() # sized to its content when saved or shown
|
|
79
|
+
doc.rect(0, 0, 160, 60, rx=12, fill=svg.LinearGradient.horizontal("gold", "tomato"))
|
|
80
|
+
doc.circle(30, 30, 18, fill=(1, 1, 1, 0.8)) # colors: names, CSS, or 0-1 tuples (alpha too)
|
|
81
|
+
title = doc.text("svgwriter", x=88, y=36, font_size=18, text_anchor="middle")
|
|
82
|
+
title[3:].fill = "navy" # style a character range (becomes a <tspan>)
|
|
83
|
+
|
|
84
|
+
star = svg.builder.star(0, 0, 10, points=5, fill="navy")
|
|
85
|
+
doc += star.place(30, 30).rotate(15) # placement and rotation go through `t`
|
|
86
|
+
|
|
87
|
+
doc.save("badge.svg") # also .png .pdf .tex .eps .dxf .ico ...
|
|
88
|
+
pixels = doc.rasterize(scale=2) # numpy float32 RGBA, shape (rows, cols, 4)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Feature overview
|
|
92
|
+
|
|
93
|
+
| Area | What you get |
|
|
94
|
+
| --- | --- |
|
|
95
|
+
| Elements | Every static SVG 1.1 element as a class with a lowercase alias (`svg.Circle` / `svg.circle`); every attribute readable and writable by its Python name (`el.stroke_width`, `el.view_box`) |
|
|
96
|
+
| Placement | `el.t` is one affine `Matrix`; `translate`, `rotate`, `scale`, `skew`, `flip_x`/`flip_y` (parent or `local=True` frame) about an `anchor` (bounding-box centre unless pinned); `place(x, y)`, `position`, `bounds()` |
|
|
97
|
+
| Operators | `el + (dx, dy)`, `el * 2`, `el @ 30` (rotate), `M @ el`; `a \| b`, `a & b`, `a - b`, `a ^ b` boolean ops on shapes, text, groups and `<use>` |
|
|
98
|
+
| Paths | Fluent `svg.path().move_to(0, 0).line_to(10, 0).arc_to(5, 5, 10, 10).close()`; `path.nodes` as an `(N, 2)` array; length, point at length, contains, exact bounds, stroke-to-path, simplify |
|
|
99
|
+
| Conversions | `to_path()` (text via glyph outlines, groups merged, clips flattened), `to_image()`, `rasterize()`, `to_group()`, `clone(linked=True)` for `<use>`; clear errors when impossible |
|
|
100
|
+
| Clipping | `art.clip(svg.circle(50, 50, 40))` on any element; `flatten_clip()` |
|
|
101
|
+
| Text | `text[i]` / `text[a:b]` move, rotate or style characters while staying real text; `tspan` layout, CSS and inherited fonts; `text.glyphs()` for free-form outlines |
|
|
102
|
+
| Colors and images | `Color` in 0-1 floats with alpha (auto `*-opacity`); `Image(numpy_array)` with color channels and broadcastable alpha; `Image.open("photo.png")`; Porter-Duff compositing `a \| b` (over), `a & b` (in), `a - b` (out), `a ^ b`, `a * b` (multiply), `a.composite(b, "screen")` |
|
|
103
|
+
| Documents | `doc[0]`, `doc["logo"]`, `for el in doc`; auto-size to content; definitions land in `<defs>` when referenced; plots and anything with `_repr_svg_` or `savefig` can be added; notebook display |
|
|
104
|
+
| Rendering | skia: `rasterize(size=..., padding=...)` to numpy, embedded and linked images, text, CSS `<style>`; deterministic output |
|
|
105
|
+
| Export / import | Registry by name or extension. Out: SVG, SVGZ, PNG, JPEG, WebP, BMP, GIF, PPM, PDF (vector), TikZ, EPS, DXF, HPGL, G-code, Excalidraw, ICO, ICNS. In: SVG, SVGZ, PNG, JPEG, WebP, GIF, BMP, PNM, PDF, TikZ, EPS (their vector paths), DXF, HPGL, G-code, Excalidraw, ICO, ICNS, Graphviz DOT and Mermaid diagrams through their tools, and with `pysvgwriter[office]` PowerPoint (editable shapes, both ways) plus Word and Excel (picture). `svg.export.register(...)` for more |
|
|
106
|
+
| Animation | SMIL elements; `doc.render_animation("out.mp4", update=...)` through ffmpeg; `svg.interpolate(a, b, t)` tweens numbers, colors, transforms and morphs any two shapes |
|
|
107
|
+
|
|
108
|
+
## Geometry in one minute
|
|
109
|
+
|
|
110
|
+
SVG coordinates are an element's own geometry and are written exactly as given; everything after that
|
|
111
|
+
goes through the transform, so the output stays the SVG a person would write.
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
import svgwriter as svg
|
|
115
|
+
|
|
116
|
+
c = svg.circle(50, 50, 10) # writes cx="50" cy="50" r="10"
|
|
117
|
+
c.translate(20, 0).rotate(45) # parent axes by default; local=True for the shape's own axes
|
|
118
|
+
print(c.cx, c.position) # 50.0 (local geometry) and where its centre is now: (70, 50)
|
|
119
|
+
print(c.t) # shortest equivalent transform text
|
|
120
|
+
|
|
121
|
+
ring = svg.circle(0, 0, 40) - svg.circle(0, 0, 25) # boolean difference, a <path>
|
|
122
|
+
print(round(ring.total_length(), 1), ring.contains_point(0, 0))
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
`*` and `@` never bake coordinates: `el * 2` is a scaled copy, `el @ 30` a rotated copy and `M @ el` a
|
|
126
|
+
copy with matrix `M` applied. Baking is explicit: `el.to_path()` folds the transform into `d`.
|
|
127
|
+
|
|
128
|
+
## Export and import
|
|
129
|
+
|
|
130
|
+
```python
|
|
131
|
+
doc.save("figure.pdf") # vector PDF
|
|
132
|
+
doc.save("figure.tex", standalone=True) # TikZ picture
|
|
133
|
+
doc.save("plate.dxf") # CAD/CNC polylines in millimetres
|
|
134
|
+
doc.save("icon.ico", sizes=(16, 32, 48), padding=4)
|
|
135
|
+
svg.Document.open("sketch.excalidraw").save("sketch.svg")
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Development
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
pip install -e ".[dev]"
|
|
142
|
+
python scripts/dev.py test # test tiers
|
|
143
|
+
python scripts/dev.py check # ruff, tests, docs
|
|
144
|
+
python scripts/dev.py stub generate # refresh the shipped .pyi stubs after API changes (stub check verifies)
|
|
145
|
+
python scripts/dev.py svgwriter conformance # W3C SVG 1.1 suite (after: svgwriter fetch-suite)
|
|
146
|
+
python scripts/dev.py svgwriter bench # timing of the hot paths
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
MIT licensed.
|