An experimental library for reading and converting SVG.
Project description
Svglib is an experimental library for reading SVG files and converting them (to a reasonable degree) to other formats using the Open Source ReportLab Toolkit. As a package it reads existing SVG files and returns them converted to ReportLab Drawing objects that can be used in a variety of ReportLab-related contexts, e.g. as Platypus Flowable objects or in RML2PDF. As a command-line tool it converts SVG files into PDF ones.
Tests include a vast amount of tests from the W3C SVG test suite. It also accesses around 200 flags from Wikipedia.org for test purposes (some of them hinting at more work to be done).
This release changes the license from GPL 3 to LGPL 3, introduces tiny bug fix reported by Harald Armin Massa and adapts to changed URLs for Wikipedia SVG flags used for test purposes.
Features
convert SVG files into ReportLab Graphics Drawing objects
handle plain or compressed SVG files (.svg and .svgz)
allow patterns for output files on command-line
install a Python package named svglib
install a Python command-line script named svg2pdf
provide a Unittest test suite
test on some standard W3C SVG tests available online
test on some Wikipedia sample SVG symbols available online
test on some Wikipedia sample SVG flags available online
Examples
You can use svglib as a Python package e.g. like in the following interactive Python session:
>>> from svglib.svglib import svg2rlg >>> from reportlab.graphics import renderPDF >>> >>> drawing = svg2rlg("file.svg") >>> renderPDF.drawToFile(drawing, "file.pdf")
In addition a script named svg2pdf can be used more easily from the system command-line like this (you can see more examples when typing svg2pdf -h):
$ svg2pdf file1.svg file2.svgz $ svg2pdf -o "%(basename)s.pdf" /path/file[12].svgz?
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file svglib-0.6.3.tar.gz
.
File metadata
- Download URL: svglib-0.6.3.tar.gz
- Upload date:
- Size: 543.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2a184cd53779bb8e7f0c488ce3fd3231dfc4338c2034e1946428685cd170da7 |
|
MD5 | 454edcfef70d52f62e0e434f2efad853 |
|
BLAKE2b-256 | 6d46097eec09b9febdd9908680f9c46ec3f91cc671d66510fb770ce9b080c0ca |
Provenance
File details
Details for the file svglib-0.6.3-py2.6.egg
.
File metadata
- Download URL: svglib-0.6.3-py2.6.egg
- Upload date:
- Size: 28.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9bd4b933bff55059cb6ce45ff004fedb9eafbb530fdf7db8aaafb419910bbbaf |
|
MD5 | 702690ef5fd2e8535fabde28c8c99de7 |
|
BLAKE2b-256 | 8158ed9fba026f76c4a4f502d77e59e2bd7aa9fe2e455d01d9c0617bb6908916 |
Provenance
File details
Details for the file svglib-0.6.3-py2.5.egg
.
File metadata
- Download URL: svglib-0.6.3-py2.5.egg
- Upload date:
- Size: 28.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b951e8bc822ae5ae836ca8f6bb1e2f4cf6f9b3724d1cb76ad605be0e4d7c03d |
|
MD5 | dda481b5413aed6479501a5179353138 |
|
BLAKE2b-256 | fed6fc8f8088090c82f8a7f938887100e9af5decb7db4b7a5e57cfe3895629e0 |
Provenance
File details
Details for the file svglib-0.6.3-py2.4.egg
.
File metadata
- Download URL: svglib-0.6.3-py2.4.egg
- Upload date:
- Size: 28.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5685e390962b38818fa3ae999f08d6787cd40f958b6fdcbb6a20b2d4e06aefa9 |
|
MD5 | dda395b3cfdf74a8dff223580bf28d45 |
|
BLAKE2b-256 | 5b359240f4fab42dfa02ca64716f9602818c5d288be1bca9a81179a694576937 |