Name | ipyniivue JSON |
Version |
2.4.0
JSON |
| download |
home_page | None |
Summary | A Jupyter Widget for Niivue based on anywidget. |
upload_time | 2025-07-23 20:27:26 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | BSD-2-Clause |
keywords |
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# ipyniivue
[](https://badge.fury.io/py/ipyniivue)
[](https://opensource.org/license/bsd-2-clause)
[](https://mybinder.org/v2/gh/niivue/ipyniivue/main?urlpath=lab%2Ftree%2Fexamples)
**A Jupyter Widget for [Niivue](https://github.com/niivue/niivue) based on [anywidget](https://github.com/manzt/anywidget).**
---
## Installation
Install ipyniivue using `pip`:
```sh
pip install ipyniivue
```
---
## Usage
In a Jupyter environment:
```python
from ipyniivue import NiiVue
nv = NiiVue()
nv.load_volumes([{"path": "images/mni152.nii.gz"}])
nv
```
This will render an interactive Niivue widget within your notebook.
**See the [basic demo](./examples/basic_multiplanar.ipynb) to learn more.**
---
## Documentation
See the [Documentation](https://niivue.github.io/ipyniivue) for usage.
---
## Development
ipyniivue uses the recommended [`hatchling`](https://packaging.python.org/en/latest/flow/#using-hatch) build system, which is convenient to use via the [`hatch` CLI](https://hatch.pypa.io/latest/). We recommend installing `hatch` globally (e.g., via `pipx`) and running the various commands defined within `pyproject.toml`. `hatch` will take care of creating and synchronizing a virtual environment with all dependencies defined in `pyproject.toml`.
### Command Cheat Sheet
Run these commands from the root of the project:
| Command | Description |
|------------------------|----------------------------------------------------------------------|
| `hatch run format` | Format the project with `ruff format .` and apply linting with `ruff --fix .` |
| `hatch run lint` | Lint the project with `ruff check .` |
| `hatch run test` | Run unit tests with `pytest` |
| `hatch run docs` | Build docs with `Sphinx` |
Alternatively, you can manually create a virtual environment and manage installation and dependencies with `pip`:
```sh
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
```
### Making Changes to the JavaScript Code
This is an [anywidget](https://github.com/manzt/anywidget) project, meaning the codebase is a hybrid of Python and JavaScript. The JavaScript code resides under the `js/` directory and uses [esbuild](https://esbuild.github.io/) for bundling. Whenever you make changes to the JavaScript code, you need to rebuild the files under `src/ipyniivue/static`.
You have two options:
1. **Build Once**: Build the JavaScript code one time:
```sh
npm run build
```
2. **Start Development Server**: Start a development server that automatically rebuilds the code as you make changes:
```sh
npm run dev
```
We recommend this approach for a smoother development experience.
**Working with Jupyter**
Once the development server is running, you can start JupyterLab or Visual Studio Code to develop the widget. When you're finished, stop the development server with `Ctrl+C`.
> **Note:** To have `anywidget` automatically apply changes as you work, set the environment variable `ANYWIDGET_HMR=1`. You can set this directly in a notebook cell:
>
> ```python
> %env ANYWIDGET_HMR=1
> ```
> or in the shell:
> ```sh
> export ANYWIDGET_HMR=1
> ```
---
## Release Process
Releases are automated using GitHub Actions via the [`release.yml`](.github/workflows/release.yml) workflow.
### Steps to Create a New Release
1. **Commit Changes**: Ensure all your changes are committed.
2. **Create a Tag**: Create a new tag matching the pattern `v*`:
```sh
git tag -a vX.X.X -m "vX.X.X"
git push --follow-tags
```
3. **Workflow Actions**: When triggered, the workflow will:
- Publish the package to PyPI with the tag version.
- Generate a changelog based on conventional commits.
- Create a GitHub Release with the changelog.
### Changelog Generation
- We generate a changelog for GitHub releases with [`antfu/changelogithub`](https://github.com/antfu/changelogithub).
- Each changelog entry is grouped and rendered based on conventional commits.
- It's recommended to follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) specification.
Raw data
{
"_id": null,
"home_page": null,
"name": "ipyniivue",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/20/c6/50f22369f7690025e80f16403227c0ceb65969afb5eea5995bd4ff49aabb/ipyniivue-2.4.0.tar.gz",
"platform": null,
"description": "# ipyniivue\n\n[](https://badge.fury.io/py/ipyniivue)\n[](https://opensource.org/license/bsd-2-clause)\n[](https://mybinder.org/v2/gh/niivue/ipyniivue/main?urlpath=lab%2Ftree%2Fexamples)\n\n**A Jupyter Widget for [Niivue](https://github.com/niivue/niivue) based on [anywidget](https://github.com/manzt/anywidget).**\n\n---\n\n\n## Installation\n\nInstall ipyniivue using `pip`:\n\n```sh\npip install ipyniivue\n```\n\n---\n\n## Usage\n\nIn a Jupyter environment:\n\n```python\nfrom ipyniivue import NiiVue\n\nnv = NiiVue()\nnv.load_volumes([{\"path\": \"images/mni152.nii.gz\"}])\nnv\n```\n\nThis will render an interactive Niivue widget within your notebook.\n\n**See the [basic demo](./examples/basic_multiplanar.ipynb) to learn more.**\n\n---\n\n## Documentation\n\nSee the [Documentation](https://niivue.github.io/ipyniivue) for usage.\n\n\n---\n\n## Development\n\nipyniivue uses the recommended [`hatchling`](https://packaging.python.org/en/latest/flow/#using-hatch) build system, which is convenient to use via the [`hatch` CLI](https://hatch.pypa.io/latest/). We recommend installing `hatch` globally (e.g., via `pipx`) and running the various commands defined within `pyproject.toml`. `hatch` will take care of creating and synchronizing a virtual environment with all dependencies defined in `pyproject.toml`.\n\n### Command Cheat Sheet\n\nRun these commands from the root of the project:\n\n| Command | Description |\n|------------------------|----------------------------------------------------------------------|\n| `hatch run format` | Format the project with `ruff format .` and apply linting with `ruff --fix .` |\n| `hatch run lint` | Lint the project with `ruff check .` |\n| `hatch run test` | Run unit tests with `pytest` |\n| `hatch run docs` | Build docs with `Sphinx` |\n\nAlternatively, you can manually create a virtual environment and manage installation and dependencies with `pip`:\n\n```sh\npython3 -m venv .venv && source .venv/bin/activate\npip install -e \".[dev]\"\n```\n\n### Making Changes to the JavaScript Code\n\nThis is an [anywidget](https://github.com/manzt/anywidget) project, meaning the codebase is a hybrid of Python and JavaScript. The JavaScript code resides under the `js/` directory and uses [esbuild](https://esbuild.github.io/) for bundling. Whenever you make changes to the JavaScript code, you need to rebuild the files under `src/ipyniivue/static`.\n\nYou have two options:\n\n1. **Build Once**: Build the JavaScript code one time:\n\n ```sh\n npm run build\n ```\n\n2. **Start Development Server**: Start a development server that automatically rebuilds the code as you make changes:\n\n ```sh\n npm run dev\n ```\n\n We recommend this approach for a smoother development experience.\n\n**Working with Jupyter**\n\nOnce the development server is running, you can start JupyterLab or Visual Studio Code to develop the widget. When you're finished, stop the development server with `Ctrl+C`.\n\n> **Note:** To have `anywidget` automatically apply changes as you work, set the environment variable `ANYWIDGET_HMR=1`. You can set this directly in a notebook cell:\n>\n> ```python\n> %env ANYWIDGET_HMR=1\n> ```\n> or in the shell:\n> ```sh\n> export ANYWIDGET_HMR=1\n> ```\n\n---\n\n## Release Process\n\nReleases are automated using GitHub Actions via the [`release.yml`](.github/workflows/release.yml) workflow.\n\n### Steps to Create a New Release\n\n1. **Commit Changes**: Ensure all your changes are committed.\n\n2. **Create a Tag**: Create a new tag matching the pattern `v*`:\n\n ```sh\n git tag -a vX.X.X -m \"vX.X.X\"\n git push --follow-tags\n ```\n\n3. **Workflow Actions**: When triggered, the workflow will:\n\n - Publish the package to PyPI with the tag version.\n - Generate a changelog based on conventional commits.\n - Create a GitHub Release with the changelog.\n\n### Changelog Generation\n\n- We generate a changelog for GitHub releases with [`antfu/changelogithub`](https://github.com/antfu/changelogithub).\n- Each changelog entry is grouped and rendered based on conventional commits.\n- It's recommended to follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) specification.\n",
"bugtrack_url": null,
"license": "BSD-2-Clause",
"summary": "A Jupyter Widget for Niivue based on anywidget.",
"version": "2.4.0",
"project_urls": {
"homepage": "https://github.com/niivue/ipyniivue"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "2af5c932cddad439bdfd076d75c779cc4e8a3549eb1d0f7286bd51793e4ddd13",
"md5": "95cc8df60f34217de3655aeedeb80209",
"sha256": "794ee27ee07f311c3acb8c501764c6032e74979426885f90f9a836b475878b78"
},
"downloads": -1,
"filename": "ipyniivue-2.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "95cc8df60f34217de3655aeedeb80209",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 1622829,
"upload_time": "2025-07-23T20:27:24",
"upload_time_iso_8601": "2025-07-23T20:27:24.999868Z",
"url": "https://files.pythonhosted.org/packages/2a/f5/c932cddad439bdfd076d75c779cc4e8a3549eb1d0f7286bd51793e4ddd13/ipyniivue-2.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "20c650f22369f7690025e80f16403227c0ceb65969afb5eea5995bd4ff49aabb",
"md5": "771af685bc8137ad8a477a79daf47a5c",
"sha256": "e9112c01b4eba91f3bdaf97431d96bbbe3b3ea4039236e75b317cccc722b3caa"
},
"downloads": -1,
"filename": "ipyniivue-2.4.0.tar.gz",
"has_sig": false,
"md5_digest": "771af685bc8137ad8a477a79daf47a5c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 1598597,
"upload_time": "2025-07-23T20:27:26",
"upload_time_iso_8601": "2025-07-23T20:27:26.496975Z",
"url": "https://files.pythonhosted.org/packages/20/c6/50f22369f7690025e80f16403227c0ceb65969afb5eea5995bd4ff49aabb/ipyniivue-2.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-23 20:27:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "niivue",
"github_project": "ipyniivue",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "ipyniivue"
}