p5 is a Python package based on the core ideas of Processing.

Overview

p5

License Version Slack SanityTests Pylint Pytest

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.

To report a bug / make a feature request use the issues page in this repository. You can also use the discourse platform to ask/discuss anything related to p5py.

Example

https://github.com/p5py/p5/raw/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()

Documentation

The p5py documentation can be found here p5 documentation

Installation

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

Contributing

We welcome contributions from anyone, even if you are new to open source. You can start by fixing the existing issues in p5py. In case you need any help or support from the p5py development community, you can join our slack group.

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.

Comments
  • IO module in p5py

    IO module in p5py

    Is your feature request related to a problem? Please describe. Yes, P5py currently doesn't have an IO module. I would like to work with live data/APIs/serial-input from my python processing sketch.

    Describe the solution you'd like I would like functions in sync with IO module of p5.js so that new users coming to p5py from p5.js do not face any difficulty.

    Describe alternatives you've considered Requests library can be used to perform GET/POST requests.

    Additional context I understand that most of these issues could be resolved through the requests library, thus if possible the IO module could also contain serial input (via USB) etc.

    I would be interested to work on this project.

    opened by nakul-shahdadpuri 24
  • push_matrix() and pop_matrix() not working

    push_matrix() and pop_matrix() not working

    using pop_matrix() does not restore the transform matrix to the previous state. I tried using the exact codes mentioned in your documentation : https://p5.readthedocs.io/_/downloads/en/latest/pdf/.

    from p5 import * def setup(): size(200, 200) def draw(): background(255) fill(192) no_stroke() rect((40, 40), 40, 40) push_matrix() translate(40, 40) rotate(radians(45)) fill(0) rect((40, 40), 40, 40) pop_matrix() if name == 'main': run()

    The following code clearly depicts the error

    opened by tyagi619 24
  • Sketch window stops refreshing on Mac.

    Sketch window stops refreshing on Mac.

    Test Script: p5-examples/basics/math/sine.py. The bug affects all sketches.

    Expected behavior: sine-correct

    Actual behavior The sketch window stops refreshing after a couple of frames are drawn when a newer version of Pyglet (1.3b) is installed.

    sine

    Errors produced (if any): None

    p5 version: 2b96dfc1d2126867e70bc727d0cc7ffc5da8eabc

    Python version: 3.6 Operating System: Mac OS

    bug help-wanted platform-mac priority-high 
    opened by abhikpal 22
  • Bug: Does not install or get the shaders directory

    Bug: Does not install or get the shaders directory

    Describe the bug I forked the repo and downloaded it. I renamed the main directory to main where code is not located so that the main and the local library do not clash.

    To Reproduce Just download and run the repo with the original p5 version installed from pip

    Expected behavior Should work as the folder was renamed so it should not clash.

    bug 
    opened by Andy-Python-Programmer 19
  • metadata-generation-failed

    metadata-generation-failed

    Describe the bug Error when generating metadata on this step(Preparing metadata (pyproject.toml) did not run successfully.)

    To Reproduce Steps to reproduce the behavior (if applicable)

    Expected behavior A clear and concise description of what you expected to happen.

    Screenshots image

    System information:

    • p5 release (version number or latest commit): latest version
    • Python versions: 3.10 and 3.9
    • Operating system: windows 10 x64

    Additional context Add any other context about the problem here.

    opened by osama1998H 18
  • formatted the whole code with autopep8

    formatted the whole code with autopep8

    Related to #255

    No merge conflicts and only python files are formatted, .rst and md files are not affected.

    Command ran :

    find . -name '*.py' -exec autopep8 --in-place --aggressive '{}' \;
    
    opened by tushar5526 16
  • The quest for better tessellation

    The quest for better tessellation

    This issue attempts to explore some of the options for

    1. Improving tessellation/triangulation performance
    2. Support tessellation/triangulation in 3D

    Current implementation in p5py

    The existing implementation uses the triangle python module to triangulate shapes before sending them to the GPU. The triangle module is in turn a wrapper around the Triangle C library written by Jonathan Shewchuck that implements the Delaunay triangulation algorithm.

    This site notes that the Triangle Library by Prof. Shewchuck has several deficiencies. In particular,

    1. It does not like duplicate vertices or duplicate edges. 'Duplicate' in this case is relative to numeric precision: For a building 10-100 meters in size, two vertices within 8cm of each other, defining a very short edge, can cause Triangle to crash.
    2. It does not like it when a hole (inner ring) in the polygon has a vertex in the same location as one in the outer ring (crash).

    In fact, the problems mentioned above are rather minor. The biggest problem of all is probably the fact that triangle does not support 3D points.

    Current implementation in Processing and p5.js

    Maybe we can reference the triangulation implementations in other branches of the processing language? Here's what I found:

    For Processing (OpenGL backend), GLU was referenced through the JOGL binding, evidenced by source files PGraphicsOpenGL.java#L10985 and PJOGL.java#L605. Given that we don't have JOGL on Python and GLFW doesn't support GLU, we might have to look for other options.

    For p5.js, tessellation support was achieved via libtess.js, which uses the GLU tessellation algorithm but rewritten in JavaScript (reference).

    Exploring our options

    OpenGL/GLU

    From first glance, using OpenGL is as simple as using the following API:

    gluTessBeginPolygon(tess, user_data);
        gluTessBeginContour(tess);
            gluTessVertex(tess, coords, vertex_data);
            ...
            gluTessVertex(tess, coords_n, vertex_data);
        gluTessEndContour(tess);
    gluTessEndPolygon(tess);
    

    (Code example adapted from songho.ca)

    However, further searches indicated that this API is not part of OpenGL core, but part of GLU (OpenGL Utility Library). According to GLFW

    GLU has been deprecated and should not be used in new code.

    So GLFW isn't helpful here.

    I asked the question of how to use GLU bindings on the vispy Gitter chat after not finding anything related to GLU on their documentation. I did get a response from vispy maintainers very quickly. Thank you! However, he confirmed that vispy does not currently support the tessellation API.

    Short answer is no. Long answer: I'm not familiar with the gluTess API specifically, but I'm guessing this has to do with tessellation shaders, right? Currently VisPy does not have any support for tessellation shaders but I think there are PRs trying to add it. In the last year we added support for geometry shaders which really set up the interfaces for adding additional shaders like the tessellation shaders, but so far these have not been added. ---@djhoese

    Given that our current dependencies don't have this functionality, another option is to introduce a new library called PyOpenGL, which offers a wrapper for GLU (in addition to a lot more OpenGL functionality). Since we already have vispy.gloo for making OpenGL calls, we may want to discuss whether it's worth it to introduce another dependency with potentially the same capability as vispy but only use it for tessellation.

    Scipy

    Scipy also has a function that performs the Delaunay triangulation algorithm. Instead of wrapping around Prof. Shewchuck's library, it wraps around Qhull. This supports both 2D and 3D. However, the Qhull website says the library only works with convex hulls, so non-convex objects (e.g. objects with holes created by begin_contour) wouldn't work.

    Moving Forward

    Between scipy and PyOpenGL, I am leaning towards PyOpenGL because it uses the same underlying algorithm as the Processing Language and p5.js while also supporting non-convex shapes. The downside is that it's a rather large library that overlaps in features with vispy. If you have an opinion on this subject, leave a comment down below!

    Roadmap

    Here's my tentative plan to improve tessellation in p5py:

    • [x] Build sample scenes for profiling
    • [x] Profile performance of master branch as baseline
    • [x] Fix obvious performance issues (if any)
    • [x] Replace triangle with PyOpenGL, or another triangulation library
    • [x] Profile again and compare to baseline
    • [x] Implement parts of begin_shape and end_shape that only requires trivial/no triangulation in 3D (i.e. POINTS, LINES, TRIANGLES, TRIANGLE_FAN, TRIANGLE_STRIP, QUADS, and QUAD_STRIP).
    • [x] Implement the complete version of begin_shape and end_shape in 3D (i.e. TESS in addition to the modes mentioned above).
    • [x] (Stretch goal) Implement begin_contour and end_contour in 3D.
    • [x] Document API changes
    enhancement GSoC2020 
    opened by ziyaointl 15
  • AttributeError: module 'p5.core.p5' has no attribute 'exit'

    AttributeError: module 'p5.core.p5' has no attribute 'exit'

    Describe the bug I tried running the sample code in p5 README text in spyder 4, Jupyter Notebook, and external windows terminal. The same error(AttribureError: ...) pops up in the first two. The terminal , however properly executes this code. Please let me know how to fix it. (i find it comfortable to run codes in those environments...) To Reproduce Try running the code in those environments:

    samplep5.txt

    Screenshots The errors i got in the two environments error_jupy.txt : error_spy.txt

    System information:

    • p5 release 0.6.0
    • Python 3.7.6
    • Operating system: Windows 10
    enhancement 
    opened by Gautameshwar 15
  • Add the black formatter GitHub Action

    Add the black formatter GitHub Action

    Is your feature request related to a problem? Please describe. There is a need for a uniform coding style across p5py

    Describe the solution you'd like Add a GitHub action that checks a PR for coding style using black. The GHA should be able to format the code and commit it to the PR if the PR is not following the coding style.

    good-first-issue 
    opened by tushar5526 14
  • Fixes #158 Fixed the issue where no_loop() was drawing another extra …

    Fixes #158 Fixed the issue where no_loop() was drawing another extra …

    …frame when used in draw()

    Now no_loop() checks from where it is being called and draws another frame if it is called from setup() and dont call another frame when called in draw()

    Closes #158 properly

    The earlier PR of mine is causing a problem if we call no_loop() in setup() method, things are coded in a way to draw another frame when we use no_loop(), so if there is a no_loop() present in draw() , first draw() is called initially the no_loop() is encountered, but no_loop() is set in a way so that it calls exactly one another frame, hence we are getting the bug mentioned in this issue

    no_loop() was made to draw another loop because, if no_loop() is present in setup(), then first setup() is called, which calls no_loop(), no_loop() do not let the draw() function get called in the next the next iteration(hence nothing would be drawn after that) that's why the developer made a check that no_loop() will draw one more frame so if no_loop() is present in setup() things will work properly

    Possible fixes for this bug and the problem I mentioned is, if no_loop() was called from setup() then we call draw() in other iteration , and if it is called in draw(), then we dont call another draw_loop() in the next iteration, or better let this bug be there !

    I have tested this approach and tested it with the current bugs plus also with redraw() function and checked frame_count to be correct, but you may test it again in some other way :

    Things to test

    • no_loop() in setup() -no_loop() in draw() -redraw() -checking whether frame_count is correct after each frame is drawn
    opened by tushar5526 13
  • Interactivity Tutorials The key variable stores example raise ValueError(

    Interactivity Tutorials The key variable stores example raise ValueError("text_size is nor supported for Bitmap Fonts")

    Describe the bug The following example, within the Interactivity tutorials when running, the following error occurs

    In the Interactivity Tutorial in Keyboard data section the next example

    from p5 import *
    
    def setup():
        size(100, 100)
        text_size(60)
    
    def draw():
        background(0)
        text(key, 20, 75) # Draw at coordinate (20,75)
    
    if __name__ == '__main__':
        run()
    

    when run shows the fallowing error:
    raise ValueError("text_size is nor supported for Bitmap Fonts")

    To Reproduce Just copy and paste the example in a text editor and run the script

    Expected behavior Should show in the window the key pressed in a specify size

    Screenshots p5 error

    System information:

    • p5 release (0.6.0):
    • Python version: 3.7.4
    • Operating system: Windows 10

    Additional context Changing the script to

    from p5 import *
    
    
    def setup():
        size(150, 150)
       # text_size(60) need to comment this line
    
    
    def draw():
        background(0)
        text(str(key), (20, 75))  # add str() to key
    
    run()
    

    Give me the next result:

    p5 error 2

    Key NOT pressed:

    key_not_pressed

    Key pressed: key_pressed

    So as you can see, a get a similar behavior expected from the example with this changes, but I don't know if this is a real fix or its something else under the hood

    font 
    opened by edurojasr 13
  • Depending on WebGL

    Depending on WebGL

    Hey folks, I know nothing about GL technologies, but I wrote an app to run processing on the web with python using pyscript: elektrasdream.com And I thought it'd be better to use a proper implementation of p5js rather than a mix of js (p5js) and python, which is what I have right now. So that's why I'm reaching out: I'm wondering how hard it'd be to depend on WebGL instead of GLFW and if it's easy/possible/someone does the job would we lose a lot of features? Cheers and thanks,

    opened by marimeireles 1
  • Fix#362 : Fixed order of GHAs

    Fix#362 : Fixed order of GHAs

    Related to #362 .

    Hey @tushar5526 @ziyaointl ! I have restructured the build tests and compiled all of them into one singe GHA.Can you test this?

    Explaination of changes: added a needs parameter in every job connecting it with the previous job.

    opened by RyanWalker277 0
  • Feature request: Conda package

    Feature request: Conda package

    I see many projects that have "non-python" dependencies, like is the case of GLFW for p5py, to use Anaconda/miniconda as an install option, as it is able to install more stuff in your system, in a single step.

    Have you considered having a conda package?

    good-first-issue 
    opened by villares 3
  • Question: Shouldn't `pip install p5py` get you PyOpenGL?

    Question: Shouldn't `pip install p5py` get you PyOpenGL?

    I have the impression that after pip install p5py I didn't get PyOpenGL.

    So I did install PyOpenGL and everything worked. Was this a fluke, or something on my system? If this is not a mirage, if this is by design, could it be changed so that installation for beginners is easier?

    I'm using Manjaro Linux.

    opened by villares 1
  • Error while installing p5

    Error while installing p5

    Describe the bug when I try to install this library viapip install p5 I get an error about Pillow installation failure, but I already have the latest version of Pillow installed To Reproduce run pip install p5

    Expected behavior p5 will install normally

    Screenshots image image image

    System information:

    • p5 release (version number or latest commit): 0.8.1
    • Python version: 3.11
    • Operating system: Windows 10 x64

    Additional context none

    opened by maksim10411072 2
  • Error running only with renderer as Skia

    Error running only with renderer as Skia

    My installation works fine with vispy but fails wih Skia.

    Traceback (most recent call last):
      File "test.py", line 96, in <module>
        run(renderer="skia")
      File "/Users/mahdi/.local/lib/python3.8/site-packages/p5/sketch/userspace.py", line 231, in run
        p5.sketch.start()
      File "/Users/mahdi/.local/lib/python3.8/site-packages/p5/sketch/Skia2DRenderer/base.py", line 156, in start
        self.window = self.glfw_window()
      File "/Users/mahdi/.local/lib/python3.8/site-packages/p5/sketch/Skia2DRenderer/base.py", line 76, in glfw_window
        if not glfw.init():
      File "/Users/mahdi/.local/lib/python3.8/site-packages/glfw/__init__.py", line 714, in init
        res = _glfw.glfwInit()
      File "/Users/mahdi/.local/lib/python3.8/site-packages/glfw/__init__.py", line 616, in errcheck
        _reraise(exc[1], exc[2])
      File "/Users/mahdi/.local/lib/python3.8/site-packages/glfw/__init__.py", line 52, in _reraise
        raise exception.with_traceback(traceback)
      File "/Users/mahdi/.local/lib/python3.8/site-packages/glfw/__init__.py", line 595, in callback_wrapper
        return func(*args, **kwargs)
      File "/Users/mahdi/.local/lib/python3.8/site-packages/glfw/__init__.py", line 808, in _handle_glfw_errors
        raise GLFWError(message)
    glfw.GLFWError: (65544) b'Cocoa: Failed to find service port for display'
    

    Not sure where to start troubleshooting this. Any suggestions would be greatly appreciated

    opened by mahdi-b 2
Releases(v0.8.1)
  • v0.8.1(Nov 15, 2022)

    v0.8.1

    We are happy to announce the final developmental release under the summer fellowship at The Processing Foundation The project was supervised by Mark Zhang. This release adds on to the experimental 2D renderer using Skia.

    New Features

    Typography support for skia #371

    - p5py now support all types of fonts as found in other processing ports
    - 5x efficiency in font sketches as compared to vispy renderer
    

    Image APIs for "skia" #344

    Support for Offscreen buffers #386

    - create_grahpics is now available in p5py's skia renderer
    

    Support for python 3.10 #395

    - Please see the attached note below
    

    This release includes contributions from @tushar5526, @ziyaointl, and @Mr-Sunglasses, Thank you!

    PS: There are a lot of good open issues that currently need help and we would love your contributions!

    NOTE

    pyopengl-accelarate is omitted from the requirements.txt temporarily. See #397 for more information about this. If you are looking for better 3D performance you can install it from the requirements.txt file.

    benchmark | with pyopengl-accelerate | without pyopengl-accelerate | change -- | -- | -- | -- arcs | 8.944169 | 9.764988 | 9.18% arm | 2.612446 | 2.611884 | -0.02% basic_shapes | 2.629553 | 2.688781 | 2.25% begin_contour | 2.684205 | 2.711441 | 1.01% curves | 4.766132 | 4.962305 | 4.12% custom_shapes | 4.643741 | 4.754362 | 2.38% custom_shapes2 | 3.75905 | 3.791483 | 0.86% point_demo | 2.880713 | 2.939999 | 2.06% primitives | 3.651718 | 3.717032 | 1.79% spinning-cone_p3d | 9.417307 | 9.437273 | 0.21% tetrahedron_p3d | 8.114283 | 8.203861 | 1.10% triangle_strip | 3.228278 | 3.228012 | -0.01% world_p3d | 26.883501 | 26.991062 | 0.40%

    Source code(tar.gz)
    Source code(zip)
  • v0.8.0(Aug 4, 2022)

    v0.8.0

    We are happy to announce another developmental release under the summer fellowship at The Processing Foundation. The project was supervised by Mark Zhang. This release comes with an experimental 2D renderer using Skia. The skia 2D renderer shows significant improvements in both rendering and efficiency of the sketches.

    You can use the new 2D renderer by using the renderer argument in run function run(renderer='skia')

    Bug Fixes

    • #276
    • #311
    • #308
    • #309
    • #355
    • #352

    New Features

    • Along with the snake_case convention we support the camelCase convention for most Processing APIs #280
    • New experimental 2D renderer "skia" #344. Skia currently does not support typography and Image APIs, they will be implemented in further releases.

    List of New APIs

    • frame_rate{.interpreted-text role="any"} sets frame rate for a sketch (only for skia)
    • rect{.interpreted-text role="any"} now supports border radius (only for skia)
    • CORNERS{.interpreted-text role="any"} CORNERS mode added (only for skia)
    • focussed{.interpreted-text role="any"} holds whether the current window is in focus or not (only for skia)

    All the API previously present are supported as well in skia.

    Here are some profiling results comparing the time taken to draw 100 frames for different sketches

    | Name | Skia | Vispy | |-----------------|--------|--------| | arcs | 2.11s | 10.06s | | custom_shapes | 1.84s | 5.00s | | triangle_strip | 2.55s | 3.33s | | curves | 1.76s | 5.41s | | primitives | 1.73s | 3.9s |

    This release includes contributions from @tushar5526, @niklasr22, @ziyaointl, @nakul-shahdadpuri, @andreasWallner, @janbehrens, @yogeshhk, @cuppajoeman, @willtryagain, @parsoyaarihant, @Kartik-byte, @Andy-Python-Programmer, @Mr-Sunglasses Thank you!

    Source code(tar.gz)
    Source code(zip)
  • v0.7.1(Sep 2, 2020)

    We are happy to announce another developmental release from Google Summer of Code 2020! This is the final release for GSOC this year and includes API refactors, additions, and bug fixes with compatibility and stability as foci.

    List of New APIs

    • fract calculates the fractional part of a number. Contributed by @tushar5526
    • http_get and http_post makes HTTP requests to the web. Contrbuted by @nakul-shahdadpuri
    • pop_matrix and pop_style are alternatives to the context manager syntax used by previous version. Accordingly, push_matrix and pop_matrix can now both act as context managers and be directly called like in Processing or p5.js

    The following additional signatures are added for compatibility with other Processing dialects

    • line(x1, y1, x2, y2)
    • line(x1, y1, z1, x2, y2, z2)
    • ellipse(a, b, c, d, mode=None)
    • circle(x, y, radius, mode=None)
    • arc(x, y, width, height, start_angle, stop_angle, mode=None, ellipse_mode=None)
    • image(img, x, y)
    • image(img, x, y, w, h)
    • triangle(x1, y1, x2, y2, x3, y3)
    • quad(x1, y1, x2, y2, x3, y3, x4, y4)
    • rect(x, y, w, h)
    • square(x, y, side_length)
    • bezier(x1, y1, x2, y2, x3, y3, x4, y4)
    • bezier(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4)
    • curve(x1, y1, x2, y2, x3, y3, x4, y4)
    • curve(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4)
    • camera(position_x, position_y, position_z, target_x, target_y, target_z, up_x, up_y, up_z)
    • camera(position, target_position, up_vector)
    • text(text_string, x, y)
    • text(text_string, x, y, z)

    The following functions can now take floats and tuples of arbitrary length

    • bezier_point
    • bezier_tangent
    • curve_point
    • curve_tangent
    • quadratic_point

    List of issues fixed in this release

    • #186 begin_shape('POINTS') does not draw points
    • #161 Cant use stroke_weight for points
    • #238 Point shape causing concatenate error
    • #171 Add support for pop syntax

    This release includes contributions from @nakul-shahdadpuri, @tushar5526, and @parsoyaarihant. Thank you!

    Source code(tar.gz)
    Source code(zip)
  • v0.7.0(Aug 30, 2020)

    We are happy to announce another developmental release from Google Summer of Code! This release includes bug fixes, a refactored rendering pipeline with improved performance, new 3D capabilities, and new example code.

    List of New APIs

    • New materials in P3D
      • normal_material assigns a color to a pixel solely based on the normal vector of the fragment being rendered. Useful for debugging
      • basic_material returns a uniform color.
      • blinn_phong_material is a material based on the Blinn-Phong reflection model. This is the most “realistic” material in p5py. Parameters to adjust it include
        • ambient is the color that interacts with ambient_lights
        • diffuse/emissive is the surface color that interacts with point_lights and directional_lights
        • specular is the highlight color that interacts with point_lights and directional_lights
        • shininess determines how glossy a surface is
    • Lighting system in P3D
      • lights creates default lights
      • ambient_light is a light that's uniform everywhere
      • directional_light comes from one direction: it is stronger when hitting a surface squarely, and weaker if it hits at a gentle angle.
      • point_light comes from one location and emits to all directions.
      • light_specular controls the color of the specular highlight
      • light_falloff controls how fast a light fades with distance

    List of issues fixed in this release

    • #31 Implement saveFrame()
    • #155 Output canvas to video or sequence of png's
    • #156 push_matrix() and pop_matrix() not working
    • #158 no_loop incorrectly allows an extra draw frame
    • #172 begin_contour and end_contour not working
    • #175 no_loop() when used in setup() don't call draw() but it should call draw() only once
    • #152 Occlusion of shapes in 3D Mode
    • #180 Tutorial wrong? pop_matrix() does nothing, but should be refered as reset_matrix() instead
    • #167 end_shape() is closing shapes without 'CLOSE'
    • #188 Inconsistent behavior for Arc
    • #195 Not able to create holes in a shape using begin and end contour
    • #201 remap map to remap
    • #141 AttributeError: 'Geometry' object has no attribute 'children'
    • #173 The quest for better tessellation
    • #183 Scalling with scale(1,0) does nothing. but scale(0,1) works
    • #217 Bug: Does not install or get the shaders directory
    • #213 Add support for renderer attribute in run() function
    • #222 Update installation scripts
    • #174 Add 3D material and lighting APIs
    • #66 VS Code + pylint integration with p5

    This release also includes contributions from @parsoyaarihant, @jeremydouglass, @tushar5526, @Hansimov, @ReneTC, @Andy-Python-Programmer, and @galaxyproduction. Thank you!

    Source code(tar.gz)
    Source code(zip)
  • v0.6.0(Apr 8, 2020)

    We're happy to announce a developmental release from this Google Summer of Code 2019 project! This release includes addition of new APIs. In addition to the new APIs, many examples and tutorials are added for p5 modules (the details can be found on the p5 documentation website).

    List of new APIs

    • Typography methods p5.text_align, p5.text_leading and p5.text_size allows the user to control different position and size attributes of the text. Methods p5.text_ascent, p5.text_descent and p5.text_width can be used to obtain different dimensional attributes of text.

    • p5.load_shape function allows the user to load an SVG file which can be rendered on the screen. The SVG shape is converted into PShape primitives and rendered on the screen using p5.shape method.

    • The methods p5.begin_shape and p5.end_shape can be used to make custom shapes defined by different vertex types (p5.vertex, p5.curve_vertex, p5.bezier_vertex, p5.quadratic_vertex). Contours inside a shape can also be created using p5.begin_contour and p5.end_contour methods.

    • Stroke methods allows the user to control the stroke width and styles:

      • p5.stroke_weight: allows for specifying the width of stroke
      • p5.stroke_cap: allows the user to set the style of line endings
      • p5.stroke_join: allows the user to set the style of joints which connect the line segments
    • This release introduces limited 3D support. New functions for :

      • The p5.camera allows for specifying the camera coordinates in 3D space
      • The projection functions p5.ortho and p5.perspective allow the user to control the type of projection system being used to render 3D objects on the screen
      • New 3D shape primitives are added: p5.box, p5.plane, p5.sphere, p5.ellipsoid, p5.cylinder, p5.cone, p5.torus

    List of issues fixed in this release

    • #129 millis() does not go beyond 1 second and gives microseconds()
    • #114 Rectangle not overlaying on line correctly
    • #91 Arc does not render correctly with transparency
    • #90 arc outline shows up as line in corner of window

    This release also includes contributions from @edurojasr, @abhikpal and @jeremydouglass. Thanks :)

    Source code(tar.gz)
    Source code(zip)
    p5-0.6.0.tar.gz(56.13 KB)
    p5-0.6.0.zip(112.04 KB)
  • v0.5.0(Apr 14, 2020)

    p5 version 0.5.0 is the final release for the Google Summer of Code 2018 project by Abhik Pal The project was supervised by Manindra Mohrarna of the Processing Foundation. The goal of the project were:

    1. Move the internal windowing and OpenGL framework to vispy
    2. Add support for user defined polygons
    3. Add image support

    We met all of these goals completely. The first was covered by a release from earlier in the summer. These release notes summarize our later two goals. In addition to the stated goals we were also able to add minimal typography support and port some tutorials from Processing to p5:

    • Color by Daniel Shiffman
    • Vectors by Daniel Shiffman
    • Electronics by Hernando Berragán and Casey Reas

    API Additions

    • The p5.PShape class is equivalent to PShape in Processing. This allows creation of arbitrary user defined polygons that can have their own style (fill, stroke, etc) and transform (rotation, translation) attributes.

    • The p5.PImage class allows for manipulating images in p5. Most of the API is similar to that of Processing's. Each image object "pretends" to be a 2D array and hence operations for cropping, copying, and pasting data can have implemented as indexing operations on the image. For instance, given some image img with dimensions 800 × 600, img[400:, :300] gives a new image with the required region. Individual pixels can be set / read as p5.Color objects though indices into the image. The class also includes functionality to apply filters and blend two images together.

    • The p5.load_image and p5.image function allow, respectively, loading and displaying images on the screen.

    • The p5.image_mode function controls how parameters to p5.image are interpreted.

    • p5.tint and the related p5.no_tint function allow for setting and disabling tinting of images that are drawn on the screen.

    • The p5.load_pixels context manager loads the current display as a global pixels PImage object. This combines functionality of Processing's loadPixels() and updatePixels().

    • p5.save and p5.save_frame methods allow users to either save the current state of the sketch or the final rendered frame as an image.

    • This release also introduces some basic typography functions like p5.text for displaying text on screen. The p5.load_font and p5.create_font allow loading font files to change the display typeface using text_font. As of now, only TrueType (ttf) and bitmap fonts are sup

    Source code(tar.gz)
    Source code(zip)
  • v0.4.0a1.dev2(Jul 18, 2018)

    We're happy to announce a developmental release from this year's Google Summer of Code project! While we haven't changed the public API much, the whole backend has been re-written to use vispy. This has allowed us to remove many platform specific issues. In particular, this release closes the following pending issues and pull requests:

    • #10: Sketch window stops refreshing on Mac.
    • #15: Blank sketch window on Mac
    • #16: Mouse_x and mouse_y returning negative values
    • #17: Set range limit on mouse_x and mouse_y values
    • #18: matmul operator doesn't work on Python 3.4 and less.
    • #22: Replaced @ with np.dot()
    • #23: Tuple unpacking incompatible with Python 3.4 and less.
    • #35: Removed pyglet.window.get_platform()
    • #36: Fixed distance() of class Vector by adding np.sqrt
    • #37: raise an error, when Vector.normalize() tries to normalize a "zero-vector"
    • #38: raise ValueError when Magnitude of Vector is 0
    • #39: background() inside setup() behaves strangely
    • #40: fix bug #23: Tuple unpacking incompatible with Python 3.4 and less
    • #41: matmul operator on Python version <= 3.4 (rel: #18)
    • #47: key variable not working
    • #49: Fix retina issues on the mac.
    • #50: #49 breaks the documentation auto generation
    • #9: Sketch does not cover the entire window on retina displays.

    This release also includes contributions from @parsoyaarihant, @Devrim-Celik, @hx2A, and @antiboredom. Thank you : )

    Head over to the installation page for getting started with the new p5 version! The documentation is hosted on p5.rtfd.io and we have many example sketches in a separate repository.

    We're excited to hear what you have to say!

    Source code(tar.gz)
    Source code(zip)
  • v0.3.0a1(Aug 20, 2017)

    People,

    We've been working for the last twelve or so weeks to get most of the internal plumbing done and expose an API that people can start playing around with. And today we're happy to announce the first alpha release of p5 :tada:

    As of this release, we have support for:

    • Running basic p5 sketches.
    • An interface to events and event handlers.
    • Drawing 2D shapes.
    • Full support for parsing and using colors (except support for using hex-codes)
    • Full support for all utility functions for math, vectors, etc.

    Links to help you get started:

    Mac users might face some issues getting the sketches to run. We haven't been able to consistently reproduce the issues, but please take a look at issue #9 and issue #10 .

    Meanwhile, as we write more documentation, fix bugs, and port tutorials from Processing, we would love to know what you think! Couple of ways you can reach out to us:

    p5 started off as a Google Summer of Code project and even though the official coding period will end in little less than a week, development on p5 will continue. Feedback, contributions, and criticism are more than welcome :)

    Source code(tar.gz)
    Source code(zip)
  • v0.1.0dev4(Jul 19, 2017)

