Skip to main content

TurtleGridUtil

TurtleGridUtil is a Python utility for drawing customizable coordinate grids using the Turtle graphics library. It provides an easy way to create visual grids for educational purposes, graphing, or any project that requires a coordinate system.

source code on github

Features

  • Draw major and minor grid lines
  • Customizable line colors and widths
  • Adjustable grid spacing
  • Scale markers with customizable font and style
  • Optional scale point markers

Installation

Use pip install turtlegridutil for installing

Usage

Here's a basic example of how to use TurtleGridUtil:

import turtle
from turtlegridutil import draw_grid

# Create a turtle screen
screen = turtle.Screen()
screen.title("Grid Drawing")
screen.setup(width=800, height=600)

# Draw the grid
draw_grid(screen, major_line_step=50, minor_line_step=10)

# Keep the window open
turtle.done()

API Reference

draw_grid(screen, **kwargs)

Draws a coordinate grid on the given turtle screen.

Parameters:

screen (turtle.Screen): The turtle screen object on which to draw the grid.
major_line_step (int): The distance between major grid lines. Default is 100.
minor_line_step (int): The distance between minor grid lines. If 0, no minor lines are drawn. Default is 0.
major_line_color (str): The color of major grid lines. Default is "black".
minor_line_color (str): The color of minor grid lines. Default is "gray".
major_line_width (int): The width of major grid lines. Default is 1.
minor_line_width (int): The width of minor grid lines. Default is 1.
use_scale (bool): Whether to draw scale markers and labels. Default is True.
scale_step (int): The interval for placing scale markers and labels. If 0, uses major_line_step. Default is 0.
font_color (str): The color of the scale labels. Default is "black".
font_family (str): The font family for scale labels. Default is "Arial".
font_size (int): The font size for scale labels. Default is 14.
font_style (str): The font style for scale labels (e.g., "normal", "bold", "italic"). Default is "normal".
scale_points_size (int): The size of the dots marking scale points. If 0, no dots are drawn. Default is 5.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for turtlegridutil 0.1.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 turtlegridutil 0.1.0
File Size Uploaded Provenance Actions
turtlegridutil-0.1.0.tar.gz 3.4 kB Without provenance Details for turtlegridutil-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for turtlegridutil 0.1.0
File Interpreter ABI Platform Actions
turtlegridutil-0.1.0-py3-none-any.whl Python 3 none any Details for turtlegridutil-0.1.0-py3-none-any.whl

Total release size: 7.7 kB

Release files / turtlegridutil-0.1.0.tar.gz

Download URL turtlegridutil-0.1.0.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0935e2cd7504d826519c21ea296448515c95f3e4bbc97994d4b3d23ae7548c92
BLAKE2b-256 checksum
How to use checksums
d11f77037abd0e5d88e269bcb961d60df740a29c6fa40146f9d655a8bff314bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.13.1 Windows/11

Release files / turtlegridutil-0.1.0-py3-none-any.whl

Download URL turtlegridutil-0.1.0-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7af3844d74c1cb6c90c2afadb2af1e297af2471ceb83bdefbe8d028e453afcff
BLAKE2b-256 checksum
How to use checksums
fa9a48cee5c2406a383ac1903b489f9016bf22fddf2ae71ff0ab69e2744adbd9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.2 CPython/3.13.1 Windows/11

Security for turtlegridutil 0.1.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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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