CairoSVG
A Simple SVG Converter based on Cairo
Decision gist · record as of 2026-08-14
Yes. CairoSVG is production-stable, actively maintained, has low install friction, no known vulnerabilities, and solves a concrete problem (SVG conversion to multiple formats). The LGPL copyleft license is standard for graphics libraries and poses no barrier for most use cases. Install if you need reliable SVG-to-PDF/PNG/EPS conversion.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later; Cairo graphics library must be available on the system (typically pre-installed on most Linux distributions, may require separate installation on macOS or Windows).
- Low install friction with a pure Python wheel distribution.
- Active maintenance with a recent release (154 days ago) and ongoing repository activity; supports current Python versions (3.10–3.14).
License · maintenance · safety
LGPL-3.0-or-later (copyleft) — LGPL-3.0-or-later copyleft license requires that derivative works and modifications remain under the same license; acceptable for most projects but review your distribution model if you plan to bundle or modify the source.
last release 2026-03-13 (154 days) · last repo commit 2026-07-05 · 948 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 20,670,714 downloads/mo, #1,029 on PyPI
Alternatives
Verify before relying
pip install cairosvg
import cairosvg
carosvg.svg2pdf(url='input.svg', write_to='output.pdf')- Whether Cairo system library is pre-installed or requires manual setup on Windows and macOS platforms.
- Performance characteristics when converting large or complex SVG files in batch operations.
What it is and what it does
CairoSVG is a Python library that renders SVG files to multiple output formats—PDF, EPS, PostScript, and PNG—by delegating rendering to the Cairo graphics engine. It wraps Cairo functionality through cairocffi and uses cssselect2 and tinycss2 to parse SVG stylesheets and selectors, defusedxml to safely parse XML, and Pillow for raster image handling. The library is stable (Production/Stable status), actively maintained, and supports modern Python versions from 3.10 onward.
Typical use cases include batch conversion of vector graphics for print or web distribution, programmatic SVG-to-PDF generation in document pipelines, and rendering SVG content to raster formats when vector output is not required. The copyleft LGPL license means you must disclose modifications if you redistribute the library, but using it as a dependency in your own application is straightforward.
Use it for
- Convert SVG graphics to PDF for embedding in reports or print-ready documents.
- Batch export SVG icons or illustrations to PNG for web use or mobile apps.
- Generate PostScript or EPS output from SVG for legacy printing systems or archival.
- Programmatically render SVG content in a document generation pipeline without manual design tool steps.
- Transform vector graphics to raster formats when downstream tools require PNG or similar formats.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
CairoSVG is production-stable, actively maintained, has low install friction, no known vulnerabilities, and solves a concrete problem (SVG conversion to multiple formats). The LGPL copyleft license is standard for graphics libraries and poses no barrier for most use cases. Install if you need reliable SVG-to-PDF/PNG/EPS conversion.
Install
cairosvg on PyPI
Before you install
Low install friction with a pure Python wheel distribution. Active maintenance with a recent release (154 days ago) and ongoing repository activity; supports current Python versions (3.10–3.14).
Requires Python 3.10 or later; Cairo graphics library must be available on the system (typically pre-installed on most Linux distributions, may require separate installation on macOS or Windows).
License in practice
LGPL-3.0-or-later copyleft license requires that derivative works and modifications remain under the same license; acceptable for most projects but review your distribution model if you plan to bundle or modify the source.
Quickstart
pip install cairosvg
import cairosvg
carosvg.svg2pdf(url='input.svg', write_to='output.pdf')
Verify before relying
- Whether Cairo system library is pre-installed or requires manual setup on Windows and macOS platforms.
- Performance characteristics when converting large or complex SVG files in batch operations.
Package facts
| License | LGPL-3.0-or-later copyleft |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 5 packagescairocfficssselect2defusedxmlpillowtinycss2 |
| Maintenance | Actively maintained 154 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 20,670,714 / month, #1,029 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: End Users/DesktopOperating System :: OS IndependentProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Multimedia :: Graphics :: Graphics Conversion |
Evidence: cairosvg-2.9.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “svg to png export”
- CairoSVGCairoSVG converts SVG files to PDF, EPS, PS, and PNG formats using…
- kaleidoKaleido generates static images (PNG, SVG, PDF, etc.) from figures,…
- vl-convert-pythonConverts Vega-Lite chart specifications to static SVG or PNG images,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Graphics Conversion packages
Pillow adds image processing capabilities to Python, providing file format support, efficient pixel data handling, and image manipulation operations.
Install it if you need to work with images in Python—it is the de facto standard for this task.
fonttools manipulates font files in multiple formats (TrueType, OpenType, AFM, Type 1, Mac-specific) and includes TTX, a tool to convert fonts to and from XML text format.
Install it if you need to read, write, or manipulate fonts programmatically or via the TTX command-line tool.
WeasyPrint converts HTML and CSS into PDF documents using a Python-based rendering engine designed for pagination and document generation.
pillow-heif adds HEIF/HEIC image format support to Python, enabling decoding and encoding of 8, 10, and 12-bit HEIC files with metadata and depth image handling.
Rasterio reads and writes geospatial raster data in formats like GeoTIFF, providing a Python API based on N-D arrays for working with gridded datasets.
Decodes HEIF/HEIC image files and integrates with pillow for reading and conversion to other formats, supporting 8/10/12-bit color depths and depth images.
See also sphinxcontrib-svg2pdfconverter · svglib · typst · vtracer · rlPyCairo · svgutils · resvg_py · scour · napari-svg · svg.py