2D & 3D Posix Renderers for py5
Project description
py5 Posix Renderer
The Posix Renderer library is used to render py5 Sketches in the terminal.
For example, you can create something like this:
or perhaps something like this:
This library makes heavy use of ANSI escape codes to integrate a py5 Sketch into the terminal.
The main idea is to create a hidden rasterized image and then convert that image into something that can appear in the terminal. Sketches can be converted into plain ASCII characters, colored ASCII characters, colored cells, and more! You can customize this conversion process however you like.
The animated Posix Sketch supports many of py5's keyboard, mouse, and window events.
Requirements
This library creates animations that appear in a Posix terminal window. Therefore, this works on Linux and MacOS only. It cannot work in a Windows DOS window because a DOS window is not a Posix terminal. It probably works in the Windows Linux subsystem but I haven't specifically tested that.
You must have a working py5 installation. You can learn how to install py5 on the documentation website. Installing py5 requires you have Java installed on your machine.
Once you have py5 installed, you can install the Posix Renderer library with pip:
pip install py5-posix-renderer
You will find some examples to get you started in the examples/ directory.
Caveats
This library is highly experimental and subject to change. There are certainly many bugs that will impact user experience.
py5 issue #772 impacts this library's performance on MacOS machines. This will be resolved after the next py5 release.
When you use this library's 3D renderer (POSIX3D), you will see a small window
with the py5 logo appear on the screen. It is not possible for this library to
offer 3D graphics without opening that window.
Currently this library has no documentation or docstrings. You can learn how to use it from reading the example code or from looking at the source code. If you'd like to help create more example code or write tutorials, I'd be grateful.
Why does this exist?
This renderer was built over the past two years as a passion project, driven by curiosity and the willingness to do something without a clear purpose beyond the desire to explore a corner of the technology world I am not familiar with. The more I learned about Python and Posix terminals, the more opportunities I saw to expand py5’s functionality in ways I didn’t think were possible. I’d like to share that expanded horizon with the Python community.
The Python library py5 is often used for educational purposes to teach people how to code in the context of creative coding. Providing an avenue for creative coding in the terminal can make the terminal a more inviting place to people who might otherwise be intimidated by its complexity.
There is a deeper purpose here related to my interest in creating what I call
experimental renderers for computational art. Processing is an amazing library
with a long history. One of its overlooked strengths is its ability to support
users who wish to inherit from the PGraphics class and create their own
renderers. I intend to explore this idea further. This library is also an
investigation into some of the design decisions for how to go about creating these
experimental renderers. Any thoughts or feedback is welcome.
Acknowledgements
Many, many thanks to @jsbueno for the very helpful discussions about terminal programming. We met at Python Brasil 2025 in Sao Paulo, Brazil and he introduced me to his project terminedia. It wouldn't have occurred to me that receiving mouse events in the terminal was even possible had he not shown me how. Some of the code in device_events.py is adapted from terminedia. Obrigado!
Accessibility
What kind of support does this library provide folks who use screen readers?
I don't know, someone will have to tell me. I do know that this library moves the cursor around the terminal, and I suspect this would conflict with how a screen reader moves its focus around a terminal window. But perhaps screen readers can do things that I don't know about? This is likely. In any case, I'd love it if someone who is more knowledgeable about this subject will investigate and tell me what they find. If there's a way for me to improve this library and make it useful for screen reader users, I'd be happy to hear about it.
Funding
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.
Thank you much for the support from py5's generous sponsors!
- @adanaher (Alec Danaher)
- @ericof (Érico Andrei)
- @nickmcintyre (Nick McIntyre)
Get In Touch
Have a comment or question? We'd love to hear from you! The best ways to reach out are:
- github discussions and issues
- Mastodon fosstodon.org/@py5coding
- processing foundation discourse
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py5_posix_renderer-0.1.1.tar.gz.
File metadata
- Download URL: py5_posix_renderer-0.1.1.tar.gz
- Upload date:
- Size: 564.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
816eea32498a91f35150aff5e3822c31d04adbefeec6a2d92c58264de744c0b5
|
|
| MD5 |
f58c0a333c2e2bc76b903af30a53fa05
|
|
| BLAKE2b-256 |
1b5a3692afc49338f333921816912cdb37b2af740f36619b5b99e6abdedd3536
|
File details
Details for the file py5_posix_renderer-0.1.1-py3-none-any.whl.
File metadata
- Download URL: py5_posix_renderer-0.1.1-py3-none-any.whl
- Upload date:
- Size: 49.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4babf9d48fe7f0404104a98507d6ab65b7179bf606c446a8726ea92b27d3f74c
|
|
| MD5 |
8cf406997e6e49038fd1388fe7117bbe
|
|
| BLAKE2b-256 |
7bd995f243ce47a190a9e932f938c5cc23e057662ce4d761d9dfc90050c0528d
|