Py5

Latest version: v0.10.3a1

Safety actively analyzes 681790 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 3

129200200.9.1a1

...and bug fixes.

We are moving back to py5's previous release frequency of a release every 2-3 months. This is minor release with one important feature to support Thonny users, as well as a handful of bug fixes and other improvements.

Imported Mode Code Importing feature

Python projects with moderate to large amounts of code will be typically split into multiple files that will be `imported` from from one file to another. However, due to the way py5's Imported Mode works, this couldn't be done with py5 Imported Mode code. This new feature changes that, supporting the ability to import Imported Mode code from one file to another. How to do this is described in more detail in the documentation page [Importing Imported Mode Code](http://py5coding.org/content/importing_py5_code.html#importing-imported-mode-code).

Other Changes

* Using `g` to access the primary Py5Graphics object is now deprecated. Users will receive a warning message instructing them to use `get_graphics()` intead. Allowing the single character `g` to be a reserved variable name is problematic for users coding in Imported Mode. Consider that the `g` variable is often used in a rgb variable triplet. The `g` variable will be removed in the next release.
* Update dependency versions for numpy from 1.23 to 1.24 and for pillow from 9.2 to 9.5
* New `Py5Shape.color_mode()` method, similar to `Py5Graphics.color_mode()` and `py5.color_mode()`
* New `Py5Shape` methods `vertices()`, `bezier_vertices()`, `quadratic_vertices()`, and `curve_vertices()`, analogous to the other methods of the same name.

Closed Issues

* [Issue 301: Imported mode validation should not allow new function definitions for py5 reserved words](https://github.com/py5coding/py5generator/issues/301)
* [Issue 302: Py5Shape class should have a Java Py5ShapeHelper class, analogous to Py5GraphicsHelper for Py5Graphics](https://github.com/py5coding/py5generator/issues/302)
* [Issue 303: Py5Graphics.create\_shape() method cannot create GROUP shapes](https://github.com/py5coding/py5generator/issues/303)
* [Issue 304: Add color_mode() method to Py5Shape](https://github.com/py5coding/py5generator/issues/304)
* [Issue 307: Py5Graphics methods points(), vertices(), etc have no type hints or docstrings](https://github.com/py5coding/py5generator/issues/307)
* [Issue 295: py5_tools.register_processing_mode_key() should be optional for same-name keys in the namespace setup() and draw() are found](https://github.com/py5coding/py5generator/issues/295)
* [Issue 314: Spaces in def setup() definition are tripping up the run_sketch utility](https://github.com/py5coding/py5generator/issues/314)
* [Issue 317: Removing g from the list of py5 "reserved words" breaks things](https://github.com/py5coding/py5generator/issues/317)
* [Issue 318: The %%py5draw magic is broken](https://github.com/py5coding/py5generator/issues/318)
* [Issue 319: constrain() returns zero-dimensional array instead of float](https://github.com/py5coding/py5generator/issues/319)
* [Issue 323: Improve NameError exception message when Imported mode users have a py5. somewhere in their code](https://github.com/py5coding/py5generator/issues/323)

129200190.9.0a0

This is a major release with big improvements to py5's functionality. This release was a lot of work!

What Changed?

You can read about all of the changes and the reasons behind them on the [maintainers blog](https://ixora.io/blog/new-release-090a0/). The main highlights are:

* [Processing Mode](http://py5coding.org/content/processing_mode.html) - gives Processing users a new `callPython()` method to make arbitrary calls to Python. Here, py5 functions as a bridge from Java to the Python world
* [Hybrid Programming](http://py5coding.org/content/hybrid_programming.html) - augment your py5 Sketches with Java code
* Attribute Errors now provide coding suggestions. For example:

python
py5 encountered an error in your code:

File "<ipython-input-6-b7441cc777da>", line 2, in setup
1 def setup():
--> 2 c = py5.colorr(255)
3 py5.background(c)
..................................................
py5.colorr = AttributeError
py5 = <module 'py5' from '/Users/jim/INSTALL/anaconda3/envs/
py5/lib/python3.8/site-packages/py5/__init__.py'>
..................................................

AttributeError: py5 has no function or field named "colorr". Did you mean "color"?

* Small changes to `Py5Vector` to make it more consistent with Processing's PVector class
* The `create_image_from_numpy()` method now supports `BGR` and `BGRA` color channel ordering

API changes

* The `get()` method has been renamed `get_pixels()` and a new method `set_pixels()` has been added
* The `random_choice()` method has been renamed `random_sample()` and a new implementation of `random_choice()` has been created

New Contributors
* dmorenog01 made their first contribution in https://github.com/py5coding/py5generator/pull/249
* AsadNizami made their first contribution in https://github.com/py5coding/py5generator/pull/251

Bug Fixes
* 195
* 198
* 199
* 200
* 201
* 203
* 207
* 209
* 224
* 229
* 231
* 233
* 234
* 243
* 246
* 247
* 254
* 276

**Full Changelog**: https://github.com/py5coding/py5/compare/py5-1286-0018-0.8.3a1...py5-1292-0019-0.9.0a0

128600180.8.3a1

This is a minor release with a handful of bug fixes and small enhancements. Most of the bug fixes are small improvements to the documentation or error messages. Thanks again to [Alexandre Villares](https://twitter.com/villares) for raising the majority of the now fixed bugs.

Enhancements

* New methods for saving and loading data. The new methods are `load_strings()`, `save_strings()`, `load_bytes()`, `save_bytes()`, `load_pickle()`, and `save_pickle()`
* New `join_thread()` method

Pull Requests

There was one [pull request](https://github.com/py5coding/py5generator/pull/172) from [zztkm](https://github.com/zztkm) to fix the [bug they reported](https://github.com/py5coding/py5generator/discussions/170). Thank you!

Bug fixes

* [ 160](https://github.com/py5coding/py5generator/issues/160)
* [ 163](https://github.com/py5coding/py5generator/issues/163)
* [ 164](https://github.com/py5coding/py5generator/issues/164)
* [ 165](https://github.com/py5coding/py5generator/issues/165)
* [ 171](https://github.com/py5coding/py5generator/issues/171)
* [ 176](https://github.com/py5coding/py5generator/issues/176)
* [ 177](https://github.com/py5coding/py5generator/issues/177)

128600170.8.2a1

Small release with lots of bug fixes. Some of these bugs were important to Thonny users, and I didn't want them to wait for fixes.

* [137](https://github.com/py5coding/py5generator/issues/137)
* [135](https://github.com/py5coding/py5generator/issues/135)
* [130](https://github.com/py5coding/py5generator/issues/130)
* [127](https://github.com/py5coding/py5generator/issues/127)
* [125](https://github.com/py5coding/py5generator/issues/125)
* [119](https://github.com/py5coding/py5generator/issues/119)
* [117](https://github.com/py5coding/py5generator/issues/117)
* [116](https://github.com/py5coding/py5generator/issues/116)
* [114](https://github.com/py5coding/py5generator/issues/114)

128400160.8.1a1

New features:

* Any [valid matplotlib color string](https://matplotlib.org/stable/gallery/color/named_colors.html) is now a valid color to use in py5 (if matplotlib is installed)
* New `hex_color()` method
* New `select_folder()`, `select_input()`, and `select_output()` methods
* Upgraded `random_choice()` method
* New `np_random` property
* New `g` property
* New `next_page()` method for the PDF renderer
* Proper object equality

See the [blog post](https://ixora.io/blog/new-release-081a1/) for more information about this release.

Bug fixes:

* [ 111](https://github.com/py5coding/py5generator/issues/111)
* [ 109](https://github.com/py5coding/py5generator/issues/109)
* [ 107](https://github.com/py5coding/py5generator/issues/107)
* [ 105](https://github.com/py5coding/py5generator/issues/105)
* [ 99](https://github.com/py5coding/py5generator/issues/99)
* [ 91](https://github.com/py5coding/py5generator/issues/91)
* [ 90](https://github.com/py5coding/py5generator/issues/90)
* [ 89](https://github.com/py5coding/py5generator/issues/89)
* [ 87](https://github.com/py5coding/py5generator/issues/87)
* [ 86](https://github.com/py5coding/py5generator/issues/86)
* [ 82](https://github.com/py5coding/py5generator/issues/82)
* [ 76](https://github.com/py5coding/py5generator/issues/76)

128300150.8.0a2

New Features:

* Py5KeyboardEvent and Py5MouseEvent classes
* User-defined event functions such as `mouse_moved()` and `key_pressed()` can take an parameter, and an instance of Py5KeyboardEvent and Py5MouseEvent will be passed when it is called
* New py5jupyter library to contain all of py5's Jupyter functionality
* The Sketch Portal is now interactive

Use of py5 + Jupyter without py5jupyter installed is now deprecated. See the [blog post](https://ixora.io/blog/new-release-080a0/) for more information about this release.

Bug Fixes:
* 74
* 78
* 81

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.