Owner
p5py
p5py
A place where one-off ideas/partial projects can live comfortably

A place to post ideas, partial projects, or anything else that doesn't necessarily warrant its own repo, from my mind to the web.

Carson Scott 2 Feb 25, 2022
An Airflow operator to call the main function from the dbt-core Python package

airflow-dbt-python An Airflow operator to call the main function from the dbt-core Python package Motivation Airflow running in a managed environment

Tomás Farías Santana 93 Jan 8, 2023
Python module to work with Magneto Database directly without using broken Magento 2 core

Python module to work with Magneto Database directly without using broken Magento 2 core

Egor Shitikov 13 Nov 10, 2022
Cross-platform .NET Core pre-commit hooks

dotnet-core-pre-commit Cross-platform .NET Core pre-commit hooks How to use Add this to your .pre-commit-config.yaml - repo: https://github.com/juan

Juan Odicio 5 Jul 20, 2021
TMTC Commander Core

This commander application was first developed by KSat for the SOURCE project to test the on-board software but has evolved into a more generic tool for satellite developers to perform TMTC (Telemetry and Telecommand) handling and testing via different communication interfaces.

robamu 8 Dec 14, 2022
An alternative app for core Armoury Crate functions.

NoROG DISCLAIMER: Use at your own risk. This is alpha-quality software. It has not been extensively tested, though I personally run it daily on my lap

