{"id":15020268,"url":"https://github.com/samlau95/nbinteract","last_synced_at":"2025-10-26T17:03:26.591Z","repository":{"id":24568061,"uuid":"101940687","full_name":"SamLau95/nbinteract","owner":"SamLau95","description":"Create interactive webpages from Jupyter Notebooks","archived":false,"fork":false,"pushed_at":"2024-02-13T21:24:04.000Z","size":27632,"stargazers_count":235,"open_issues_count":66,"forks_count":22,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-28T17:11:16.341Z","etag":null,"topics":["interactive-webpages","ipywidgets","jupyter-notebook","notebook","python3"],"latest_commit_sha":null,"homepage":"http://www.samlau.me/nbinteract/","language":"HTML","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/SamLau95.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-31T00:16:20.000Z","updated_at":"2025-03-23T16:07:17.000Z","dependencies_parsed_at":"2024-06-18T20:13:27.977Z","dependency_job_id":null,"html_url":"https://github.com/SamLau95/nbinteract","commit_stats":{"total_commits":510,"total_committers":8,"mean_commits":63.75,"dds":"0.20196078431372544","last_synced_commit":"97d340a8c371158e429a988eab88cd658023ae0c"},"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamLau95%2Fnbinteract","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamLau95%2Fnbinteract/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamLau95%2Fnbinteract/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamLau95%2Fnbinteract/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SamLau95","download_url":"https://codeload.github.com/SamLau95/nbinteract/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226215,"owners_count":20904465,"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":["interactive-webpages","ipywidgets","jupyter-notebook","notebook","python3"],"created_at":"2024-09-24T19:54:49.899Z","updated_at":"2025-10-26T17:03:26.524Z","avatar_url":"https://github.com/SamLau95.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"‼️ `nbinteract` is an old research project and is no longer actively maintained. Try https://github.com/voila-dashboards/voila instead. ‼️\n\nnbinteract\n=================\n\n[![Read the Docs](https://img.shields.io/badge/docs-nbinteract.com-green.svg)][docs]\n[![Gitter](https://badges.gitter.im/owner/repo.png)][gitter]\n\n[![Build Status](https://travis-ci.org/SamLau95/nbinteract.svg?branch=master)](https://travis-ci.org/SamLau95/nbinteract)\n[![PyPI](https://img.shields.io/pypi/v/nbinteract.svg)](https://pypi.python.org/pypi/nbinteract/)\n[![npm](https://img.shields.io/npm/v/nbinteract.svg)](https://www.npmjs.com/package/nbinteract)\n\n\n`nbinteract` is a Python package that creates interactive webpages from Jupyter\nnotebooks. `nbinteract` also has built-in support for interactive plotting.\nThese interactions are driven by data, not callbacks, allowing authors to focus\non the logic of their programs.\n\n`nbinteract` is most useful for:\n\n- Data scientists that want to create simple interactive blog posts without having\n  to know / work with Javascript.\n- Instructors that want to include interactive examples in their textbooks.\n- Students that want to publish data analysis that contains interactive demos.\n\nCurrently, `nbinteract` is in an alpha stage because of its quickly-changing\nAPI.\n\n## Examples\n\nMost plotting functions from other libraries (e.g. `matplotlib`) take data as\ninput. `nbinteract`'s plotting functions take functions as input.\n\n```python\nimport numpy as np\nimport nbinteract as nbi\n\ndef normal(mean, sd):\n    '''Returns 1000 points drawn at random fron N(mean, sd)'''\n    return np.random.normal(mean, sd, 1000)\n\n# Pass in the `normal` function and let user change mean and sd.\n# Whenever the user interacts with the sliders, the `normal` function\n# is called and the returned data are plotted.\nnbi.hist(normal, mean=(0, 10), sd=(0, 2.0), options=options)\n```\n\n![example1](https://github.com/SamLau95/nbinteract/raw/master/docs/images/example1.gif)\n\nSimulations are easy to create using `nbinteract`. In this simulation, we roll\na die and plot the running average of the rolls. We can see that with more\nrolls, the average gets closer to the expected value: 3.5.\n\n```python\nrolls = np.random.choice([1, 2, 3, 4, 5, 6], size=300)\naverages = np.cumsum(rolls) / np.arange(1, 301)\n\ndef x_vals(num_rolls):\n    return range(num_rolls)\n\n# The function to generate y-values gets called with the\n# x-values as its first argument.\ndef y_vals(xs):\n    return averages[:len(xs)]\n\nnbi.line(x_vals, y_vals, num_rolls=(1, 300))\n```\n\n![example2](https://github.com/SamLau95/nbinteract/raw/master/docs/images/example2.gif)\n\n## Publishing\n\nFrom a notebook cell:\n\n```python\n# Run in a notebook cell to convert the notebook into a publishable HTML page:\n#\n# nbi.publish('my_binder_spec', 'my_notebook.ipynb')\n#\n# Replace my_binder_spec with a Binder spec in the format\n# {username}/{repo}/{branch} (e.g. SamLau95/nbinteract-image/master).\n#\n# Replace my_notebook.ipynb with the name of the notebook file to convert.\n#\n# Example:\nnbi.publish('SamLau95/nbinteract-image/master', 'homepage.ipynb')\n```\n\nFrom the command line:\n\n```bash\n# Run on the command line to convert the notebook into a publishable HTML page.\n#\n# nbinteract my_binder_spec my_notebook.ipynb\n#\n# Replace my_binder_spec with a Binder spec in the format\n# {username}/{repo}/{branch} (e.g. SamLau95/nbinteract-image/master).\n#\n# Replace my_notebook.ipynb with the name of the notebook file to convert.\n#\n# Example:\nnbinteract SamLau95/nbinteract-image/master homepage.ipynb\n```\n\nFor more information on publishing, see the [tutorial][] which has a complete\nwalkthrough on publishing a notebook to the web.\n\n## Installation\n\nUsing `pip`:\n\n```bash\npip install nbinteract\n\n# The next two lines can be skipped for notebook version 5.3 and above\njupyter nbextension enable --py --sys-prefix widgetsnbextension\njupyter nbextension enable --py --sys-prefix bqplot\n```\n\nYou may now import the `nbinteract` package in Python code and use the\n`nbinteract` CLI command to convert notebooks to HTML pages.\n\n## Tutorial and Documentation\n\n[Here's a link to the tutorial and docs for this project.][docs]\n\n## Developer Install\n\nIf you are interested in developing this project locally, run the following:\n\n```\ngit clone https://github.com/SamLau95/nbinteract\ncd nbinteract\n\n# Installs the nbconvert exporter\npip install -e .\n\n# To export a notebook to interactive HTML format:\njupyter nbconvert --to interact notebooks/Test.ipynb\n\npip install -U ipywidgets\njupyter nbextension enable --py --sys-prefix widgetsnbextension\n\nbrew install yarn\nyarn install\n\n# Start notebook and webpack servers\nmake -j2 serve\n```\n\n## Feedback\n\nIf you have any questions or comments, send us a message on the\n[Gitter channel][gitter]. We appreciate your feedback!\n\n## Contributors\n\n`nbinteract` is originally developed by [Sam Lau][sam] and Caleb Siu as part of\na Masters project at UC Berkeley. The code lives under a BSD 3 license and we\nwelcome contributions and pull requests from the community.\n\n[tutorial]: /tutorial/tutorial_getting_started.html\n[ipywidgets]: https://github.com/jupyter-widgets/ipywidgets\n[bqplot]: https://github.com/bloomberg/bqplot\n[widgets]: http://jupyter.org/widgets.html\n[gh-pages]: https://pages.github.com/\n[gitbook]: http://gitbook.com/\n[install-nb]: http://jupyter.readthedocs.io/en/latest/install.html\n[docs]: https://www.nbinteract.com/\n[sam]: http://www.samlau.me/\n[gitter]: https://gitter.im/nbinteract/Lobby/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamlau95%2Fnbinteract","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamlau95%2Fnbinteract","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamlau95%2Fnbinteract/lists"}