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.
Files changed (469) hide show
  1. pysvgwriter-1.0.0/LICENSE +21 -0
  2. pysvgwriter-1.0.0/PKG-INFO +149 -0
  3. pysvgwriter-1.0.0/README.md +90 -0
  4. pysvgwriter-1.0.0/pyproject.toml +143 -0
  5. pysvgwriter-1.0.0/pysvgwriter.egg-info/PKG-INFO +149 -0
  6. pysvgwriter-1.0.0/pysvgwriter.egg-info/SOURCES.txt +467 -0
  7. pysvgwriter-1.0.0/pysvgwriter.egg-info/dependency_links.txt +1 -0
  8. pysvgwriter-1.0.0/pysvgwriter.egg-info/entry_points.txt +2 -0
  9. pysvgwriter-1.0.0/pysvgwriter.egg-info/requires.txt +40 -0
  10. pysvgwriter-1.0.0/pysvgwriter.egg-info/top_level.txt +1 -0
  11. pysvgwriter-1.0.0/setup.cfg +4 -0
  12. pysvgwriter-1.0.0/svgwriter/__init__.py +195 -0
  13. pysvgwriter-1.0.0/svgwriter/__init__.pyi +526 -0
  14. pysvgwriter-1.0.0/svgwriter/__main__.py +12 -0
  15. pysvgwriter-1.0.0/svgwriter/__main__.pyi +3 -0
  16. pysvgwriter-1.0.0/svgwriter/_document/__init__.py +3 -0
  17. pysvgwriter-1.0.0/svgwriter/_document/__init__.pyi +0 -0
  18. pysvgwriter-1.0.0/svgwriter/_document/_constants.py +16 -0
  19. pysvgwriter-1.0.0/svgwriter/_document/_constants.pyi +6 -0
  20. pysvgwriter-1.0.0/svgwriter/_document/access.py +125 -0
  21. pysvgwriter-1.0.0/svgwriter/_document/access.pyi +21 -0
  22. pysvgwriter-1.0.0/svgwriter/_document/ingest.py +114 -0
  23. pysvgwriter-1.0.0/svgwriter/_document/ingest.pyi +7 -0
  24. pysvgwriter-1.0.0/svgwriter/_document/output.py +374 -0
  25. pysvgwriter-1.0.0/svgwriter/_document/output.pyi +66 -0
  26. pysvgwriter-1.0.0/svgwriter/_document/sizing.py +120 -0
  27. pysvgwriter-1.0.0/svgwriter/_document/sizing.pyi +12 -0
  28. pysvgwriter-1.0.0/svgwriter/_internal/__init__.py +5 -0
  29. pysvgwriter-1.0.0/svgwriter/_internal/__init__.pyi +0 -0
  30. pysvgwriter-1.0.0/svgwriter/_internal/_constants.py +80 -0
  31. pysvgwriter-1.0.0/svgwriter/_internal/_constants.pyi +55 -0
  32. pysvgwriter-1.0.0/svgwriter/_internal/_drawable.py +82 -0
  33. pysvgwriter-1.0.0/svgwriter/_internal/_drawable.pyi +4 -0
  34. pysvgwriter-1.0.0/svgwriter/_internal/_escape.py +19 -0
  35. pysvgwriter-1.0.0/svgwriter/_internal/_escape.pyi +5 -0
  36. pysvgwriter-1.0.0/svgwriter/_internal/_hybrid.py +45 -0
  37. pysvgwriter-1.0.0/svgwriter/_internal/_hybrid.pyi +16 -0
  38. pysvgwriter-1.0.0/svgwriter/_internal/_ids.py +33 -0
  39. pysvgwriter-1.0.0/svgwriter/_internal/_ids.pyi +10 -0
  40. pysvgwriter-1.0.0/svgwriter/_internal/_numbers.py +25 -0
  41. pysvgwriter-1.0.0/svgwriter/_internal/_numbers.pyi +3 -0
  42. pysvgwriter-1.0.0/svgwriter/_internal/_registry.py +72 -0
  43. pysvgwriter-1.0.0/svgwriter/_internal/_registry.pyi +23 -0
  44. pysvgwriter-1.0.0/svgwriter/_internal/_sentinels.py +25 -0
  45. pysvgwriter-1.0.0/svgwriter/_internal/_sentinels.pyi +12 -0
  46. pysvgwriter-1.0.0/svgwriter/_internal/_stack.py +40 -0
  47. pysvgwriter-1.0.0/svgwriter/_internal/_stack.pyi +15 -0
  48. pysvgwriter-1.0.0/svgwriter/_internal/_typing.py +97 -0
  49. pysvgwriter-1.0.0/svgwriter/_internal/_typing.pyi +56 -0
  50. pysvgwriter-1.0.0/svgwriter/aliases.py +259 -0
  51. pysvgwriter-1.0.0/svgwriter/aliases.pyi +236 -0
  52. pysvgwriter-1.0.0/svgwriter/attributes/__init__.py +52 -0
  53. pysvgwriter-1.0.0/svgwriter/attributes/__init__.pyi +78 -0
  54. pysvgwriter-1.0.0/svgwriter/attributes/_constants.py +70 -0
  55. pysvgwriter-1.0.0/svgwriter/attributes/_constants.pyi +29 -0
  56. pysvgwriter-1.0.0/svgwriter/attributes/_selectors.py +60 -0
  57. pysvgwriter-1.0.0/svgwriter/attributes/_selectors.pyi +7 -0
  58. pysvgwriter-1.0.0/svgwriter/attributes/angle.py +181 -0
  59. pysvgwriter-1.0.0/svgwriter/attributes/angle.pyi +47 -0
  60. pysvgwriter-1.0.0/svgwriter/attributes/cascade.py +370 -0
  61. pysvgwriter-1.0.0/svgwriter/attributes/cascade.pyi +35 -0
  62. pysvgwriter-1.0.0/svgwriter/attributes/descriptors.py +132 -0
  63. pysvgwriter-1.0.0/svgwriter/attributes/descriptors.pyi +35 -0
  64. pysvgwriter-1.0.0/svgwriter/attributes/length.py +391 -0
  65. pysvgwriter-1.0.0/svgwriter/attributes/length.pyi +98 -0
  66. pysvgwriter-1.0.0/svgwriter/attributes/names.py +160 -0
  67. pysvgwriter-1.0.0/svgwriter/attributes/names.pyi +21 -0
  68. pysvgwriter-1.0.0/svgwriter/attributes/protocols.py +72 -0
  69. pysvgwriter-1.0.0/svgwriter/attributes/protocols.pyi +11 -0
  70. pysvgwriter-1.0.0/svgwriter/attributes/reference.py +188 -0
  71. pysvgwriter-1.0.0/svgwriter/attributes/reference.pyi +26 -0
  72. pysvgwriter-1.0.0/svgwriter/attributes/style.py +224 -0
  73. pysvgwriter-1.0.0/svgwriter/attributes/style.pyi +39 -0
  74. pysvgwriter-1.0.0/svgwriter/attributes/values.py +113 -0
  75. pysvgwriter-1.0.0/svgwriter/attributes/values.pyi +6 -0
  76. pysvgwriter-1.0.0/svgwriter/attributes/viewbox.py +248 -0
  77. pysvgwriter-1.0.0/svgwriter/attributes/viewbox.pyi +51 -0
  78. pysvgwriter-1.0.0/svgwriter/builder/__init__.py +26 -0
  79. pysvgwriter-1.0.0/svgwriter/builder/__init__.pyi +29 -0
  80. pysvgwriter-1.0.0/svgwriter/builder/_constants.py +66 -0
  81. pysvgwriter-1.0.0/svgwriter/builder/_constants.pyi +57 -0
  82. pysvgwriter-1.0.0/svgwriter/builder/_effects.py +208 -0
  83. pysvgwriter-1.0.0/svgwriter/builder/_effects.pyi +160 -0
  84. pysvgwriter-1.0.0/svgwriter/builder/_functions.py +19 -0
  85. pysvgwriter-1.0.0/svgwriter/builder/_functions.pyi +149 -0
  86. pysvgwriter-1.0.0/svgwriter/builder/_motion.py +245 -0
  87. pysvgwriter-1.0.0/svgwriter/builder/_motion.pyi +171 -0
  88. pysvgwriter-1.0.0/svgwriter/builder/_shapes.py +218 -0
  89. pysvgwriter-1.0.0/svgwriter/builder/_shapes.pyi +157 -0
  90. pysvgwriter-1.0.0/svgwriter/cli/__init__.py +83 -0
  91. pysvgwriter-1.0.0/svgwriter/cli/__init__.pyi +9 -0
  92. pysvgwriter-1.0.0/svgwriter/cli/_basic.py +139 -0
  93. pysvgwriter-1.0.0/svgwriter/cli/_basic.pyi +11 -0
  94. pysvgwriter-1.0.0/svgwriter/cli/_constants.py +30 -0
  95. pysvgwriter-1.0.0/svgwriter/cli/_constants.pyi +23 -0
  96. pysvgwriter-1.0.0/svgwriter/cli/_media.py +175 -0
  97. pysvgwriter-1.0.0/svgwriter/cli/_media.pyi +14 -0
  98. pysvgwriter-1.0.0/svgwriter/color/__init__.py +21 -0
  99. pysvgwriter-1.0.0/svgwriter/color/__init__.pyi +29 -0
  100. pysvgwriter-1.0.0/svgwriter/color/_blending.py +186 -0
  101. pysvgwriter-1.0.0/svgwriter/color/_blending.pyi +16 -0
  102. pysvgwriter-1.0.0/svgwriter/color/_channels.py +129 -0
  103. pysvgwriter-1.0.0/svgwriter/color/_channels.pyi +24 -0
  104. pysvgwriter-1.0.0/svgwriter/color/_constants.py +76 -0
  105. pysvgwriter-1.0.0/svgwriter/color/_constants.pyi +31 -0
  106. pysvgwriter-1.0.0/svgwriter/color/_named.py +25 -0
  107. pysvgwriter-1.0.0/svgwriter/color/_named.pyi +6 -0
  108. pysvgwriter-1.0.0/svgwriter/color/_parsing.py +49 -0
  109. pysvgwriter-1.0.0/svgwriter/color/_parsing.pyi +9 -0
  110. pysvgwriter-1.0.0/svgwriter/color/color.py +393 -0
  111. pysvgwriter-1.0.0/svgwriter/color/color.pyi +64 -0
  112. pysvgwriter-1.0.0/svgwriter/color/paint.py +153 -0
  113. pysvgwriter-1.0.0/svgwriter/color/paint.pyi +30 -0
  114. pysvgwriter-1.0.0/svgwriter/document.py +384 -0
  115. pysvgwriter-1.0.0/svgwriter/document.pyi +164 -0
  116. pysvgwriter-1.0.0/svgwriter/elements/__init__.py +186 -0
  117. pysvgwriter-1.0.0/svgwriter/elements/__init__.pyi +267 -0
  118. pysvgwriter-1.0.0/svgwriter/elements/_behavior/__init__.py +36 -0
  119. pysvgwriter-1.0.0/svgwriter/elements/_behavior/__init__.pyi +30 -0
  120. pysvgwriter-1.0.0/svgwriter/elements/_behavior/_boolean.py +183 -0
  121. pysvgwriter-1.0.0/svgwriter/elements/_behavior/_boolean.pyi +23 -0
  122. pysvgwriter-1.0.0/svgwriter/elements/_behavior/_constants.py +12 -0
  123. pysvgwriter-1.0.0/svgwriter/elements/_behavior/_constants.pyi +6 -0
  124. pysvgwriter-1.0.0/svgwriter/elements/_behavior/_convert.py +375 -0
  125. pysvgwriter-1.0.0/svgwriter/elements/_behavior/_convert.pyi +48 -0
  126. pysvgwriter-1.0.0/svgwriter/elements/_behavior/_geometry.py +358 -0
  127. pysvgwriter-1.0.0/svgwriter/elements/_behavior/_geometry.pyi +21 -0
  128. pysvgwriter-1.0.0/svgwriter/elements/_behavior/_measure.py +194 -0
  129. pysvgwriter-1.0.0/svgwriter/elements/_behavior/_measure.pyi +22 -0
  130. pysvgwriter-1.0.0/svgwriter/elements/_behavior/_mixins.py +393 -0
  131. pysvgwriter-1.0.0/svgwriter/elements/_behavior/_mixins.pyi +136 -0
  132. pysvgwriter-1.0.0/svgwriter/elements/_behavior/_moves.py +329 -0
  133. pysvgwriter-1.0.0/svgwriter/elements/_behavior/_moves.pyi +71 -0
  134. pysvgwriter-1.0.0/svgwriter/elements/_behavior/_placement.py +191 -0
  135. pysvgwriter-1.0.0/svgwriter/elements/_behavior/_placement.pyi +32 -0
  136. pysvgwriter-1.0.0/svgwriter/elements/_behavior/_styling.py +139 -0
  137. pysvgwriter-1.0.0/svgwriter/elements/_behavior/_styling.pyi +20 -0
  138. pysvgwriter-1.0.0/svgwriter/elements/_behavior/_transformable.py +198 -0
  139. pysvgwriter-1.0.0/svgwriter/elements/_behavior/_transformable.pyi +41 -0
  140. pysvgwriter-1.0.0/svgwriter/elements/_behavior/_viewport.py +162 -0
  141. pysvgwriter-1.0.0/svgwriter/elements/_behavior/_viewport.pyi +47 -0
  142. pysvgwriter-1.0.0/svgwriter/elements/animation/__init__.py +37 -0
  143. pysvgwriter-1.0.0/svgwriter/elements/animation/__init__.pyi +31 -0
  144. pysvgwriter-1.0.0/svgwriter/elements/animation/_elements.py +402 -0
  145. pysvgwriter-1.0.0/svgwriter/elements/animation/_elements.pyi +241 -0
  146. pysvgwriter-1.0.0/svgwriter/elements/animation/_smil.py +137 -0
  147. pysvgwriter-1.0.0/svgwriter/elements/animation/_smil.pyi +54 -0
  148. pysvgwriter-1.0.0/svgwriter/elements/core/__init__.py +22 -0
  149. pysvgwriter-1.0.0/svgwriter/elements/core/__init__.pyi +22 -0
  150. pysvgwriter-1.0.0/svgwriter/elements/core/_access.py +324 -0
  151. pysvgwriter-1.0.0/svgwriter/elements/core/_access.pyi +33 -0
  152. pysvgwriter-1.0.0/svgwriter/elements/core/_categories.py +51 -0
  153. pysvgwriter-1.0.0/svgwriter/elements/core/_categories.pyi +25 -0
  154. pysvgwriter-1.0.0/svgwriter/elements/core/_compose.py +78 -0
  155. pysvgwriter-1.0.0/svgwriter/elements/core/_compose.pyi +10 -0
  156. pysvgwriter-1.0.0/svgwriter/elements/core/_constants.py +42 -0
  157. pysvgwriter-1.0.0/svgwriter/elements/core/_constants.pyi +29 -0
  158. pysvgwriter-1.0.0/svgwriter/elements/core/_construct.py +160 -0
  159. pysvgwriter-1.0.0/svgwriter/elements/core/_construct.pyi +16 -0
  160. pysvgwriter-1.0.0/svgwriter/elements/core/_container.py +289 -0
  161. pysvgwriter-1.0.0/svgwriter/elements/core/_container.pyi +34 -0
  162. pysvgwriter-1.0.0/svgwriter/elements/core/_display.py +126 -0
  163. pysvgwriter-1.0.0/svgwriter/elements/core/_display.pyi +34 -0
  164. pysvgwriter-1.0.0/svgwriter/elements/core/_element.py +268 -0
  165. pysvgwriter-1.0.0/svgwriter/elements/core/_element.pyi +57 -0
  166. pysvgwriter-1.0.0/svgwriter/elements/core/_errors.py +78 -0
  167. pysvgwriter-1.0.0/svgwriter/elements/core/_errors.pyi +15 -0
  168. pysvgwriter-1.0.0/svgwriter/elements/core/_factory.py +145 -0
  169. pysvgwriter-1.0.0/svgwriter/elements/core/_factory.pyi +4 -0
  170. pysvgwriter-1.0.0/svgwriter/elements/core/_query.py +188 -0
  171. pysvgwriter-1.0.0/svgwriter/elements/core/_query.pyi +26 -0
  172. pysvgwriter-1.0.0/svgwriter/elements/core/_tree.py +203 -0
  173. pysvgwriter-1.0.0/svgwriter/elements/core/_tree.pyi +15 -0
  174. pysvgwriter-1.0.0/svgwriter/elements/core/_unknown.py +41 -0
  175. pysvgwriter-1.0.0/svgwriter/elements/core/_unknown.pyi +20 -0
  176. pysvgwriter-1.0.0/svgwriter/elements/filters/__init__.py +83 -0
  177. pysvgwriter-1.0.0/svgwriter/elements/filters/__init__.pyi +95 -0
  178. pysvgwriter-1.0.0/svgwriter/elements/filters/_colormatrix.py +121 -0
  179. pysvgwriter-1.0.0/svgwriter/elements/filters/_colormatrix.pyi +14 -0
  180. pysvgwriter-1.0.0/svgwriter/elements/filters/_compositing.py +269 -0
  181. pysvgwriter-1.0.0/svgwriter/elements/filters/_compositing.pyi +331 -0
  182. pysvgwriter-1.0.0/svgwriter/elements/filters/_constants.py +14 -0
  183. pysvgwriter-1.0.0/svgwriter/elements/filters/_constants.pyi +8 -0
  184. pysvgwriter-1.0.0/svgwriter/elements/filters/_effects.py +343 -0
  185. pysvgwriter-1.0.0/svgwriter/elements/filters/_effects.pyi +328 -0
  186. pysvgwriter-1.0.0/svgwriter/elements/filters/base.py +336 -0
  187. pysvgwriter-1.0.0/svgwriter/elements/filters/base.pyi +223 -0
  188. pysvgwriter-1.0.0/svgwriter/elements/filters/lighting.py +359 -0
  189. pysvgwriter-1.0.0/svgwriter/elements/filters/lighting.pyi +240 -0
  190. pysvgwriter-1.0.0/svgwriter/elements/filters/transfer.py +300 -0
  191. pysvgwriter-1.0.0/svgwriter/elements/filters/transfer.pyi +156 -0
  192. pysvgwriter-1.0.0/svgwriter/elements/paint/__init__.py +19 -0
  193. pysvgwriter-1.0.0/svgwriter/elements/paint/__init__.pyi +19 -0
  194. pysvgwriter-1.0.0/svgwriter/elements/paint/_clip.py +203 -0
  195. pysvgwriter-1.0.0/svgwriter/elements/paint/_clip.pyi +163 -0
  196. pysvgwriter-1.0.0/svgwriter/elements/paint/_servers.py +348 -0
  197. pysvgwriter-1.0.0/svgwriter/elements/paint/_servers.pyi +289 -0
  198. pysvgwriter-1.0.0/svgwriter/elements/paint/_stops.py +116 -0
  199. pysvgwriter-1.0.0/svgwriter/elements/paint/_stops.pyi +53 -0
  200. pysvgwriter-1.0.0/svgwriter/elements/paint/_tiling.py +172 -0
  201. pysvgwriter-1.0.0/svgwriter/elements/paint/_tiling.pyi +23 -0
  202. pysvgwriter-1.0.0/svgwriter/elements/shapes/__init__.py +18 -0
  203. pysvgwriter-1.0.0/svgwriter/elements/shapes/__init__.pyi +6 -0
  204. pysvgwriter-1.0.0/svgwriter/elements/shapes/_base.py +87 -0
  205. pysvgwriter-1.0.0/svgwriter/elements/shapes/_base.pyi +16 -0
  206. pysvgwriter-1.0.0/svgwriter/elements/shapes/_basic.py +361 -0
  207. pysvgwriter-1.0.0/svgwriter/elements/shapes/_basic.pyi +332 -0
  208. pysvgwriter-1.0.0/svgwriter/elements/shapes/_commands.py +327 -0
  209. pysvgwriter-1.0.0/svgwriter/elements/shapes/_commands.pyi +84 -0
  210. pysvgwriter-1.0.0/svgwriter/elements/shapes/_constants.py +16 -0
  211. pysvgwriter-1.0.0/svgwriter/elements/shapes/_constants.pyi +7 -0
  212. pysvgwriter-1.0.0/svgwriter/elements/shapes/_path.py +209 -0
  213. pysvgwriter-1.0.0/svgwriter/elements/shapes/_path.pyi +132 -0
  214. pysvgwriter-1.0.0/svgwriter/elements/shapes/_poly.py +273 -0
  215. pysvgwriter-1.0.0/svgwriter/elements/shapes/_poly.pyi +133 -0
  216. pysvgwriter-1.0.0/svgwriter/elements/shapes/_rectbuild.py +131 -0
  217. pysvgwriter-1.0.0/svgwriter/elements/shapes/_rectbuild.pyi +31 -0
  218. pysvgwriter-1.0.0/svgwriter/elements/structure/__init__.py +27 -0
  219. pysvgwriter-1.0.0/svgwriter/elements/structure/__init__.pyi +31 -0
  220. pysvgwriter-1.0.0/svgwriter/elements/structure/_constants.py +14 -0
  221. pysvgwriter-1.0.0/svgwriter/elements/structure/_constants.pyi +8 -0
  222. pysvgwriter-1.0.0/svgwriter/elements/structure/_containers.py +396 -0
  223. pysvgwriter-1.0.0/svgwriter/elements/structure/_containers.pyi +247 -0
  224. pysvgwriter-1.0.0/svgwriter/elements/structure/_descriptive.py +82 -0
  225. pysvgwriter-1.0.0/svgwriter/elements/structure/_descriptive.pyi +40 -0
  226. pysvgwriter-1.0.0/svgwriter/elements/structure/_external.py +135 -0
  227. pysvgwriter-1.0.0/svgwriter/elements/structure/_external.pyi +72 -0
  228. pysvgwriter-1.0.0/svgwriter/elements/structure/_image.py +287 -0
  229. pysvgwriter-1.0.0/svgwriter/elements/structure/_image.pyi +150 -0
  230. pysvgwriter-1.0.0/svgwriter/elements/structure/_pixels.py +488 -0
  231. pysvgwriter-1.0.0/svgwriter/elements/structure/_pixels.pyi +51 -0
  232. pysvgwriter-1.0.0/svgwriter/elements/structure/_use.py +186 -0
  233. pysvgwriter-1.0.0/svgwriter/elements/structure/_use.pyi +15 -0
  234. pysvgwriter-1.0.0/svgwriter/elements/text/__init__.py +44 -0
  235. pysvgwriter-1.0.0/svgwriter/elements/text/__init__.pyi +48 -0
  236. pysvgwriter-1.0.0/svgwriter/elements/text/_character.py +399 -0
  237. pysvgwriter-1.0.0/svgwriter/elements/text/_character.pyi +88 -0
  238. pysvgwriter-1.0.0/svgwriter/elements/text/_clusters.py +42 -0
  239. pysvgwriter-1.0.0/svgwriter/elements/text/_clusters.pyi +3 -0
  240. pysvgwriter-1.0.0/svgwriter/elements/text/_constants.py +39 -0
  241. pysvgwriter-1.0.0/svgwriter/elements/text/_constants.pyi +27 -0
  242. pysvgwriter-1.0.0/svgwriter/elements/text/_fontbase.py +135 -0
  243. pysvgwriter-1.0.0/svgwriter/elements/text/_fontbase.pyi +135 -0
  244. pysvgwriter-1.0.0/svgwriter/elements/text/_fonts.py +371 -0
  245. pysvgwriter-1.0.0/svgwriter/elements/text/_fonts.pyi +200 -0
  246. pysvgwriter-1.0.0/svgwriter/elements/text/_text.py +360 -0
  247. pysvgwriter-1.0.0/svgwriter/elements/text/_text.pyi +254 -0
  248. pysvgwriter-1.0.0/svgwriter/elements/text/_textaccess.py +284 -0
  249. pysvgwriter-1.0.0/svgwriter/elements/text/_textaccess.pyi +63 -0
  250. pysvgwriter-1.0.0/svgwriter/elements/text/_textbase.py +87 -0
  251. pysvgwriter-1.0.0/svgwriter/elements/text/_textbase.pyi +39 -0
  252. pysvgwriter-1.0.0/svgwriter/elements/text/_textlayout.py +388 -0
  253. pysvgwriter-1.0.0/svgwriter/elements/text/_textlayout.pyi +29 -0
  254. pysvgwriter-1.0.0/svgwriter/export/__init__.py +49 -0
  255. pysvgwriter-1.0.0/svgwriter/export/__init__.pyi +27 -0
  256. pysvgwriter-1.0.0/svgwriter/export/_constants.py +68 -0
  257. pysvgwriter-1.0.0/svgwriter/export/_constants.pyi +53 -0
  258. pysvgwriter-1.0.0/svgwriter/export/_diagram/__init__.py +363 -0
  259. pysvgwriter-1.0.0/svgwriter/export/_diagram/__init__.pyi +31 -0
  260. pysvgwriter-1.0.0/svgwriter/export/_diagram/_constants.py +71 -0
  261. pysvgwriter-1.0.0/svgwriter/export/_diagram/_constants.pyi +79 -0
  262. pysvgwriter-1.0.0/svgwriter/export/_diagram/_mermaid.py +374 -0
  263. pysvgwriter-1.0.0/svgwriter/export/_diagram/_mermaid.pyi +63 -0
  264. pysvgwriter-1.0.0/svgwriter/export/_exchange.py +152 -0
  265. pysvgwriter-1.0.0/svgwriter/export/_exchange.pyi +29 -0
  266. pysvgwriter-1.0.0/svgwriter/export/_flatten.py +284 -0
  267. pysvgwriter-1.0.0/svgwriter/export/_flatten.pyi +65 -0
  268. pysvgwriter-1.0.0/svgwriter/export/_html.py +112 -0
  269. pysvgwriter-1.0.0/svgwriter/export/_html.pyi +15 -0
  270. pysvgwriter-1.0.0/svgwriter/export/_office/__init__.py +234 -0
  271. pysvgwriter-1.0.0/svgwriter/export/_office/__init__.pyi +4 -0
  272. pysvgwriter-1.0.0/svgwriter/export/_office/_constants.py +38 -0
  273. pysvgwriter-1.0.0/svgwriter/export/_office/_constants.pyi +49 -0
  274. pysvgwriter-1.0.0/svgwriter/export/_office/_docx.py +88 -0
  275. pysvgwriter-1.0.0/svgwriter/export/_office/_docx.pyi +3 -0
  276. pysvgwriter-1.0.0/svgwriter/export/_office/_pptx.py +358 -0
  277. pysvgwriter-1.0.0/svgwriter/export/_office/_pptx.pyi +5 -0
  278. pysvgwriter-1.0.0/svgwriter/export/_paints.py +103 -0
  279. pysvgwriter-1.0.0/svgwriter/export/_paints.pyi +20 -0
  280. pysvgwriter-1.0.0/svgwriter/export/_patterns.py +119 -0
  281. pysvgwriter-1.0.0/svgwriter/export/_patterns.pyi +7 -0
  282. pysvgwriter-1.0.0/svgwriter/export/_plotter/__init__.py +213 -0
  283. pysvgwriter-1.0.0/svgwriter/export/_plotter/__init__.pyi +47 -0
  284. pysvgwriter-1.0.0/svgwriter/export/_plotter/_cnc.py +248 -0
  285. pysvgwriter-1.0.0/svgwriter/export/_plotter/_cnc.pyi +34 -0
  286. pysvgwriter-1.0.0/svgwriter/export/_plotter/_cnc_read.py +380 -0
  287. pysvgwriter-1.0.0/svgwriter/export/_plotter/_cnc_read.pyi +21 -0
  288. pysvgwriter-1.0.0/svgwriter/export/_plotter/_constants.py +31 -0
  289. pysvgwriter-1.0.0/svgwriter/export/_plotter/_constants.pyi +37 -0
  290. pysvgwriter-1.0.0/svgwriter/export/_raster/__init__.py +318 -0
  291. pysvgwriter-1.0.0/svgwriter/export/_raster/__init__.pyi +42 -0
  292. pysvgwriter-1.0.0/svgwriter/export/_raster/_animated.py +175 -0
  293. pysvgwriter-1.0.0/svgwriter/export/_raster/_animated.pyi +18 -0
  294. pysvgwriter-1.0.0/svgwriter/export/_raster/_constants.py +92 -0
  295. pysvgwriter-1.0.0/svgwriter/export/_raster/_constants.pyi +133 -0
  296. pysvgwriter-1.0.0/svgwriter/export/_raster/_encoders.py +82 -0
  297. pysvgwriter-1.0.0/svgwriter/export/_raster/_encoders.pyi +10 -0
  298. pysvgwriter-1.0.0/svgwriter/export/_raster/_gif.py +256 -0
  299. pysvgwriter-1.0.0/svgwriter/export/_raster/_gif.pyi +13 -0
  300. pysvgwriter-1.0.0/svgwriter/export/_raster/_icons.py +178 -0
  301. pysvgwriter-1.0.0/svgwriter/export/_raster/_icons.pyi +21 -0
  302. pysvgwriter-1.0.0/svgwriter/export/_raster/_pixels.py +53 -0
  303. pysvgwriter-1.0.0/svgwriter/export/_raster/_pixels.pyi +5 -0
  304. pysvgwriter-1.0.0/svgwriter/export/_raster/_pnm.py +193 -0
  305. pysvgwriter-1.0.0/svgwriter/export/_raster/_pnm.pyi +15 -0
  306. pysvgwriter-1.0.0/svgwriter/export/_registry.py +369 -0
  307. pysvgwriter-1.0.0/svgwriter/export/_registry.pyi +82 -0
  308. pysvgwriter-1.0.0/svgwriter/export/_scene/__init__.py +73 -0
  309. pysvgwriter-1.0.0/svgwriter/export/_scene/__init__.pyi +10 -0
  310. pysvgwriter-1.0.0/svgwriter/export/_scene/_constants.py +28 -0
  311. pysvgwriter-1.0.0/svgwriter/export/_scene/_constants.pyi +29 -0
  312. pysvgwriter-1.0.0/svgwriter/export/_scene/_excalidraw.py +236 -0
  313. pysvgwriter-1.0.0/svgwriter/export/_scene/_excalidraw.pyi +11 -0
  314. pysvgwriter-1.0.0/svgwriter/export/_svg.py +106 -0
  315. pysvgwriter-1.0.0/svgwriter/export/_svg.pyi +13 -0
  316. pysvgwriter-1.0.0/svgwriter/export/_text.py +153 -0
  317. pysvgwriter-1.0.0/svgwriter/export/_text.pyi +7 -0
  318. pysvgwriter-1.0.0/svgwriter/export/_text_runs.py +132 -0
  319. pysvgwriter-1.0.0/svgwriter/export/_text_runs.pyi +33 -0
  320. pysvgwriter-1.0.0/svgwriter/export/_vector/__init__.py +270 -0
  321. pysvgwriter-1.0.0/svgwriter/export/_vector/__init__.pyi +33 -0
  322. pysvgwriter-1.0.0/svgwriter/export/_vector/_constants.py +204 -0
  323. pysvgwriter-1.0.0/svgwriter/export/_vector/_constants.pyi +245 -0
  324. pysvgwriter-1.0.0/svgwriter/export/_vector/_eps.py +194 -0
  325. pysvgwriter-1.0.0/svgwriter/export/_vector/_eps.pyi +9 -0
  326. pysvgwriter-1.0.0/svgwriter/export/_vector/_eps_images.py +104 -0
  327. pysvgwriter-1.0.0/svgwriter/export/_vector/_eps_images.pyi +0 -0
  328. pysvgwriter-1.0.0/svgwriter/export/_vector/_eps_machine.py +263 -0
  329. pysvgwriter-1.0.0/svgwriter/export/_vector/_eps_machine.pyi +60 -0
  330. pysvgwriter-1.0.0/svgwriter/export/_vector/_eps_paths.py +74 -0
  331. pysvgwriter-1.0.0/svgwriter/export/_vector/_eps_paths.pyi +0 -0
  332. pysvgwriter-1.0.0/svgwriter/export/_vector/_eps_read.py +83 -0
  333. pysvgwriter-1.0.0/svgwriter/export/_vector/_eps_read.pyi +5 -0
  334. pysvgwriter-1.0.0/svgwriter/export/_vector/_eps_syntax.py +144 -0
  335. pysvgwriter-1.0.0/svgwriter/export/_vector/_eps_syntax.pyi +32 -0
  336. pysvgwriter-1.0.0/svgwriter/export/_vector/_eps_text.py +144 -0
  337. pysvgwriter-1.0.0/svgwriter/export/_vector/_eps_text.pyi +0 -0
  338. pysvgwriter-1.0.0/svgwriter/export/_vector/_pdf_content.py +307 -0
  339. pysvgwriter-1.0.0/svgwriter/export/_vector/_pdf_content.pyi +8 -0
  340. pysvgwriter-1.0.0/svgwriter/export/_vector/_pdf_objects.py +273 -0
  341. pysvgwriter-1.0.0/svgwriter/export/_vector/_pdf_objects.pyi +23 -0
  342. pysvgwriter-1.0.0/svgwriter/export/_vector/_pdf_paint.py +150 -0
  343. pysvgwriter-1.0.0/svgwriter/export/_vector/_pdf_paint.pyi +20 -0
  344. pysvgwriter-1.0.0/svgwriter/export/_vector/_pdf_painter.py +260 -0
  345. pysvgwriter-1.0.0/svgwriter/export/_vector/_pdf_painter.pyi +68 -0
  346. pysvgwriter-1.0.0/svgwriter/export/_vector/_pdf_read.py +92 -0
  347. pysvgwriter-1.0.0/svgwriter/export/_vector/_pdf_read.pyi +9 -0
  348. pysvgwriter-1.0.0/svgwriter/export/_vector/_reading.py +311 -0
  349. pysvgwriter-1.0.0/svgwriter/export/_vector/_reading.pyi +95 -0
  350. pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz.py +179 -0
  351. pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz.pyi +10 -0
  352. pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz_nodes.py +75 -0
  353. pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz_nodes.pyi +34 -0
  354. pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz_paths.py +257 -0
  355. pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz_paths.pyi +40 -0
  356. pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz_read.py +121 -0
  357. pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz_read.pyi +5 -0
  358. pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz_scopes.py +231 -0
  359. pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz_scopes.pyi +32 -0
  360. pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz_styles.py +166 -0
  361. pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz_styles.pyi +49 -0
  362. pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz_syntax.py +131 -0
  363. pysvgwriter-1.0.0/svgwriter/export/_vector/_tikz_syntax.pyi +6 -0
  364. pysvgwriter-1.0.0/svgwriter/io/__init__.py +49 -0
  365. pysvgwriter-1.0.0/svgwriter/io/__init__.pyi +33 -0
  366. pysvgwriter-1.0.0/svgwriter/io/_async.py +114 -0
  367. pysvgwriter-1.0.0/svgwriter/io/_async.pyi +29 -0
  368. pysvgwriter-1.0.0/svgwriter/io/_constants.py +25 -0
  369. pysvgwriter-1.0.0/svgwriter/io/_constants.pyi +9 -0
  370. pysvgwriter-1.0.0/svgwriter/io/_markup.py +46 -0
  371. pysvgwriter-1.0.0/svgwriter/io/_markup.pyi +18 -0
  372. pysvgwriter-1.0.0/svgwriter/io/parser.py +224 -0
  373. pysvgwriter-1.0.0/svgwriter/io/parser.pyi +25 -0
  374. pysvgwriter-1.0.0/svgwriter/io/writer.py +383 -0
  375. pysvgwriter-1.0.0/svgwriter/io/writer.pyi +114 -0
  376. pysvgwriter-1.0.0/svgwriter/ops/__init__.py +75 -0
  377. pysvgwriter-1.0.0/svgwriter/ops/__init__.pyi +83 -0
  378. pysvgwriter-1.0.0/svgwriter/ops/_canvas.py +52 -0
  379. pysvgwriter-1.0.0/svgwriter/ops/_canvas.pyi +22 -0
  380. pysvgwriter-1.0.0/svgwriter/ops/_constants.py +168 -0
  381. pysvgwriter-1.0.0/svgwriter/ops/_constants.pyi +135 -0
  382. pysvgwriter-1.0.0/svgwriter/ops/_fonts.py +146 -0
  383. pysvgwriter-1.0.0/svgwriter/ops/_fonts.pyi +30 -0
  384. pysvgwriter-1.0.0/svgwriter/ops/_image_effects.py +148 -0
  385. pysvgwriter-1.0.0/svgwriter/ops/_image_effects.pyi +14 -0
  386. pysvgwriter-1.0.0/svgwriter/ops/_layers.py +378 -0
  387. pysvgwriter-1.0.0/svgwriter/ops/_layers.pyi +21 -0
  388. pysvgwriter-1.0.0/svgwriter/ops/_native_text.py +220 -0
  389. pysvgwriter-1.0.0/svgwriter/ops/_native_text.pyi +15 -0
  390. pysvgwriter-1.0.0/svgwriter/ops/_renderable.py +107 -0
  391. pysvgwriter-1.0.0/svgwriter/ops/_renderable.pyi +17 -0
  392. pysvgwriter-1.0.0/svgwriter/ops/_shaping.py +121 -0
  393. pysvgwriter-1.0.0/svgwriter/ops/_shaping.pyi +20 -0
  394. pysvgwriter-1.0.0/svgwriter/ops/_skia.py +168 -0
  395. pysvgwriter-1.0.0/svgwriter/ops/_skia.pyi +17 -0
  396. pysvgwriter-1.0.0/svgwriter/ops/boolean.py +241 -0
  397. pysvgwriter-1.0.0/svgwriter/ops/boolean.pyi +28 -0
  398. pysvgwriter-1.0.0/svgwriter/ops/composite.py +165 -0
  399. pysvgwriter-1.0.0/svgwriter/ops/composite.pyi +18 -0
  400. pysvgwriter-1.0.0/svgwriter/ops/graph.py +158 -0
  401. pysvgwriter-1.0.0/svgwriter/ops/graph.pyi +20 -0
  402. pysvgwriter-1.0.0/svgwriter/ops/interpolate.py +292 -0
  403. pysvgwriter-1.0.0/svgwriter/ops/interpolate.pyi +11 -0
  404. pysvgwriter-1.0.0/svgwriter/ops/measure.py +262 -0
  405. pysvgwriter-1.0.0/svgwriter/ops/measure.pyi +41 -0
  406. pysvgwriter-1.0.0/svgwriter/ops/parallel.py +81 -0
  407. pysvgwriter-1.0.0/svgwriter/ops/parallel.pyi +15 -0
  408. pysvgwriter-1.0.0/svgwriter/ops/plot.py +121 -0
  409. pysvgwriter-1.0.0/svgwriter/ops/plot.pyi +12 -0
  410. pysvgwriter-1.0.0/svgwriter/ops/render.py +518 -0
  411. pysvgwriter-1.0.0/svgwriter/ops/render.pyi +96 -0
  412. pysvgwriter-1.0.0/svgwriter/ops/text.py +423 -0
  413. pysvgwriter-1.0.0/svgwriter/ops/text.pyi +145 -0
  414. pysvgwriter-1.0.0/svgwriter/pathdata/__init__.py +44 -0
  415. pysvgwriter-1.0.0/svgwriter/pathdata/__init__.pyi +44 -0
  416. pysvgwriter-1.0.0/svgwriter/pathdata/_affine.py +103 -0
  417. pysvgwriter-1.0.0/svgwriter/pathdata/_affine.pyi +9 -0
  418. pysvgwriter-1.0.0/svgwriter/pathdata/_builder_curves.py +195 -0
  419. pysvgwriter-1.0.0/svgwriter/pathdata/_builder_curves.pyi +51 -0
  420. pysvgwriter-1.0.0/svgwriter/pathdata/_builder_shapes.py +137 -0
  421. pysvgwriter-1.0.0/svgwriter/pathdata/_builder_shapes.pyi +21 -0
  422. pysvgwriter-1.0.0/svgwriter/pathdata/_command_forms.py +113 -0
  423. pysvgwriter-1.0.0/svgwriter/pathdata/_command_forms.pyi +26 -0
  424. pysvgwriter-1.0.0/svgwriter/pathdata/_constants.py +45 -0
  425. pysvgwriter-1.0.0/svgwriter/pathdata/_constants.pyi +27 -0
  426. pysvgwriter-1.0.0/svgwriter/pathdata/_geometry.py +336 -0
  427. pysvgwriter-1.0.0/svgwriter/pathdata/_geometry.pyi +18 -0
  428. pysvgwriter-1.0.0/svgwriter/pathdata/arc.py +194 -0
  429. pysvgwriter-1.0.0/svgwriter/pathdata/arc.pyi +37 -0
  430. pysvgwriter-1.0.0/svgwriter/pathdata/builder.py +264 -0
  431. pysvgwriter-1.0.0/svgwriter/pathdata/builder.pyi +94 -0
  432. pysvgwriter-1.0.0/svgwriter/pathdata/commands.py +444 -0
  433. pysvgwriter-1.0.0/svgwriter/pathdata/commands.pyi +214 -0
  434. pysvgwriter-1.0.0/svgwriter/pathdata/data.py +357 -0
  435. pysvgwriter-1.0.0/svgwriter/pathdata/data.pyi +75 -0
  436. pysvgwriter-1.0.0/svgwriter/pathdata/parser.py +208 -0
  437. pysvgwriter-1.0.0/svgwriter/pathdata/parser.pyi +13 -0
  438. pysvgwriter-1.0.0/svgwriter/py.typed +0 -0
  439. pysvgwriter-1.0.0/svgwriter/transform/__init__.py +24 -0
  440. pysvgwriter-1.0.0/svgwriter/transform/__init__.pyi +33 -0
  441. pysvgwriter-1.0.0/svgwriter/transform/_constants.py +28 -0
  442. pysvgwriter-1.0.0/svgwriter/transform/_constants.pyi +8 -0
  443. pysvgwriter-1.0.0/svgwriter/transform/_matrix_constructors.py +201 -0
  444. pysvgwriter-1.0.0/svgwriter/transform/_matrix_constructors.pyi +24 -0
  445. pysvgwriter-1.0.0/svgwriter/transform/_matrix_text.py +94 -0
  446. pysvgwriter-1.0.0/svgwriter/transform/_matrix_text.pyi +12 -0
  447. pysvgwriter-1.0.0/svgwriter/transform/_transform_builders.py +157 -0
  448. pysvgwriter-1.0.0/svgwriter/transform/_transform_builders.pyi +4 -0
  449. pysvgwriter-1.0.0/svgwriter/transform/matrix.py +378 -0
  450. pysvgwriter-1.0.0/svgwriter/transform/matrix.pyi +64 -0
  451. pysvgwriter-1.0.0/svgwriter/transform/ops.py +304 -0
  452. pysvgwriter-1.0.0/svgwriter/transform/ops.pyi +86 -0
  453. pysvgwriter-1.0.0/svgwriter/transform/transform.py +327 -0
  454. pysvgwriter-1.0.0/svgwriter/transform/transform.pyi +40 -0
  455. pysvgwriter-1.0.0/svgwriter/video/__init__.py +55 -0
  456. pysvgwriter-1.0.0/svgwriter/video/__init__.pyi +45 -0
  457. pysvgwriter-1.0.0/svgwriter/video/_constants.py +67 -0
  458. pysvgwriter-1.0.0/svgwriter/video/_constants.pyi +49 -0
  459. pysvgwriter-1.0.0/svgwriter/video/_ffmpeg.py +223 -0
  460. pysvgwriter-1.0.0/svgwriter/video/_ffmpeg.pyi +32 -0
  461. pysvgwriter-1.0.0/svgwriter/video/_smil.py +256 -0
  462. pysvgwriter-1.0.0/svgwriter/video/_smil.pyi +5 -0
  463. pysvgwriter-1.0.0/svgwriter/video/animation.py +338 -0
  464. pysvgwriter-1.0.0/svgwriter/video/animation.pyi +53 -0
  465. pysvgwriter-1.0.0/svgwriter/video/frames.py +181 -0
  466. pysvgwriter-1.0.0/svgwriter/video/frames.pyi +39 -0
  467. pysvgwriter-1.0.0/svgwriter/video/reader.py +156 -0
  468. pysvgwriter-1.0.0/svgwriter/video/reader.pyi +26 -0
  469. 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