null 12 Nov 29, 2022
MuMMI Core is the underlying infrastructure and generalizable component of the MuMMI framework

MuMMI Core is the underlying infrastructure and generalizable component of the MuMMI framework, which facilitates the coordination of massively parallel multiscale simulations.

null 4 Aug 17, 2022
This repository holds those infrastructure-level modules, that every application requires that follows the core 12-factor principles.

py-12f-common About This repository holds those infrastructure-level modules, that every application requires that follows the core 12-factor principl

Tamás Benke 1 Dec 15, 2022
This is the core of the program which takes 5k SYMBOLS and looks back N years to pull in the daily OHLC data of those symbols and saves them to disc.

This is the core of the program which takes 5k SYMBOLS and looks back N years to pull in the daily OHLC data of those symbols and saves them to disc.

Daniel Caine 1 Jan 31, 2022
A test repository to build a python package and publish the package to Artifact Registry using GCB

A test repository to build a python package and publish the package to Artifact Registry using GCB. Then have the package be a dependency in a GCF function.

null 1 Feb 9, 2022
A Python Based Utility for Processing GST-Return JSON Files to Multiple Formats

GSTR 1/2A Utility by Shan.tk Open Source GSTR 1/GSTR 2A JSON to Excel utility based on Python. Useful for Auditors in Verifying GSTR 1 Return Invoices

