Skip to main content

SaVaGe Turtle Build Badge Coverage Badge Downloads Badge PyPI Badge Supported Python versions

Use the Python turtle to write SVG files

If you're using the Python turtle module to teach students, or you just like using the turtle module yourself, this library can save the images from a turtle script as SVG files. Experiment with your turtle code using the regular turtle or the Live Coding in Python plugin for PyCharm, then pass an SvgTurtle to the same code, and save it as an SVG file. If you want to produce other file formats, use svglib to convert the SVG to PDF, PNG, GIF, JPG, TIFF, and PCT, among others.

Installing

Install it with pip install svg_turtle. If you haven't installed Python packages before, read Brett Cannon's quick-and-dirty guide.

Drawing

Once it's installed, create an SvgTurtle, telling it how big to make the SVG file. Then give it some turtle commands, and save the file.

from svg_turtle import SvgTurtle

t = SvgTurtle(500, 500)
t.forward(200)
t.dot(10)
t.save_as('example.svg')

IPythonTurtle

To use SvgTurtle with IPython integration, create an instance of the IPythonTurtle class. It exposes the same interface as SvgTurtle. It implements both display on implicit return, and explicit display via the show() method.

from svg_turtle import IPythonTurtle

t = IPythonTurtle(500, 500)
t.forward(200)
t.show()                    # explicit display
t.dot(10)
t                           # display via implicit return

More Information

If you'd like to help out with the project, see the CONTRIBUTING.md file in the source code.

Metadata

Release files for svg-turtle 1.2.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-turtle 1.2.0
File Size Uploaded Provenance
svg_turtle-1.2.0.tar.gz 15.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for svg-turtle 1.2.0
File Interpreter ABI Platform
svg_turtle-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.8 kB

Release files / svg_turtle-1.2.0.tar.gz

Download URL svg_turtle-1.2.0.tar.gz
Size 15.8 kB
Tags Source
SHA-256 checksum
How to use checksums
babfc15c8b70553655b2bb29238e10c83fc0c270c460e2430621d5f248f5e896
BLAKE2b-256 checksum
How to use checksums
d47f510060ea4e55be254761d79cfb3562edf79d9e6d0bf3a2c3e4092d526bb4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / svg_turtle-1.2.0-py3-none-any.whl

Download URL svg_turtle-1.2.0-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
61a7829594cdd1b954644d6caa66a4b767ff34da02d6b2fd8ce286c098b96125
BLAKE2b-256 checksum
How to use checksums
3e35e07f066f25701529d57c0bba2bd7e4bc70682d679cae9e9036b632ebed4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Security for svg-turtle 1.2.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.

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