Skip to main content

PySVGExport

Python Version Support PyPI Version GitHub license

SVGExport for Python

Idea from svgexport using for nodejs

Install via pip

pip3 install pysvgexport

Usage

1. Command-line
# See instruction
svgexport -h

# Export command example
svgexport -f SVG_FILE_PATH -s SCALE -o OUT_PUT_PNG
2. Inside a Python project
from pysvgexport import SVGExport

svg_data = '''
    <svg xmlns="http://www.w3.org/2000/svg"
         xmlns:xlink="http://www.w3.org/1999/xhtml" width="235.6875px" 
         height="112.37257096319047px" 
         viewBox="0 0 235.6875 112.37257096319047">
        <defs>
            <path d="M 29.050328462552656,81.24213909012583 A 120.43422075282764 
                     120.43422075282764 0&#10;    
                     0  1 206.63717153744733,81.24213909012583 Z" 
                  id="svg-text" />
        </defs>
        <text>
            <textPath xmlns:xlink="http://www.w3.org/1999/xhtml" 
                      xlink:href="#svg-text" lengthAdjust="spacing" 
                      fill="#1ebb6a" method="stretch" 
                      textLength="199.6875" spacing="auto" 
                      xml:space="preserve" 
                      style="font-size: 30px; 
                             letter-spacing: 0px; 
                             font-family: &quot;Aclonica.ttf&quot;;"
            >LALALALA text</textPath>
        </text>
    </svg>
'''
capture_options = {"scale": 20}
output_options = {"omitBackground": True}
svg_exporter = SVGExport(svg_data=svg_data, 
                         capture_options=capture_options, 
                         output_options=output_options)
image = svg_exporter.execute()

Metadata

Release files for pysvgexport 1.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pysvgexport 1.2.2
File Size Uploaded
pysvgexport-1.2.2.tar.gz 5.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pysvgexport 1.2.2
File Interpreter ABI Platform
pysvgexport-1.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 12.4 kB

Release files / pysvgexport-1.2.2.tar.gz

Download URL pysvgexport-1.2.2.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
268b10f02f0d78424484328698a7bf4562fa9ff61df48472f2f0e4cd12e047e7
BLAKE2b-256 checksum
How to use checksums
d34b41a2bb0806080f29732a97753665f06531b95a081b37ccbc73a00dd435e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

Release files / pysvgexport-1.2.2-py3-none-any.whl

Download URL pysvgexport-1.2.2-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
18307a556bc95c1884972df2fd4b8f705da8258d4d19a596e2f8f72646f9cb2b
BLAKE2b-256 checksum
How to use checksums
40a0f6258bc96c8fe0663deb163183dd799e58e103dd766f3dbc05a674ec2e20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10

Release history Release notifications | RSS feed

This release

1.2.2 This release

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

3 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page