+ [![Tests](https://github.com/wzjoriv/svgwriter/actions/workflows/ci.yml/badge.svg)](https://github.com/wzjoriv/svgwriter/actions/workflows/ci.yml)
63
+ [![Docs](https://github.com/wzjoriv/svgwriter/actions/workflows/docs.yml/badge.svg)](https://wzjoriv.github.io/svgwriter)
64
+ [![PyPI](https://img.shields.io/pypi/v/pysvgwriter)](https://pypi.org/project/pysvgwriter/)
65
+ [![Python](https://img.shields.io/pypi/pyversions/pysvgwriter)](https://pypi.org/project/pysvgwriter/)
66
+ [![CPython 3.10-3.14](https://img.shields.io/badge/CPython-3.10%E2%80%933.14-blue)](https://github.com/wzjoriv/svgwriter/actions/workflows/ci.yml)
67
+ [![Linux · Windows · macOS](https://img.shields.io/badge/OS-Linux%20%C2%B7%20Windows%20%C2%B7%20macOS-blue)](https://github.com/wzjoriv/svgwriter/actions/workflows/ci.yml)
68
+ [![License: MIT](https://img.shields.io/badge/license-MIT-green)](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
+ [![Tests](https://github.com/wzjoriv/svgwriter/actions/workflows/ci.yml/badge.svg)](https://github.com/wzjoriv/svgwriter/actions/workflows/ci.yml)
4
+ [![Docs](https://github.com/wzjoriv/svgwriter/actions/workflows/docs.yml/badge.svg)](https://wzjoriv.github.io/svgwriter)
5
+ [![PyPI](https://img.shields.io/pypi/v/pysvgwriter)](https://pypi.org/project/pysvgwriter/)
6
+ [![Python](https://img.shields.io/pypi/pyversions/pysvgwriter)](https://pypi.org/project/pysvgwriter/)
7
+ [![CPython 3.10-3.14](https://img.shields.io/badge/CPython-3.10%E2%80%933.14-blue)](https://github.com/wzjoriv/svgwriter/actions/workflows/ci.yml)
8
+ [![Linux · Windows · macOS](https://img.shields.io/badge/OS-Linux%20%C2%B7%20Windows%20%C2%B7%20macOS-blue)](https://github.com/wzjoriv/svgwriter/actions/workflows/ci.yml)
9
+ [![License: MIT](https://img.shields.io/badge/license-MIT-green)](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
+ [![Tests](https://github.com/wzjoriv/svgwriter/actions/workflows/ci.yml/badge.svg)](https://github.com/wzjoriv/svgwriter/actions/workflows/ci.yml)
63
+ [![Docs](https://github.com/wzjoriv/svgwriter/actions/workflows/docs.yml/badge.svg)](https://wzjoriv.github.io/svgwriter)
64
+ [![PyPI](https://img.shields.io/pypi/v/pysvgwriter)](https://pypi.org/project/pysvgwriter/)
65
+ [![Python](https://img.shields.io/pypi/pyversions/pysvgwriter)](https://pypi.org/project/pysvgwriter/)
66
+ [![CPython 3.10-3.14](https://img.shields.io/badge/CPython-3.10%E2%80%933.14-blue)](https://github.com/wzjoriv/svgwriter/actions/workflows/ci.yml)
67
+ [![Linux · Windows · macOS](https://img.shields.io/badge/OS-Linux%20%C2%B7%20Windows%20%C2%B7%20macOS-blue)](https://github.com/wzjoriv/svgwriter/actions/workflows/ci.yml)
68
+ [![License: MIT](https://img.shields.io/badge/license-MIT-green)](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.