Skip to content

Latest commit

 

History

History
81 lines (61 loc) · 1.9 KB

File metadata and controls

81 lines (61 loc) · 1.9 KB

PyCreative Documentation

Getting Started

PyCreative is a creative coding framework for Python 3.11+ built atop Pyglet. It is designed for rapid prototyping of visual, audio, and interactive projects.

Installation

  1. Create a virtual environment:
    python3 -m venv .venv
    source venv/bin/activate
  2. Install dependencies:
    pip install -e .
    # Or, for development:
    pip install -e '.[test]'
    Pyglet is required and will be installed automatically.

Running Examples

To run a sketch:

pycreative examples/hello_sketch.py

Project Structure

  • src/pycreative/: Framework source code
  • examples/: Example sketches
  • docs/: Documentation
  • docs/api/: API Documentation
  • docs/developer/: Developer Documentation
  • sketches/: User sketches
  • tests/: Test suite

Key Modules

  • pycreative.app: Main loop, lifecycle hooks

Testing

Run all tests with:

pytest tests/ && ruff check . && mypy src

Conventions

  • Use Python 3.11+
  • Always use a .venv virtual environment
  • Type hints and docstrings required for public APIs
  • PEP8, Ruff

For more details, see the example sketches and module READMEs.

Contributing

Code contributions, pull requests, and suggestions are welcome!

  • Please open an issue for bugs, feature requests, or questions.
  • Submit pull requests with clear descriptions and relevant tests/examples.
  • All contributions should follow the project's style and documentation conventions.

We value community feedback and collaboration to improve PyCreative.

Minimal Example Sketch

Below is a minimal sketch that follows best practices and the format expected by app.py:

class Sketch:
   def setup(self):
      self.size(800, 600)

   def update(self, dt):
      pass  # Update state here

   def draw(self):
      self.background(0)
      self.ellipse(self.width/2, self.height/2, 200, 200)