SVG ファイルを作成する Python ライブラリ
ちょっと訳あって, SVG ファイルを作成する Python ライブラリを調べています. PyPI から SVG で検索して見付かったライブラリを片っ端から調査していきます.
$ pip search SVG
pygal - A python svg graph plotting library
CairoSVG - A Simple SVG Converter for Cairo
svg.charts - Python SVG Charting Library
Cnc25D - CAD library for 2.5D parts (including gears) using svgwrite, dxfwrite or FreeCAD as backend
gpml2svg - Render GPML pathway markup to SVG from the commandline/Python.
eea.converter - SVG, PNG, PDF converters using external tools as ImageMagick
svgbatch - Loads SVG files into pyglet Batch objects for OpenGL rendering.
svgwrite - A Python library to create SVG drawings.
XStatic-svg-edit-moin - svg-edit-moin 2012.11.27 (XStatic packaging standard)
pysvg - Python SVG Library
fullmarks.tinymceplugins.asciisvg - ASCIISvg Plugin for TinyMCE in Plone for drawing a graph of function in SVG
pydirstat - Show statistics informations for a directory in HTML, SVG, or Flash.
svgsitemap - a site map using PyGraphviz and svg
glsvg - OpenGL SVG Renderer
sauvage - sauvage is a library that helps creating, manipulating and rendering SVG scenes with OpenGL
svglib - An experimental library for reading and converting SVG.
qrplatba - QR platba SVG QR code and SPAYD string generator
XStatic-svgweb - svgweb 2011.2.3 (XStatic packaging standard)
pixel2svg - pixel2svg - Convert pixel art to SVG
scour - Scour SVG Optimizer
svg.path - SVG path objects and parser
PyQRCode - A QR code generator written purely in python 3 with SVG and PNG output.
simplesvg - UNKNOWN
nsi.svgtool - UNKNOWN
Things - A vector animation API using Python, Cairo and Inkscape SVG files. Create quick animations by containment, keyframe tweening and other simple Things. New, one can
now export each frame as PNG or SVG files.
pytablefy - A python SVG table library
svgobject - Object-oriented library for handling SVG drawings
svglue - Create templates using Inkscape, then fill them in (and render them to PDF, if you like).
ewscal - Render Exchange calendars to SVG using d3.js
svgplotlib - SVG plotting library
svg2rlg - Convert SVG to Reportlab drawing
svgutils - Python SVG editor
Charty - Another Python SVG Chart Generator that uses CSS smartly
django_svg - SVG solution for all browsers. PNG versions of the SVG will be asynchrously generated by Batik and presented to browsers that do not support SVG.
collective.pygal.core - Pygal dynamic SVG charting library integration for plone
pyWxSVG - SVG canvas for wxPython
の結果を調べてみた.
色々調べてみて, 目的, できることが明示されていたり, デモ画像が見られるものは興味を惹かれますね. Python バージョンが明記してあるものは安心して使えます. ライセンスが明記してないと, どう仕様ライブラリのライセンスをどう処理していいか分からないので困ります.
結論としては, 任意の SVG ファイルを作成するなら svgwrite がほぼ唯一の選択肢のようです.
とりあえず SVG の調査はここまでとします.