Welcome to py5!#
py5 is a version of Processing for Python 3.8+. It makes the Java Processing jars available to the CPython interpreter using JPype. It can do just about all of the 2D and 3D drawing Processing can do, except with Python instead of Java code.
The goal of py5 is to create a new version of Processing that is integrated into the Python ecosystem. Built into the library are thoughtful choices about how to best get py5 to work with other popular Python libraries and tools such as Jupyter, numpy, and Pillow.
Here is the simplest possible example of a py5 Sketch:
def setup(): size(400, 400) rect_mode(CENTER) def draw(): square(mouse_x, mouse_y, 10) def mouse_clicked(): fill(random_int(255), random_int(255), random_int(255)) run_sketch()
Here is an animated GIF to give you an idea of what that Sketch looks like:
Have a comment or question about py5? We’d love to hear from you! The best ways to reach out are:
The py5 library has many features but is alpha software. The library and this website are both a work in progress.
To view the actual installed py5 library code, look at the py5 repository. The py5 library code is the output of the meta-programming project py5generator. All py5 development is done through py5generator.