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.
- Create a virtual environment:
python3 -m venv .venv source venv/bin/activate - Install dependencies:
Pyglet is required and will be installed automatically.
pip install -e . # Or, for development: pip install -e '.[test]'
To run a sketch:
pycreative examples/hello_sketch.pysrc/pycreative/: Framework source codeexamples/: Example sketchesdocs/: Documentationdocs/api/: API Documentationdocs/developer/: Developer Documentationsketches/: User sketchestests/: Test suite
pycreative.app: Main loop, lifecycle hooks
Run all tests with:
pytest tests/ && ruff check . && mypy src- Use Python 3.11+
- Always use a
.venvvirtual environment - Type hints and docstrings required for public APIs
- PEP8, Ruff
For more details, see the example sketches and module READMEs.
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.
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)