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.
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)
| File | Size | Uploaded | |
|---|---|---|---|
| svg_py-1.10.0.tar.gz | 43.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| svg_py-1.10.0-py3-none-any.whl | Python 3 | none | any | Details |
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
|