Proceso: A Python package for creative coding on the web


I started tinkering with p5.js and PyScript last week and wound up creating a new sketchbook for the web called proceso (“process” in Spanish). It’s heavily inspired by py5 and aims to integrate p5.js into the Python ecosystem. Many thanks to @villares and @hx2A for their help in getting started!

Here’s an example of how to create a “static sketch” without animation or interaction:


<!DOCTYPE html>
<html lang="en-us">

    <title>Simple Shapes</title>
    <meta charset="utf-8" />

    <link rel="stylesheet" href="" />
    <script defer src=""></script>
    <link rel="stylesheet" href="style.css" />
    <script src=""></script>
        packages = ["numpy", "proceso"]

    <py-script src=""></py-script>



body {
    margin: 0;
    padding: 0;

canvas {
    display: block;

Simple Shapes
Adapted from

This example includes a circle, square, triangle, and a flower. 
from proceso import Sketch

p5 = Sketch()

# Create the canvas
p5.create_canvas(720, 400)

# Set colors
p5.fill(204, 101, 192, 127)
p5.stroke(127, 63, 120)

# A rectangle
p5.rect(40, 120, 120, 40)
# An ellipse
p5.ellipse(240, 240, 80, 80)
# A triangle
p5.triangle(300, 100, 320, 100, 310, 80)

# A design for a simple flower
p5.translate(580, 200)
for _ in range(10):
    p5.ellipse(0, 30, 20, 80)
    p5.rotate(p5.PI / 5)

And here’s an “active sketch” that simulates flocking on the p5 Editor and on PyScript.

If you pip install proceso locally, IDE’s such as Visual Studio Code will display documentation, provide autocomplete, and so on. After installation, you can run python -m http.server in a folder containing files like those listed above.

The package has a hard NumPy dependency for its Vector class (thanks py5!) and will work with any packages supported by Pyodide. I plan to have documentation and JupyterLite support ready for a couple of summer camps that I’m teaching.

In the meantime, have a look at the example sketches in the GitHub repo and feel free to open an issue if you find a bug or have a suggestion. Happy coding!



This looks great, @mcintyre ! I added this to my todolist to experiment with in the near future.

1 Like