Skip to main content
Pre-release

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

p5 is a Python library that provides high level drawing functionality to help you quickly create simulations and interactive art using Python. It combines the core ideas of Processing — learning to code in a visual context — with Python’s readability to make programming more accessible to beginners, educators, and artists.

Example

https://github.com/p5py/p5/blob/develop/docs/_static/readme.gif

p5 programs are called “sketches” and are run as any other Python program. The sketch above, for instance, draws a circle at the mouse location that gets a random reddish color when the mouse is pressed and is white otherwise; the size of the circle is chosen randomly. The Python code for the sketch looks like:

from p5 import *

def setup():
    size(640, 360)
    no_stroke()
    background(204)

def draw():
    if mouse_is_pressed:
        fill(random_uniform(255), random_uniform(127), random_uniform(51), 127)
    else:
        fill(255, 15)

    circle_size = random_uniform(low=10, high=80)

    circle((mouse_x, mouse_y), circle_size)

def key_pressed(event):
    background(204)

run()

Installation

Take a look at the installation steps here in the p5 documentation

License

p5 is licensed under the GPLv3. See LICENSE for more details. p5 also includes the following components from other open source projects:

All licenses for these external components are available in the LICENSES folder.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

p5-0.4.0a1.dev2.tar.gz (28.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

p5-0.4.0a1.dev2-py3-none-any.whl (100.1 kB view details)

Uploaded Python 3

File details

Details for the file p5-0.4.0a1.dev2.tar.gz.

File metadata

  • Download URL: p5-0.4.0a1.dev2.tar.gz
  • Upload date:
  • Size: 28.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for p5-0.4.0a1.dev2.tar.gz
Algorithm Hash digest
SHA256 3dca582ace9039253f3cb2186c5bb305cc8e64e5e1d51a685568d760f6badbba
MD5 70898c2f80e986006bbdf57288b8b63e
BLAKE2b-256 474c2a666c142ecd02965785aee910642696b98dc28549cf2d4eb677f065ec6c

See more details on using hashes here.

File details

Details for the file p5-0.4.0a1.dev2-py3-none-any.whl.

File metadata

File hashes

Hashes for p5-0.4.0a1.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 97255c07ac95c7a67b14a2531090698eddbaeba68038e30017863bc1a8a55ed9
MD5 4dbfaf445050c8d323f12331e85fabea
BLAKE2b-256 23408c23119522ba0b22f2b6698f297b8a15e986ad69d9f2b8c68d5a1f6e335d

See more details on using hashes here.

Release history Release notifications | RSS feed

0.9.0

2 files

0.8.4

2 files

0.8.3

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.1

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

This release

0.4.0a1.dev2 This release

2 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