{"id":13605703,"url":"https://github.com/jtpio/ipyp5","last_synced_at":"2025-07-06T17:38:28.760Z","repository":{"id":32790010,"uuid":"124116426","full_name":"jtpio/ipyp5","owner":"jtpio","description":"p5.js Jupyter Widget","archived":false,"fork":false,"pushed_at":"2023-01-04T06:51:10.000Z","size":9174,"stargazers_count":42,"open_issues_count":17,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-29T03:17:14.893Z","etag":null,"topics":["jupyter","jupyter-widget","jupyterlab","jupyterlab-extension"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jtpio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-06T17:50:12.000Z","updated_at":"2025-06-03T07:35:56.000Z","dependencies_parsed_at":"2023-01-14T22:15:25.866Z","dependency_job_id":null,"html_url":"https://github.com/jtpio/ipyp5","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jtpio/ipyp5","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtpio%2Fipyp5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtpio%2Fipyp5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtpio%2Fipyp5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtpio%2Fipyp5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jtpio","download_url":"https://codeload.github.com/jtpio/ipyp5/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtpio%2Fipyp5/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263943729,"owners_count":23533641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jupyter","jupyter-widget","jupyterlab","jupyterlab-extension"],"created_at":"2024-08-01T19:01:01.793Z","updated_at":"2025-07-06T17:38:28.743Z","avatar_url":"https://github.com/jtpio.png","language":"Python","funding_links":[],"categories":["交互式小部件和可视化"],"sub_categories":[],"readme":"ipyp5\n====\n\n[![Build Status](https://travis-ci.org/jtpio/ipyp5.svg?branch=master)](https://travis-ci.org/jtpio/ipyp5)\n[![Documentation Status](https://readthedocs.org/projects/ipyp5/badge/?version=latest)](http://ipyp5.readthedocs.io/en/latest)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n[![pypi](https://img.shields.io/pypi/v/ipyp5.svg)](https://pypi.python.org/pypi/ipyp5)\n[![Python Versions](https://img.shields.io/pypi/pyversions/ipyp5.svg)](https://pypi.python.org/pypi/ipyp5)\n[![License](https://img.shields.io/pypi/l/ipyp5.svg)](https://pypi.python.org/pypi/ipyp5)\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jtpio/ipyp5/stable?urlpath=lab%2Ftree%2Fexamples%2Fintroduction.ipynb)\n\n:warning: **Disclaimer: this is a work in progress!** :warning:\n\n[p5.js](https://p5js.org) in the Jupyter Notebook using the Jupyter Widgets.\n\nThis project aims to be a follow-up of [p5-jupyter-notebook](https://github.com/jtpio/p5-jupyter-notebook), so that p5 can be used in JupyterLab (and in the classic Notebook) as a proper package.\n\n## Current Status\n\n![screencast](./docs/screencast.gif)\n\n- Define a sketch using the [instance mode of p5](https://github.com/processing/p5.js/wiki/Global-and-instance-mode). This explains the use of `p` in the sample sketch.\n- The sketch is synced to the widget as a raw string and evaluated on the frontend.\n\n## TODO\n\n- Figure out how to expose a Python wrapper to the p5 API\n- How to avoid round trips to the server (syncing of values) when making animations (updating values at every frame)?\n- Proper testing, packaging and documentation once the problems above are solved\n\n\n### Goal\n\nThe **ideal goal** (disclaimer: not implemented yet) would be to write code like this in a notebook cell:\n\n```python\nclass MySketch(BaseSketch):\n    W, H = 400, 400\n\n    def setup(s):\n        s.createCanvas(s.W, s.H)\n        s.rectMode(s.CENTER)\n\n    def draw(s):\n        s.background('#ddd')\n        s.translate(200, 200)\n        for i in range(4):\n            s.push()\n            s.rotate(s.frameCount / 200 * (i + 1))\n            s.fill(i * 5, i * 100, i * 150)\n            s.rect(0, 0, 200, 200)\n            s.pop()\n\nsketch = MySketch()\nsketch\n```\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtpio%2Fipyp5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjtpio%2Fipyp5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtpio%2Fipyp5/lists"}