PyCreative is a batteries-included creative-coding framework that makes it trivial to build visual, audio, and interactive projects in Python while staying lightweight and extensible. It uses Pyglet for low-level drawing, input, and window/context management, but provides higher-level conveniences: a component-driven app loop, scene & state management, easy shader support, multimedia I/O, asset management, utilities for math & noise, tight integration for live-coding, and idiomatic Python APIs inspired by Processing and openFrameworks.
- Modular architecture for easy extension
- 2D/3D graphics, OpenGL, audio, video, MIDI, user input
- Simple, discoverable, and chainable APIs
The examples/ directory includes runnable sketches that demonstrate the APIs.
Run examples with the CLI:
pycreative examples/sketch_example.pyFor more in-depth docs, see docs/README.md and the module-level docs under src/pycreative/.
The reasoning behind building PyCreative was threefold: First, I had a problem to solve ie the need to have a lightweight fast portable framework for building interactive media devices, secondly as a method of learning GitHub's Spec Kit to see how AI assisted development works, and thirdly to see how large-scale python applications were made (although it's probably not a good example of that).
Processing and openFrameworks are both fantastic tools for creative coding—so why make another framework with a similar API? The short answer: portability and extensibility.
Processing is lightweight and fast to launch, but it isn’t well-suited for building hardware-driven projects like video synths. openFrameworks, on the other hand, is powerful and close to the metal, but it relies on complex toolchains (CMake, Make) or heavy IDEs (Xcode, Visual Studio) along with C++ addons, which can be a barrier for rapid experimentation.
After years of building projects with both frameworks, I wanted a middle ground: something with Processing’s simplicity, openFrameworks’ hardware potential, and Python’s flexibility. Pyglet provides a fast, battle-tested engine for moving pixels around, but its quirks (like blitting) make it cumbersome for quick creative prototyping.
PyCreative hides those complexities behind a Processing-style API, while leveraging Python’s huge ecosystem. It runs out of the box on macOS, Windows, Linux, and even low-power devices like the Raspberry Pi—no complicated toolchain required. Add MIDI, OSC, GPIO, or whatever else you need through Python’s libraries, and you’ve got a powerful, extensible framework for creative coding and rapid prototyping.
More information is in the docs/README.md
- src/pycreative/: Main source code
- docs/: Class documentation
- examples/: Example sketches
- sketches/: User sketches
- tests/: Test suite
- Custom fonts
- Audio input/output
- Video input/output
- OSC support
- MIDI input/output
- 3D graphics
- Shader support
- GPU math offload (deferred): PyCreative is a GPU-first application and we
should evaluate offloading heavy math workloads (vector ops, neighbor
searches, image-wide kernels) to the GPU. Possible approaches include
Skia/GrShader compute, Metal/OpenGL compute shaders, or array-based
libraries such as CuPy / PyOpenCL with a CPU fallback. This is a
non-trivial integration with portability and dependency trade-offs; it
is currently deferred until core features are complete. See
TODOsor the project task list for more details if you want to prototype this. - Implpement fullscreen() restore previous window geometry (deferred): Currently, when exiting fullscreen mode, the window does not restore to its previous size and position. Implementing this feature would improve user experience. Deferred until core features are complete.
To help maintain package export conventions, a small installer is provided
to add a local git pre-commit hook that checks for explicit __init__.py
packages under src/core/:
./scripts/install_package_hook.shMore usage and troubleshooting is in scripts/README.md.
MIT