{"id":13498867,"url":"https://github.com/manzt/anywidget","last_synced_at":"2025-05-14T04:07:59.767Z","repository":{"id":65426836,"uuid":"557583774","full_name":"manzt/anywidget","owner":"manzt","description":"reusable widgets made easy","archived":false,"fork":false,"pushed_at":"2025-04-28T17:49:41.000Z","size":13722,"stargazers_count":638,"open_issues_count":17,"forks_count":47,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-05-01T14:48:52.162Z","etag":null,"topics":["jupyter","python","widgets"],"latest_commit_sha":null,"homepage":"https://anywidget.dev","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/manzt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-10-26T00:06:32.000Z","updated_at":"2025-04-28T12:06:47.000Z","dependencies_parsed_at":"2024-01-16T09:57:34.908Z","dependency_job_id":"088e9f35-2c05-494f-b8fc-e0ac802e7a6f","html_url":"https://github.com/manzt/anywidget","commit_stats":{"total_commits":630,"total_committers":24,"mean_commits":26.25,"dds":0.4650793650793651,"last_synced_commit":"e6a2c13f292002681ab5610e350d1cd655840871"},"previous_names":[],"tags_count":133,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manzt%2Fanywidget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manzt%2Fanywidget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manzt%2Fanywidget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manzt%2Fanywidget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manzt","download_url":"https://codeload.github.com/manzt/anywidget/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254064131,"owners_count":22008514,"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","python","widgets"],"created_at":"2024-07-31T21:00:45.988Z","updated_at":"2025-05-14T04:07:59.742Z","avatar_url":"https://github.com/manzt.png","language":"Python","readme":"\u003ch1\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/manzt/anywidget/main/docs/public/favicon.svg\" alt=\"anywidget logo. A circular icon with two connected arrows pointing clockwise, symbolizing a refresh or restart action\" width=\"60\"\u003e\n  \u003cbr\u003eanywidget\n\u003c/h1\u003e\n\u003csamp\u003e\n  \u003cp align=\"center\"\u003e\n    \u003cspan\u003ereusable widgets made easy\u003c/span\u003e\n      \u003cbr\u003e\n      \u003cbr\u003e\n      \u003ca href=\"#installation\"\u003einstallation\u003c/a\u003e .\n      \u003ca href=\"https://anywidget.dev\"\u003edocs\u003c/a\u003e .\n      \u003ca href=\"https://discord.gg/W5h4vPMbDQ\"\u003ediscord\u003c/a\u003e .\n      \u003ca href=\"https://blog.jupyter.org/anywidget-jupyter-widgets-made-easy-164eb2eae102\"\u003elearn\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/samp\u003e\n\u003c/p\u003e\n\n## About\n\n**anywidget** is both a [**specification**](https://anywidget.dev/en/afm) and\n**toolkit** for authoring reusable web-based widgets for interactive computing\nenvironments.\n\n- 🛠️ create custom Jupyter Widgets **without complicated cookiecutter templates**\n- 📚 **publish to PyPI** like any other Python package\n- 🤖 prototype **within** `.ipynb` or `.py` files\n- 🚀 run in **Jupyter**, **JupyterLab**, **Google Colab**, **VSCode**, [**marimo**](https://github.com/marimo-team/marimo) and more\n- ⚡ develop with **instant HMR**, like modern web frameworks\n\nLearn more in the\n[Jupyter blog](https://blog.jupyter.org/anywidget-jupyter-widgets-made-easy-164eb2eae102).\n\n## Installation\n\n**anywidget** is available on [PyPI](https://pypi.org/project/anywidget/):\n\n```bash\npip install \"anywidget[dev]\"\n```\n\nand also on [conda-forge](https://anaconda.org/conda-forge/anywidget):\n\n```bash\nconda install -c conda-forge anywidget\n```\n\n## Usage\n\nThe easiest way to start developing with **anywidget** is with the Python package.\n\n```python\nimport anywidget\nimport traitlets\n\nclass CounterWidget(anywidget.AnyWidget):\n    # Widget front-end JavaScript code\n    _esm = \"\"\"\n    function render({ model, el }) {\n      let button = document.createElement(\"button\");\n      button.innerHTML = `count is ${model.get(\"value\")}`;\n      button.addEventListener(\"click\", () =\u003e {\n        model.set(\"value\", model.get(\"value\") + 1);\n        model.save_changes();\n      });\n      model.on(\"change:value\", () =\u003e {\n        button.innerHTML = `count is ${model.get(\"value\")}`;\n      });\n      el.appendChild(button);\n    }\n    export default { render };\n    \"\"\"\n    # Stateful property that can be accessed by JavaScript \u0026 Python\n    value = traitlets.Int(0).tag(sync=True)\n```\n\nFront-end code can also live in separate files (recommend):\n\n```python\nimport pathlib\nimport anywidget\nimport traitlets\n\nclass CounterWidget(anywidget.AnyWidget):\n    _esm = pathlib.Path(\"index.js\")\n    _css = pathlib.Path(\"styles.css\")\n    value = traitlets.Int(0).tag(sync=True)\n```\n\nRead [the documentation](https://anywidget.dev/en/getting-started) to learn\nmore.\n\n## Packages\n\nBeyond the primary Python package, **anywidget** provides an ecosystem of\ntooling to help you build and distribute custom widgets.\n\n| Name                                                                                             | Description                     | Version (click for changelogs)                                                                                                                                                                     |\n| ------------------------------------------------------------------------------------------------ | ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| [`anywidget`](https://github.com/manzt/anywidget/tree/main/packages/anywidget)                   | Primary Python package          | [![version](https://img.shields.io/pypi/v/anywidget.svg?labelColor=0273B7\u0026color=0C3141)](https://github.com/manzt/anywidget/blob/main/packages/anywidget/CHANGELOG.md)                             |\n| [`npm:@anywidget/types`](https://github.com/manzt/anywidget/tree/main/packages/types)            | Client type declarations        | [![version](https://img.shields.io/npm/v/@anywidget/types.svg?labelColor=C43636\u0026color=0C3141\u0026logo=npm\u0026label)](https://github.com/manzt/anywidget/blob/main/packages/types/CHANGELOG.md)            |\n| [`npm:@anywidget/vite`](https://github.com/manzt/anywidget/tree/main/packages/vite)              | Vite plugin                     | [![version](https://img.shields.io/npm/v/@anywidget/vite.svg?labelColor=C43636\u0026color=0C3141\u0026logo=npm\u0026label)](https://github.com/manzt/anywidget/blob/main/packages/vite/CHANGELOG.md)              |\n| [`npm:@anywidget/react`](https://github.com/manzt/anywidget/tree/main/packages/react)            | React framework bridge          | [![version](https://img.shields.io/npm/v/@anywidget/react.svg?labelColor=C43636\u0026color=0C3141\u0026logo=npm\u0026label)](https://github.com/manzt/anywidget/blob/main/packages/react/CHANGELOG.md)            |\n| [`npm:@anywidget/svelte`](https://github.com/manzt/anywidget/tree/main/packages/svelte)          | Svelte framework bridge         | [![version](https://img.shields.io/npm/v/@anywidget/svelte.svg?labelColor=C43636\u0026color=0C3141\u0026logo=npm\u0026label)](https://github.com/manzt/anywidget/blob/main/packages/svelte/CHANGELOG.md)          |\n| [`npm:create-anywidget`](https://github.com/manzt/anywidget/tree/main/packages/create-anywidget) | CLI to bootstrap a new project  | [![version](https://img.shields.io/npm/v/create-anywidget.svg?labelColor=C43636\u0026color=0C3141\u0026logo=npm\u0026label)](https://github.com/manzt/anywidget/blob/main/packages/create-anywidget/CHANGELOG.md) |\n| [`jsr:@anywidget/deno`](https://github.com/manzt/anywidget/tree/main/packages/deno)              | Backend for Deno Jupyter kernel | [![version](https://jsr.io/badges/@anywidget/deno)](https://github.com/manzt/anywidget/blob/main/packages/deno/CHANGELOG.md)                                                                       |\n| [`jsr:@anywidget/signals`](https://github.com/manzt/anywidget/tree/main/packages/signals)        | Signals bridge                  | [![version](https://jsr.io/badges/@anywidget/signals)](https://github.com/manzt/anywidget/blob/main/packages/signals/CHANGELOG.md)                                                                 |\n\n## Support\n\nHaving trouble? Get help in our [Discord](https://discord.gg/W5h4vPMbDQ) or open\na [Discussion](https://github.com/manzt/anywidget/issues/new).\n\n## Contributing\n\n**New contributors welcome!** Check out our\n[Contributors Guide](./CONTRIBUTING.md) for help getting started.\n\nJoin us on [Discord](https://discord.gg/W5h4vPMbDQ) to meet other maintainers.\nWe'll help you get your first contribution in no time!\n\n## Citation\n\nIf you use **anywidget** in your work, please consider citing the following\npublications:\n\nOur [JOSS paper](https://joss.theoj.org/papers/10.21105/joss.06939) describing\nthe overall project and vision:\n\n```bibtex\n@article{manz2024anywidget,\n  title = {anywidget: reusable widgets for interactive analysis and visualization in computational notebooks},\n  volume = {9},\n  url = {https://doi.org/10.21105/joss.06939},\n  doi = {10.21105/joss.06939},\n  number = {102},\n  journal = {Journal of Open Source Software},\n  author = {Manz, Trevor and Abdennur, Nezar and Gehlenborg, Nils},\n  year = {2024},\n  note = {Publisher: The Open Journal},\n  pages = {6939},\n}\n```\n\nOur [SciPy paper](https://proceedings.scipy.org/articles/NRPV2311), detailing\nthe motivation and approach behind Jupyter Widget ecosystem compatability:\n\n```bibtex\n@inproceedings{manz2024notebooks,\n  title = {Any notebook served: authoring and sharing reusable interactive widgets},\n  copyright = {https://creativecommons.org/licenses/by/4.0/},\n  url = {https://doi.org/10.25080/NRPV2311},\n  doi = {10.25080/NRPV2311},\n  urldate = {2024-10-07},\n  booktitle = {Proceedings of the 23rd {Python} in {Science} {Conference}},\n  author = {Manz, Trevor and Gehlenborg, Nils and Abdennur, Nezar},\n  month = jul,\n  year = {2024},\n}\n```\n","funding_links":[],"categories":["Python","Interactive Widgets"],"sub_categories":["Create Your Own Widget with JavaScript"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanzt%2Fanywidget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanzt%2Fanywidget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanzt%2Fanywidget/lists"}