{"id":13725116,"url":"https://github.com/groove-x/pura","last_synced_at":"2025-12-30T01:33:30.244Z","repository":{"id":58671793,"uuid":"206821080","full_name":"groove-x/pura","owner":"groove-x","description":"the little async embedded visualization framework that could (Python)","archived":false,"fork":false,"pushed_at":"2022-05-11T11:20:43.000Z","size":834,"stargazers_count":48,"open_issues_count":0,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-08-04T01:27:05.446Z","etag":null,"topics":["embedded","graphics-framework","python","python-asyncio","python-trio"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/groove-x.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-06T15:17:17.000Z","updated_at":"2024-01-01T19:30:43.000Z","dependencies_parsed_at":"2022-09-05T22:51:30.980Z","dependency_job_id":null,"html_url":"https://github.com/groove-x/pura","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groove-x%2Fpura","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groove-x%2Fpura/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groove-x%2Fpura/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groove-x%2Fpura/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/groove-x","download_url":"https://codeload.github.com/groove-x/pura/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224645223,"owners_count":17346102,"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":["embedded","graphics-framework","python","python-asyncio","python-trio"],"created_at":"2024-08-03T01:02:13.433Z","updated_at":"2025-12-30T01:33:30.211Z","avatar_url":"https://github.com/groove-x.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"[![Build status](https://img.shields.io/circleci/build/github/groove-x/pura)](https://circleci.com/gh/groove-x/pura)\n\n# pura - the little async embedded visualization framework that could\n\nPura is a framework enabling remote, always-available graphical and command\nline views for developers to understand, inspect, and modify their\nasync app while it's running.\n\nDuring development, it's productive to have visualizations that let\nyou see and alter the internal state of your program.  Pura lets\nyou create these easily alongside your regular code, and view them\nremotely from a web browser.  This is especially handy for apps that\ndon't otherwise have a GUI, or run on a device lacking a display.\n\nVisualizations:\n * apps can register one or more animated graphical views\n * views are coded using a subset of the [Processing API](https://py.processing.org/reference/)\n * views can be observed over HTTP by one or more browser clients\n * views have no overhead unless there is a remote client specifically observing it\n * keyboard and mouse input is supported\n\nRead-eval-print loop:\n * apps can register a REPL exposing a specific namespace\n * REPL instances can be created remotely over HTTP by one or more browser clients\n * the REPL is available while your program is running\n * tab completion is supported\n\nAsync makes inspection of a running program possible due to the nature of\ncooperative multitasking:  tasks yield only when at a good stopping point.\nThus, when a visualization is generated, or a REPL statement evaluated,  the\nprogram is likely to be in a coherent state honoring its invariants.\n\nThe example in action:\n\n![Demo video](docs/pura_demo.gif)\n\n## Installation\n\n```shell\ngit clone https://github.com/groove-x/pura.git\ncd pura\npip install -e .\n```\n\nIf you use Trio rather than asyncio:\n```shell\npip install -e .[trio]\n```\n\n## Run the examples\n\n```\npython examples/web_view_example.py\n```\nThen connect at http://localhost:8080/\n\n```\npython examples/web_repl_example.py\n```\nThen connect at http://localhost:8080/repl\n\nThe examples use asyncio by default.  For Trio, use `--async-backend trio`.\n\n## Using pura in your own project\n\nPura requires that your program be fully async (either asyncio or Trio).\nIn other words, the main thread should not be blocked by I/O or computation for\nany length of time.\n\nAdd visualizations to your program by inheriting from `WebViewMixin`\nand implementing the `draw()` method.\n\nAt the top level of your program, launch the web view server and\nregister your class instances.\n\n```python\nimport asyncio\nfrom pura import WebViewMixin, WebViewServer\n\nclass Foo(WebViewMixin):\n    def __init__(self):\n        super().__init__(webview_size=(320, 240))\n\n    def draw(self, ctx):\n        ctx.background(0)\n        ctx.line(0, 0, ctx.width, ctx.height)\n        ...\n\n...\n\nfoo = Foo()\nserver = WebViewServer()\nawait asyncio.gather(\n    server.serve(\"Web view server\", \"localhost\", 8080),\n    foo.webview.serve(server))\n```\n\nSee the project [`examples/`](examples/) directory, as well as help\ndocumentation on the `pura` package and individual classes.\n\n## Disclaimer\n\nPura is intended to be used over a\ntrusted network to visualize and alter the internal state of a program\nduring development.  The web client is implemented via eval of\nJavaScript received over HTTP from the server.\n\nThis software is not supported by GROOVE X, Inc., and GROOVE X\nspecifically disclaims all warranties as to its quality,\nmerchantability, or fitness for a particular purpose.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgroove-x%2Fpura","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgroove-x%2Fpura","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgroove-x%2Fpura/lists"}