Skip to content

Solez-ai/PySketch

Repository files navigation

PySketch - visual programming for Python Turtle

PySketch is a cutting-edge visual programming platform that revolutionizes how users interact with Python's Turtle graphics. By seamlessly transforming freehand sketches into clean, executable Python code, it empowers both artists and creative coders to prototype, learn, and create generative art without writing a single line of syntax manually. Built with the latest web technologies including Next.js 15 and React 19, PySketch offers a professional-grade environment with layer management, real-time compilation, and a fluid, responsive interface designed for the modern web.

✨ Technical Features & Capabilities

Core Functionality

  • Real-time Code Compilation: Instantaneously converts vector strokes into optimized Python turtle scripts using a custom compiler engine.
  • Intelligent Stroke Smoothing: Applies smart simplification algorithms to reduce node count and eliminate jitter, producing human-readable and efficient code.
  • Layer-Based Architecture: Professional-grade layer system allowing visibility toggling, reordering, and independent management of complex compositions.
  • Responsive Canvas Engine: High-performance drawing surface that dynamically adapts to viewport dimensions while maintaining coordinate precision.

Developer Experience

  • Integrated Code Inspector: Real-time code panel with custom-built lightweight syntax highlighting for Python.
  • One-Click Export: seamless generation of standalone .py files that function in any standard Python environment.
  • Configurable Runtime: Adjustable execution parameters including global animation speed (Instant to Slow) and canvas background settings.

Application Architecture

  • State Management: Robust localStorage persistence layer for auto-saving projects, preserving full edit history, stroke data, and application state.
  • Modern UI/UX: Premium dark-mode aesthetic utilizing Tailwind CSS, featuring glassmorphic headers and a responsive 3-panel layout (Tools, Canvas, Code).
  • Type Safety: Fully typed codebase using TypeScript for reliability and maintainability.

🚀 Getting Started

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/Solez-ai/PySketch.git
    cd PySketch/pysketch
  2. Install dependencies:

    npm install
    # or
    yarn install
  3. Run the development server:

    npm run dev
    # or
    yarn dev
  4. Open http://localhost:3000 with your browser to start creating!

🛠️ Built With

  • Next.js 15 - The React Framework for the Web
  • React 19 - The library for web and native user interfaces
  • Tailwind CSS - Rapidly build modern websites without ever leaving your HTML
  • TypeScript - JavaScript with syntax for types

📝 License

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

🤝 Contributing

Contributions are welcome! Please read our Contributing Guide for details on our code of conduct, and the process for submitting pull requests.

❤️ Credits

Made with ❤️ by Samin Yeasar @ Solez-ai

About

Making Python Turtles Have Never Been Easier: Just Draw, Copy & Paste

Resources

License

Contributing

Stars

Watchers

Forks

Contributors