Skip to main content

ipyniivue

PyPI Version License Binder

A Jupyter Widget for Niivue based on anywidget.


Installation

Install ipyniivue using pip:

pip install ipyniivue

Usage

In a Jupyter environment:

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 to learn more.


Documentation

See the Documentation for usage.


Development

ipyniivue uses the recommended hatchling build system, which is convenient to use via the hatch CLI. 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:

python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"

Making Changes to the JavaScript Code

This is an anywidget project, meaning the codebase is a hybrid of Python and JavaScript. The JavaScript code resides under the js/ directory and uses esbuild 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:

    npm run build
    
  2. Start Development Server: Start a development server that automatically rebuilds the code as you make changes:

    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:

%env ANYWIDGET_HMR=1

or in the shell:

export ANYWIDGET_HMR=1

Release Process

Releases are automated using GitHub Actions via the 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*:

    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.
  • Each changelog entry is grouped and rendered based on conventional commits.
  • It's recommended to follow the Conventional Commits specification.

Metadata

Release files for ipyniivue 2.4.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ipyniivue 2.4.4
File Size Uploaded
ipyniivue-2.4.4.tar.gz 1.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for ipyniivue 2.4.4
File Interpreter ABI Platform
ipyniivue-2.4.4-py3-none-any.whl Python 3 none any Details

Total release size: 3.3 MB

Release files / ipyniivue-2.4.4.tar.gz

Download URL ipyniivue-2.4.4.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
34ce751a9aa342081fe1ab9e1aadcf2d5594729b45b1670bfc225eeb3888c1d9
BLAKE2b-256 checksum
How to use checksums
74720fb5dc15a871c5706741fd2e68b6204c52321cca7148629b8be0753137a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 8, 2025.

Transparency log

Release files / ipyniivue-2.4.4-py3-none-any.whl

Download URL ipyniivue-2.4.4-py3-none-any.whl
Size 1.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
5e42b192a607b398c900a1e66d18aab1b41da4653a7e1641c18959bf1873cadc
BLAKE2b-256 checksum
How to use checksums
30091acb57d0225c93c9dadad025245c206bec17238eddac0bd9c49bc2240999
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 8, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

2.4.4 This release

2 release files

2.4.3

2 release files

2.4.2

2 release files

2.4.1

2 release files

2.4.0

2 release files

2.3.3

2 release files

2.3.2

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page