Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: type-stubs
path: crates/processing_pyo3/mewnala/*.pyi
path: crates/processing_pyo3/processing_py/*.pyi

linux:
runs-on: ubuntu-22.04
Expand All @@ -42,7 +42,7 @@ jobs:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: type-stubs
path: crates/processing_pyo3/mewnala
path: crates/processing_pyo3/processing_py
- name: Setup QEMU
if: matrix.target == 'aarch64'
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0
Expand Down Expand Up @@ -91,7 +91,7 @@ jobs:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: type-stubs
path: crates/processing_pyo3/mewnala
path: crates/processing_pyo3/processing_py
- name: Build wheels
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
with:
Expand All @@ -116,7 +116,7 @@ jobs:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: type-stubs
path: crates/processing_pyo3/mewnala
path: crates/processing_pyo3/processing_py
- name: Build wheels
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
with:
Expand All @@ -138,7 +138,7 @@ jobs:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
name: type-stubs
path: crates/processing_pyo3/mewnala
path: crates/processing_pyo3/processing_py
- name: Build sdist
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
with:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/target/
/site/
crates/processing_ffi/include/
crates/processing_pyo3/mewnala/*.pyi
crates/processing_pyo3/processing_py/*.pyi
.DS_Store
.ipynb_checkpoints/
26 changes: 13 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "processing"
version = "0.0.8"
version = "0.4.0"
edition = "2024"
autoexamples = false

Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ You can learn more about this project from this [talk at LibreGraphicsMeeting 20

There is two different things at work here :
- libprocessing (this repo) is the low-level cross-platform library for the core Processing API. It's written in Rust, and thus lets write Processing sketches in Rust.
- mewnala is a Python package built directly from libprocessing, providing Python bindings for the library. It's available as any other Python package out there and lets you write Processing sketches in a Python environment, regardless of you having libprocessing or Rust installed.
- processing-py is a Python package built directly from libprocessing, providing Python bindings for the library. It's available as any other Python package out there and lets you write Processing sketches in a Python environment, regardless of you having libprocessing or Rust installed.

### mewnala (the python library)
### processing-py (the python library)

Inside of our `processing_pyo3` crate we have created a python package that you can easily install with pip.
Again, we are still very nascent, but let us know what kinds of snags you may run into while getting this set up.
Try running the examples in the [processing_pyo3 examples directory](crates/processing_pyo3/examples).

We are big fans of [uv](https://github.com/astral-sh/uv) and this is the easiest way to get started using `mewnala`
We are big fans of [uv](https://github.com/astral-sh/uv) and this is the easiest way to get started using `processing-py`

#### Setting up uv on linux or macOS
```bash
Expand All @@ -31,24 +31,24 @@ curl -LsSf https://astral.sh/uv/install.sh | sh
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
```

#### Install a mewnala
#### Install processing-py

We're going to create a folder named `mewnala-sketchbook` and install the `mewnala` package inside:
We're going to create a folder named `processing-py-sketchbook` and install the `processing-py` package inside:

```bash
# Initialize a project with uv
uv init mewnala-sketchbook && cd mewnala-sketchbook
uv init processing-py-sketchbook && cd processing-py-sketchbook

# add the package
uv add mewnala
uv add processing-py
```

Now create a file named `sketch.py` at the root of `mewnala-sketchbook`.
Now create a file named `sketch.py` at the root of `processing-py-sketchbook`.

You can use this code to test

```python
from mewnala import *
from processing_py import *

def setup():
size(400, 400)
Expand Down Expand Up @@ -176,7 +176,7 @@ sudo dpkg -i libglfw3_3.4-4_amd64.deb libglfw3-dev_3.4-4_amd64.deb

We want your help building this library!

One place we could really use some help is with porting Processing examples to using mewnala, and then reporting where you get stuck or where things could be easier. Check out the effort here: https://github.com/processing/processing-examples-mewnala.
One place we could really use some help is with porting Processing examples to using processing-py, and then reporting where you get stuck or where things could be easier. Check out the ported examples in [crates/processing_pyo3/examples](crates/processing_pyo3/examples).


You can see a list of outstanding tasks in our [issues](https://github.com/processing/libprocessing). However, while we're still in the early phases, consider checking in with us first in the `#devs-chat` channel on [Discord](https://discord.gg/h99u95nU7q) to coordinate our efforts.
Expand Down
2 changes: 1 addition & 1 deletion crates/processing_audio/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "processing_audio"
version = "0.1.0"
version = "0.4.0"
edition = "2024"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/processing_core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "processing_core"
version = "0.0.5"
version = "0.4.0"
edition = "2024"

[lints]
Expand Down
2 changes: 1 addition & 1 deletion crates/processing_cuda/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "processing_cuda"
version = "0.0.5"
version = "0.4.0"
edition = "2024"

[lints]
Expand Down
2 changes: 1 addition & 1 deletion crates/processing_ffi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "processing_ffi"
version = "0.0.5"
version = "0.4.0"
edition = "2024"

[lints]
Expand Down
2 changes: 1 addition & 1 deletion crates/processing_glfw/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "processing_glfw"
version = "0.0.5"
version = "0.4.0"
edition = "2024"

[lints]
Expand Down
2 changes: 1 addition & 1 deletion crates/processing_input/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "processing_input"
version = "0.0.5"
version = "0.4.0"
edition = "2024"

[lints]
Expand Down
2 changes: 1 addition & 1 deletion crates/processing_midi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "processing_midi"
version = "0.0.5"
version = "0.4.0"
edition = "2024"

[dependencies]
Expand Down
4 changes: 2 additions & 2 deletions crates/processing_pyo3/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "processing_pyo3"
version = "0.0.8"
version = "0.4.0"
edition = "2024"

[lints]
workspace = true

[lib]
name = "mewnala"
name = "processing_py"
crate-type = ["cdylib", "rlib"]

[features]
Expand Down
10 changes: 7 additions & 3 deletions crates/processing_pyo3/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Pycessing
# processing-py

Prototype for python bindings to libprocessing

Expand All @@ -19,6 +19,10 @@ $ maturin develop
# ...
#
$ python
>>> import processing
>>> processing.size(500, 500)
>>> import processing_py
>>> processing_py.size(500, 500)
```

## Acknowledgements

Thank you to [Faruk Hammoud](https://github.com/FarukHammoud) for generously handing over the `processing-py` name. Their original [processing_py](https://github.com/FarukHammoud/processing_py) project, a Python graphics library based on Processing, was published under this name from 2020 to 2021 (versions 0.1.0–0.3.7).
2 changes: 1 addition & 1 deletion crates/processing_pyo3/examples/Basics/Arrays/array_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Values in a 2D array are accessed through two index values.
# 2D arrays are useful for storing images. In this example, each dot
# is colored in relation to its distance from the center of the image.
from mewnala import *
from processing_py import *

distances = []
max_distance = 0.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Array Objects.
#
# Demonstrates the syntax for creating a list of custom objects.
from mewnala import *
from processing_py import *

unit = 40
count = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# In this example, an array named "coswave" is created and
# filled with the cosine values. This data is displayed three
# separate ways on the screen.
from mewnala import *
from processing_py import *

coswave = []

Expand Down
2 changes: 1 addition & 1 deletion crates/processing_pyo3/examples/Basics/Camera/move_eye.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# by Simon Greenwold.
#
# The camera lifts up (controlled by mouseY) while looking at the same point.
from mewnala import *
from processing_py import *

light = None

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# origin away from the viewer and will clip the geometry.
# Click a mouse button to switch between the perspective and
# orthographic projections.
from mewnala import *
from processing_py import *

show_perspective = False
light = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# The version of perspective without parameters sets the default
# perspective and the version with four parameters allows the programmer
# to set the area precisely.
from mewnala import *
from processing_py import *

light = None

Expand Down
2 changes: 1 addition & 1 deletion crates/processing_pyo3/examples/Basics/Color/brightness.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Brightness is the relative lightness or darkness of a color.
# Move the cursor vertically over each bar to alter its brightness.
from mewnala import *
from processing_py import *

bar_width = 20
last_bar = -1
Expand Down
Loading
Loading