Sudharshan TK 1 Oct 8, 2022
This project recreates the R-based RCy3 Cytoscape Automation library as a Python package.

Python library for calling Cytoscape Automation via CyREST

Cytoscape Consortium 40 Dec 22, 2022
Unofficial package for fetching users information based on National ID Number (Tanzania)

Nida Unofficial package for fetching users information based on National ID Number made by kalebu Installation You can install it directly or using pi

Jordan Kalebu 57 Dec 28, 2022
This is an example manipulation package of for a robot manipulator based on Drake with ROS2.

This is an example manipulation package of for a robot manipulator based on Drake with ROS2.

Sotaro Katayama 1 Oct 21, 2021
Framework for creating efficient data processing pipelines

Aqueduct Framework for creating efficient data processing pipelines. Contact Feel free to ask questions in telegram t.me/avito-ml Key Features Increas

avito.tech 137 Dec 29, 2022
Tools for downloading and processing numerical weather predictions

NWP Tools for downloading and processing numerical weather predictions At the moment, this code is focused on downloading historical UKV NWPs produced

Open Climate Fix 6 Nov 24, 2022
Project5 Data processing system

Project5-Data-processing-system User just needed to copy both these file to a folder and open Project5.py using cmd or using any python ide. It is to

null 1 Nov 23, 2021
Small Arrow Vortex clipboard processing library

Description Small Arrow Vortex clipboard processing library. Install You can install this library from PyPI with pip install av-clipboard-lib or compi

Delta Epsilon 1 Dec 18, 2021
Semester Project on Signal Processing @CS UCU 2021

Blur Detection with Haar Wavelet Transform Requirements Python3 opencv-python PyWavelets Install these using the following command: $ pip install -r r

ButynetsD 2 Oct 15, 2022