Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

py5

py5 monthly downloads

py5 weekly downloads

mybinder

py5 is a new version of Processing for Python. The goal of py5 is to create a 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, shapely, trimesh, matplotlib, and Pillow.

py5 is an excellent choice for educators looking to teach Python in the context of creative coding and is currently used in classrooms all around the world. The documentation website includes introductory tutorials as well as extensive reference documentation, complete with example code.

Basic Example

Here is a basic example of a working py5 Sketch:

import py5


def setup():
    py5.size(400, 400)
    py5.rect_mode(py5.CENTER)


def draw():
    py5.square(py5.mouse_x, py5.mouse_y, 10)


def mouse_clicked():
    py5.fill(py5.random_int(255), py5.random_int(255), py5.random_int(255))


py5.run_sketch()

Installation

If you have Java 17 installed on your computer, you can install py5 using pip:

pip install py5

Detailed installation instructions are available on the documentation website. There are some Special Notes for Mac Users that you should read if you use macOS.

Getting Started

If you are new to Python, start with the intro to py5 and python tutorials. If you are familiar with Java programming and Processing, you'll find the Tips for Processing Java Users page to be helpful.

There are currently five basic ways to use py5. They are:

  • module mode: create a sketch with setup() and draw() functions that call methods provided by the py5 library. The above example is created in module mode.
  • class mode: create a Python class inherited from py5.Sketch. This mode supports multiple Sketches running at the same time.
  • imported mode: simplified code that omits the py5. prefix. This mode is supported by the py5 Jupyter notebook kernel and the py5-run-sketch command line utility.
  • static mode: functionless code to create static images. This mode is supported by the py5bot Jupyter notebook kernel, the %%py5bot IPython magic, and the py5-run-sketch command line utility.
  • processing mode: make calls to Python from a Processing (Java) Sketch. This mode enables py5 to function as bridge, connecting the Python and Java ecosystems through a new callPython() method.

Source Code

py5 was created by the artist and software developer Jim Schmitz (@hx2A) starting in March of 2020. The library is the foundation of his art practice.

The py5 library makes the Java Processing jars available to the CPython interpreter using JPype. It can do just about everything Processing can do, except with Python instead of Java code. New py5 features and bug fixes are being added to py5 every day. The library is always in active development and is well maintained.

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.

Funding

Please sponsor py5!

This project is not an official part of the Processing Foundation and is not receiving any funding from them. Any funds you contribute will be used first for website expenses and next to support @hx2A's time to further develop py5 as a solid creative coding framework used by educators, artists, and hobbyists all around the world.

Get In Touch

Have a comment or question? We'd love to hear from you! The best ways to reach out are:

Metadata

Release files for py5 0.10.12a0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py5 0.10.12a0
File Size Uploaded
py5-0.10.12a0.tar.gz 17.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for py5 0.10.12a0
File Interpreter ABI Platform
py5-0.10.12a0-py3-none-any.whl Python 3 none any Details

Total release size: 34.8 MB

Release files / py5-0.10.12a0.tar.gz

Download URL py5-0.10.12a0.tar.gz
Size 17.3 MB
Tags Source
SHA-256 checksum
How to use checksums
a0a235b94734d6a066b2880584a12a65439fa10e41644c7f67685f27a5c3b886
BLAKE2b-256 checksum
How to use checksums
c71abae4ae40f1dceba313304714e90724025b5979b2ec34c5790db0c902c4d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / py5-0.10.12a0-py3-none-any.whl

Download URL py5-0.10.12a0-py3-none-any.whl
Size 17.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
f5b8c8b25be9180400c40d7899212e72f3f829cd7ddfbc48e4f67aad012ad833
BLAKE2b-256 checksum
How to use checksums
038dc44b0b133cbfa1618fb45de3145626df54cbb1215566b15ef9422dbc6d4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Release history Release notifications | RSS feed

This release

0.10.12a0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page