# 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](https://github.com/dumistoklus/svg-xsd-schema/blob/master/svg.xsd) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/SVG).
## Installation
```bash
python3 -m pip install --user svg.py
```
## Usage
**Try svg.py online:** [svg.orsinium.dev](https://svg.orsinium.dev/).
```python
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](./examples/) for more.
## Projects using svg.py
The github topic [svg-py](https://github.com/topics/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][add-topic].
[add-topic]: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/classifying-your-repository-with-topics#adding-topics-to-your-repository
Raw data
{
"_id": null,
"home_page": "https://github.com/orsinium-labs/svg",
"name": "svg.py",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "svg, drawing, vector",
"author": "Gram",
"author_email": "gram@orsinium.dev",
"download_url": "https://files.pythonhosted.org/packages/1f/42/20b79492579b45437d29231f65356728e6208846924ef4ced86e88a0f31b/svg_py-1.9.2.tar.gz",
"platform": null,
"description": "# svg.py\n\nPython library to generate SVG files.\n\nFeatures:\n\n+ Compatible with all SVG standards: 1.1, 1.2, 2.0, Tiny.\n+ 100% type safe.\n+ Pure Python.\n+ No third-party runtime dependencies.\n+ No deprecated attributes, only what actually works.\n+ The same names and structure as in the standard. If you know how to write SVG files, you know how to use this library.\n\nBased on [svg-xsd-schema](https://github.com/dumistoklus/svg-xsd-schema/blob/master/svg.xsd) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/SVG).\n\n## Installation\n\n```bash\npython3 -m pip install --user svg.py\n```\n\n## Usage\n\n**Try svg.py online:** [svg.orsinium.dev](https://svg.orsinium.dev/).\n\n```python\nimport svg\ncanvas = svg.SVG(\n width=60,\n height=60,\n elements=[\n svg.Circle(\n cx=30, cy=30, r=20,\n stroke=\"red\",\n fill=\"white\",\n stroke_width=5,\n ),\n ],\n)\nprint(canvas)\n```\n\nSee [examples](./examples/) for more.\n\n## Projects using svg.py\n\nThe github topic [svg-py](https://github.com/topics/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][add-topic].\n\n[add-topic]: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/classifying-your-repository-with-topics#adding-topics-to-your-repository\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "SVG drawing library",
"version": "1.9.2",
"project_urls": {
"Homepage": "https://github.com/orsinium-labs/svg"
},
"split_keywords": [
"svg",
" drawing",
" vector"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "f87486c10415be3767718311763a1023717ebd9f929470e97a898c96b7c3f64b",
"md5": "e3ef67ad7a688e18c7df446e6a5dc0a4",
"sha256": "9178310947b62f0f2b41d1248a734c25ddf4df87d817c17f048d06fe18fcbf46"
},
"downloads": -1,
"filename": "svg_py-1.9.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e3ef67ad7a688e18c7df446e6a5dc0a4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 15142,
"upload_time": "2025-10-18T09:01:02",
"upload_time_iso_8601": "2025-10-18T09:01:02.792485Z",
"url": "https://files.pythonhosted.org/packages/f8/74/86c10415be3767718311763a1023717ebd9f929470e97a898c96b7c3f64b/svg_py-1.9.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "1f4220b79492579b45437d29231f65356728e6208846924ef4ced86e88a0f31b",
"md5": "5eab1d2a23d7d9c2c134f52e4f1168ca",
"sha256": "22b9881c580f55bf9d02e1a2c2d65ed05ed7d8a7d5467e847c5e1197ae0e3a9f"
},
"downloads": -1,
"filename": "svg_py-1.9.2.tar.gz",
"has_sig": false,
"md5_digest": "5eab1d2a23d7d9c2c134f52e4f1168ca",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 43711,
"upload_time": "2025-10-18T09:01:04",
"upload_time_iso_8601": "2025-10-18T09:01:04.938208Z",
"url": "https://files.pythonhosted.org/packages/1f/42/20b79492579b45437d29231f65356728e6208846924ef4ced86e88a0f31b/svg_py-1.9.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-18 09:01:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "orsinium-labs",
"github_project": "svg",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "svg.py"
}