Skip to main content

Library for drawing spirographs in Python

Project description

spyrograph: elegant mathematics and geometries

Animation of three geometric, symmetrical shapes being drawn next to one another left to right. The shape on the left is red, the middle green, and the right is blue.

What is it?

spyrograph is a lightweight Python package that provides an expressive and flexible set of tools for drawing beautiful mathematically driven art. With just a few lines of easy-to-read code you can start analyzing, visualizing, and exploring elegant mathematics

Downloads Issues License Version Documentation Status

"Buy Me A Coffee"

Official website

Official docs

Table of Contents


:key: Key features

  • Expressive and consistent syntax
  • Robust underlying mathematics
  • Beginner and expert friendly
  • numpy is the only required third-party installation
  • Clear visualizations and animations
  • Flexible to a wide range of usecases
  • Lightweight, just plug and play

Sample hypotrochoid drawing showing a circle rolling around the interior of another circle drawing a geometric shape


:computer: Installation

pip

Install the latest stable release from PyPI using

$ pip3 install spyrograph

or clone the development version from GitHub with

$ git clone https://github.com/chris-greening/spyrograph.git

:seedling: Quickstart

spyrograph is designed to be expressive and easy-to-use - simply import spyrograph and jump right into drawing elegant, complex shapes in just a few lines of code!

from spyrograph import Hypotrochoid

# Trace a hypotrochoid from 0 to 2pi where
# the fixed circle radius is 300, rolling circle 
# radius is 200, and the distance from the rolling 
# circle is 100
hypotrochoid = Hypotrochoid(
    R=300,
    r=200,
    d=100,
    thetas=np.arange(0, 2*np.pi, .1)
)
hypotrochoid.trace(
    show_circles=True, 
    frame_pause=.05, 
    circle_color="grey"
)

:pray: Contributing

All contributions, bug reports, bug fixes, documentation improvements, enhancements, and ideas are welcome!

Feel free to open an Issue, check out existing Issues, or start a discussion.

Beginners to open source are highly encouraged to participate and ask questions if you're unsure what to do/where to start


:newspaper: Blog posts

Check out the official website for the latest blog posts on the project!


:books: Documentation

The official documentation can be found on Read The Docs


:credit_card: License

This library operates under the MIT license.


:grey_question: Support

Reach out to me if you want to connect or have any questions and I will do my best to get back to you

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spyrograph-0.26.0.tar.gz (20.3 kB view details)

Uploaded Source

File details

Details for the file spyrograph-0.26.0.tar.gz.

File metadata

  • Download URL: spyrograph-0.26.0.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

File hashes

Hashes for spyrograph-0.26.0.tar.gz
Algorithm Hash digest
SHA256 7de5b414beb9ef4428c7be90a0694ae2140a2fbe94a6b0942e52b37ec5d87d18
MD5 551703a638d52990b447d49834672bdd
BLAKE2b-256 f190dd0724d8fc47b88c3c44373f7fba4d8b61e26c7e80f5a024f55285e8dde2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page