# 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/b3/b6/6a8c18c0c5b930f035e002a1217e183284492f9d59673aaa070f3b5992a5/svg_py-1.8.0.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.8.0",
"project_urls": {
"Homepage": "https://github.com/orsinium-labs/svg"
},
"split_keywords": [
"svg",
" drawing",
" vector"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "6bddc2a9f9356a68866bac0c5059dec3e1979c7bcc7156c3bbb3e593ac48f534",
"md5": "fadc3526ea286c72e98816e8b17eaeeb",
"sha256": "92cf8678378fe4274035e3d8164e9416072747e3b9b04b712a2168e2ca37c6f3"
},
"downloads": -1,
"filename": "svg_py-1.8.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "fadc3526ea286c72e98816e8b17eaeeb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 15111,
"upload_time": "2025-08-11T05:40:09",
"upload_time_iso_8601": "2025-08-11T05:40:09.186751Z",
"url": "https://files.pythonhosted.org/packages/6b/dd/c2a9f9356a68866bac0c5059dec3e1979c7bcc7156c3bbb3e593ac48f534/svg_py-1.8.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "b3b66a8c18c0c5b930f035e002a1217e183284492f9d59673aaa070f3b5992a5",
"md5": "87474bedd7e476cf555ca78823c20d5f",
"sha256": "2d998fbf28e51fbade081d2e4007adf756a16db13610ae8f252d1bd7aed04c8d"
},
"downloads": -1,
"filename": "svg_py-1.8.0.tar.gz",
"has_sig": false,
"md5_digest": "87474bedd7e476cf555ca78823c20d5f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 43644,
"upload_time": "2025-08-11T05:40:11",
"upload_time_iso_8601": "2025-08-11T05:40:11.031280Z",
"url": "https://files.pythonhosted.org/packages/b3/b6/6a8c18c0c5b930f035e002a1217e183284492f9d59673aaa070f3b5992a5/svg_py-1.8.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-11 05:40:11",
"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"
}