Skip to main content

svg.py

Python library to generate SVG files.

Features:

  • Compatible with all SVG standards: 1.1, 1.2, 2.0, Tiny.
  • 100% type safe.
  • Pure Python.
  • No third-party runtime dependencies.
  • No deprecated attributes, only what actually works.
  • The same names and structure as in the standard. If you know how to write SVG files, you know how to use this library.

Based on svg-xsd-schema and MDN reference.

Installation

python3 -m pip install --user svg.py

Usage

Try svg.py online: svg.orsinium.dev.

import svg
canvas = svg.SVG(
    width=60,
    height=60,
    elements=[
        svg.Circle(
            cx=30, cy=30, r=20,
            stroke="red",
            fill="white",
            stroke_width=5,
        ),
    ],
)
print(canvas)

See examples for more.

Projects using svg.py

The github topic svg-py contains some of the projects that use svg.py in one way or another. If you want your project to appear on the list, simply add svg-py into the list of project topics. Here is how.

Metadata

Release files for svg.py 1.10.0

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

Source distribution (sdist)

Source distribution for svg.py 1.10.0
File Size Uploaded Provenance Actions
svg_py-1.10.0.tar.gz 43.8 kB Without provenance Details for svg_py-1.10.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for svg.py 1.10.0
File Interpreter ABI Platform Actions
svg_py-1.10.0-py3-none-any.whl Python 3 none any Details for svg_py-1.10.0-py3-none-any.whl

Total release size: 59.0 kB

Release files / svg_py-1.10.0.tar.gz

Download URL svg_py-1.10.0.tar.gz
Size 43.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2e1391411a205220a0e72ca303f3c2d11dbd564cb1dbc445406c5e11421bcc4b
BLAKE2b-256 checksum
How to use checksums
bc1ef36612d46266942c351de904bd9928610c485baee61220892277ac37be65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.3

Release files / svg_py-1.10.0-py3-none-any.whl

Download URL svg_py-1.10.0-py3-none-any.whl
Size 15.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
54c7470347d5d79b30d059584a4f449da08b462903e8ce262981338bab755560
BLAKE2b-256 checksum
How to use checksums
189f77a405e7b2a334ce774835263c3374d4ed307a3473f3925d9990a8c029e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.3

Security for svg.py 1.10.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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