[![PyPI version](https://badge.fury.io/py/nwbwidgets.svg)](https://badge.fury.io/py/nwbwidgets)
[![codecov](https://codecov.io/gh/NeurodataWithoutBorders/nwbwidgets/branch/master/graph/badge.svg)](https://codecov.io/gh/NeurodataWithoutBorders/nwbwidgets)
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/NeurodataWithoutBorders/nwb-jupyter-widgets/master?filepath=examples%2FNWBWidgets-modality-demos.ipynb)
<p align="center">
<img src="https://github.com/NeurodataWithoutBorders/nwbwidgets/assets/844306/f20b8c26-79c7-4c1c-a3b5-b49ecf8cce5d" width="350" alt="NWB Widgets"/>
<h3 align="center">Explore NWB data in Jupyter</h3>
</p>
<p align="center">
<a href="https://nwb-widgets.readthedocs.io/"><strong>Explore our documentation »</strong></a>
</p>
<!-- TABLE OF CONTENTS -->
## Table of Contents
- [About](#about)
- [Installation](#installation)
- [Usage](#usage)
- [Demo](#demo)
- [Documentation](#documentation)
## About
A library of widgets for visualization NWB data in a Jupyter notebook (or lab). The widgets allow you to navigate through the hierarchical structure of the NWB file and visualize specific data elements. It is designed to work out-of-the-box with NWB 2.0 files and to be easy to extend.
## Installation
`nwbwidgets` requires Python >= 3.7.
The latest published version can be installed by running:
```bash
pip install nwbwidgets
```
Note that there are some optional dependencies required for some widgets.
If an NWB data file contains a data type that requires additional dependencies,
you will see a list of extra modules needed for that specific widget.
All other widgets in the file will still work.
## Usage
### Using `Panel`
The easiest way to use NWB widgets is with the interactive `Panel`:
```python
from nwbwidgets.panel import Panel
Panel()
```
### Using `nwb2widget`
If you’re working directly with a NWB file object in your Jupyter notebook, you can also explore it with NWB Widgets using
```python
from pynwb import NWBHDF5IO
from nwbwidgets import nwb2widget
io = NWBHDF5IO('path/to/file.nwb', mode='r')
nwb = io.read()
nwb2widget(nwb)
```
### Using Docker
You can also run the NWB Widgets Panel using Docker:
```bash
$ docker run -p 8866:8866 ghcr.io/NeurodataWithoutBorders/nwbwidgets-panel:latest
```
## Demo
![](https://drive.google.com/uc?export=download&id=1JtI2KtT8MielIMvvtgxRzFfBTdc41LiE)
## Documentation
See our [ReadTheDocs page](https://nwbwidgets.readthedocs.io/en/main/) for full documentation, including a gallery of all supported formats.
## How it works
All visualizations are controlled by the dictionary `neurodata_vis_spec`. The keys of this dictionary are pynwb neurodata types, and the values are functions that take as input that neurodata_type and output a visualization. The visualizations may be of type `Widget` or `matplotlib.Figure`. When you enter a neurodata_type instance into `nwb2widget`, it searches the `neurodata_vis_spec` for that instance's neurodata_type, progressing backwards through the parent classes of the neurodata_type to find the most specific neurodata_type in `neurodata_vis_spec`. Some of these types are containers for other types, and create accordian UI elements for its contents, which are then passed into the `neurodata_vis_spec` and rendered accordingly.
Instead of supplying a function for the value of the `neurodata_vis_spec` dict, you may provide a `dict` or `OrderedDict` with string keys and function values. In this case, a tab structure is rendered, with each of the key/value pairs as an individual tab. All accordian and tab structures are rendered lazily- they are only called with that tab is selected. As a result, you can provide may tabs for a single data type without a worry. They will only be run if they are selected.
## Extending
To extend NWBWidgets, all you need to a function that takes as input an instance of a specific neurodata_type class, and outputs a matplotlib figure or a jupyter widget.
## Used in
* [giocomo-lab-to-nwb](https://github.com/ben-dichter-consulting/giocomo-lab-to-nwb)
* [buffalo-lab-data-to-nwb](https://github.com/ben-dichter-consulting/buffalo-lab-data-to-nwb)
* [axel-lab-to-nwb](https://github.com/ben-dichter-consulting/axel-lab-to-nwb)
Raw data
{
"_id": null,
"home_page": "https://github.com/NeurodataWithoutBorders/nwb-jupyter-widgets",
"name": "nwbwidgets",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "jupyter,hdf5,notebook,nwb",
"author": "Ben Dichter",
"author_email": "ben.dichter@catalystneuro.com",
"download_url": "https://files.pythonhosted.org/packages/37/c3/a50fe984f0018d8861528692ec472a4aed6a863e7173813cf5062c4c1452/nwbwidgets-0.11.3.tar.gz",
"platform": null,
"description": "[![PyPI version](https://badge.fury.io/py/nwbwidgets.svg)](https://badge.fury.io/py/nwbwidgets)\n[![codecov](https://codecov.io/gh/NeurodataWithoutBorders/nwbwidgets/branch/master/graph/badge.svg)](https://codecov.io/gh/NeurodataWithoutBorders/nwbwidgets)\n[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/NeurodataWithoutBorders/nwb-jupyter-widgets/master?filepath=examples%2FNWBWidgets-modality-demos.ipynb)\n\n<p align=\"center\">\n <img src=\"https://github.com/NeurodataWithoutBorders/nwbwidgets/assets/844306/f20b8c26-79c7-4c1c-a3b5-b49ecf8cce5d\" width=\"350\" alt=\"NWB Widgets\"/>\n <h3 align=\"center\">Explore NWB data in Jupyter</h3>\n</p>\n<p align=\"center\">\n <a href=\"https://nwb-widgets.readthedocs.io/\"><strong>Explore our documentation \u00bb</strong></a>\n</p>\n\n<!-- TABLE OF CONTENTS -->\n\n## Table of Contents\n\n- [About](#about)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Demo](#demo)\n- [Documentation](#documentation)\n\n## About\nA library of widgets for visualization NWB data in a Jupyter notebook (or lab). The widgets allow you to navigate through the hierarchical structure of the NWB file and visualize specific data elements. It is designed to work out-of-the-box with NWB 2.0 files and to be easy to extend.\n\n\n## Installation\n\n`nwbwidgets` requires Python >= 3.7.\n\nThe latest published version can be installed by running:\n\n```bash\npip install nwbwidgets\n```\n\nNote that there are some optional dependencies required for some widgets.\nIf an NWB data file contains a data type that requires additional dependencies,\nyou will see a list of extra modules needed for that specific widget.\nAll other widgets in the file will still work.\n\n## Usage\n\n### Using `Panel`\nThe easiest way to use NWB widgets is with the interactive `Panel`:\n\n```python\nfrom nwbwidgets.panel import Panel\n\nPanel()\n```\n\n### Using `nwb2widget`\nIf you\u2019re working directly with a NWB file object in your Jupyter notebook, you can also explore it with NWB Widgets using\n\n```python\nfrom pynwb import NWBHDF5IO\nfrom nwbwidgets import nwb2widget\n\nio = NWBHDF5IO('path/to/file.nwb', mode='r')\nnwb = io.read()\n\nnwb2widget(nwb)\n```\n\n### Using Docker\nYou can also run the NWB Widgets Panel using Docker:\n\n```bash\n$ docker run -p 8866:8866 ghcr.io/NeurodataWithoutBorders/nwbwidgets-panel:latest\n```\n\n## Demo\n![](https://drive.google.com/uc?export=download&id=1JtI2KtT8MielIMvvtgxRzFfBTdc41LiE)\n\n## Documentation\nSee our [ReadTheDocs page](https://nwbwidgets.readthedocs.io/en/main/) for full documentation, including a gallery of all supported formats.\n\n## How it works\nAll visualizations are controlled by the dictionary `neurodata_vis_spec`. The keys of this dictionary are pynwb neurodata types, and the values are functions that take as input that neurodata_type and output a visualization. The visualizations may be of type `Widget` or `matplotlib.Figure`. When you enter a neurodata_type instance into `nwb2widget`, it searches the `neurodata_vis_spec` for that instance's neurodata_type, progressing backwards through the parent classes of the neurodata_type to find the most specific neurodata_type in `neurodata_vis_spec`. Some of these types are containers for other types, and create accordian UI elements for its contents, which are then passed into the `neurodata_vis_spec` and rendered accordingly.\n\nInstead of supplying a function for the value of the `neurodata_vis_spec` dict, you may provide a `dict` or `OrderedDict` with string keys and function values. In this case, a tab structure is rendered, with each of the key/value pairs as an individual tab. All accordian and tab structures are rendered lazily- they are only called with that tab is selected. As a result, you can provide may tabs for a single data type without a worry. They will only be run if they are selected.\n\n## Extending\nTo extend NWBWidgets, all you need to a function that takes as input an instance of a specific neurodata_type class, and outputs a matplotlib figure or a jupyter widget.\n\n## Used in\n* [giocomo-lab-to-nwb](https://github.com/ben-dichter-consulting/giocomo-lab-to-nwb)\n* [buffalo-lab-data-to-nwb](https://github.com/ben-dichter-consulting/buffalo-lab-data-to-nwb)\n* [axel-lab-to-nwb](https://github.com/ben-dichter-consulting/axel-lab-to-nwb)\n\n\n",
"bugtrack_url": null,
"license": "BSD",
"summary": "This is nwbwidgets, widgets for viewing the contents of a NWB-file in Jupyter Notebooks using ipywidgets.",
"version": "0.11.3",
"project_urls": {
"Homepage": "https://github.com/NeurodataWithoutBorders/nwb-jupyter-widgets"
},
"split_keywords": [
"jupyter",
"hdf5",
"notebook",
"nwb"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "122925f2b8d01f21b7c9d4a0341647674ed3fcac2089349b89cb19f5fd2e25e6",
"md5": "bb990f6ea2a989d2d60d8ca8cc9159d1",
"sha256": "0128cb7dbf185ed32aef3ce1a164fb3383672ea3c7809a93734394aed9788702"
},
"downloads": -1,
"filename": "nwbwidgets-0.11.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "bb990f6ea2a989d2d60d8ca8cc9159d1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 73841,
"upload_time": "2023-07-21T15:59:27",
"upload_time_iso_8601": "2023-07-21T15:59:27.508672Z",
"url": "https://files.pythonhosted.org/packages/12/29/25f2b8d01f21b7c9d4a0341647674ed3fcac2089349b89cb19f5fd2e25e6/nwbwidgets-0.11.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "37c3a50fe984f0018d8861528692ec472a4aed6a863e7173813cf5062c4c1452",
"md5": "53cb30da94e7f6558ec29e66e3966185",
"sha256": "a562f60f2495819699c4f19768e79dc9f34b5c82e792908aab8826e784d9d9cd"
},
"downloads": -1,
"filename": "nwbwidgets-0.11.3.tar.gz",
"has_sig": false,
"md5_digest": "53cb30da94e7f6558ec29e66e3966185",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 10998040,
"upload_time": "2023-07-21T15:59:30",
"upload_time_iso_8601": "2023-07-21T15:59:30.198650Z",
"url": "https://files.pythonhosted.org/packages/37/c3/a50fe984f0018d8861528692ec472a4aed6a863e7173813cf5062c4c1452/nwbwidgets-0.11.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-21 15:59:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "NeurodataWithoutBorders",
"github_project": "nwb-jupyter-widgets",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [],
"lcname": "nwbwidgets"
}