Skip to main content

Pynaviz

Python Neural Analysis Visualization

Pynaviz provides interactive, high-performance visualizations designed to work seamlessly with Pynapple time series and video data. It allows synchronized exploration of neural signals and behavioral recordings. It is built on top of pygfx, a modern GPU-based rendering engine.


image License: MIT CI codecov

Installation

We recommend using the Qt-based interface for the best interactive experience:

pip install pynaviz[qt]

If Qt is not available on your system, you can still use the fallback rendering engine (via PyGFX):

pip install pynaviz

Quick start

From the command line

$ pynaviz [files ...] [-l layout.json] [-f FORMAT]
Example Argument Notes
$ pynaviz (no arguments) Opens an empty viewer
$ pynaviz data.nwb files One or more .nwb files; objects unpacked individually
$ pynaviz data.npz files One or more .npz files; must contain a single pynapple object each
$ pynaviz recording.mp4 files One or more video files (.mp4, .avi, .mov, .mkv)
$ pynaviz data.nwb recording.mp4 files Multiple files of different types can be mixed
$ pynaviz recording.plx files Ephys file; format auto-detected via nap.EphysReader
$ pynaviz rec/ files Directory; auto-detected as NeuroScopeIO if .dat + .xml are present
$ pynaviz rec/ -f NeuroScopeIO files + -f Directory with explicit Neo IO format
$ pynaviz recording.plx -f PlexonIO files + -f Ephys file with explicit format
$ pynaviz -l layout.json -l / --layout Restore a previously saved layout (.json)
$ pynaviz data.nwb -l layout.json files + -l Load files and restore layout simultaneously

From a Python script

from pynaviz import scope

The scope function accepts many input types:

Example Input type Notes
scope({"lfp": tsdframe, "spikes": tsgroup}) dict Keys become display names in the variable panel
scope([tsdframe, tsgroup, interval_set]) list / tuple Names inferred from class (TsdFrame, TsGroup, …)
scope(tsgroup) nap.TsGroup Collection of spike trains. Same for all pynapple objects (Tsd, TsdFrame, …)
scope(nap.load_file("data.nwb")) nap.NWBFile All contained objects unpacked individually
scope(nap.EphysReader("rec/", format="NeuroScopeIO")) nap.EphysReader All contained objects unpacked individually
scope("data.nwb") str / pathlib.Path — .nwb Loaded via pynapple, objects unpacked
scope("data.npz") str / pathlib.Path — .npz Must contain a single pynapple object
scope("recording.mp4") str / pathlib.Path — video .mp4, .avi, .mov, .mkv supported
scope("recording.plx") str / pathlib.Path — ephys file Loaded via nap.EphysReader; format auto-detected
scope("rec/") str / pathlib.Path — directory Directory passed to nap.EphysReader; auto-detects NeuroScopeIO

See the User Guide for more details.

Keyboard shortcuts

Global

Shortcut Action
Space Play / pause
Ctrl+S Save layout
Ctrl+O Load layout

Per-dock (active when the mouse is over the canvas)

Shortcut Action
r Reset view
← / → Pan left / right by one page
y Lock / unlock y-axis
x Lock / unlock x-axis
Ctrl+← / Ctrl+→ Jump to previous / next superposed epoch (requires an IntervalSet overlay)
i / d Increase / decrease contrast (TsdFrame) or marker size (TsGroup)
n / p Jump to next / previous interval or timestamp (IntervalSet & Ts)

Basic usage

This example demonstrates how to create some example time series and launch the visualization GUI:

import pynapple as nap
import numpy as np
from pynaviz import scope

# Create some example time series
tsd = nap.Tsd(t=np.arange(100), d=np.random.randn(100))

# Create a TsdFrame with metadata
tsdframe = nap.TsdFrame(
    t=np.arange(10000),
    d=np.random.randn(10000, 10),
    metadata={"label": np.random.randn(10)}
)

# Launch the visualization GUI
scope(globals())

This will launch an interactive viewer where you can inspect time series, event data, and video tracks in a synchronized environment.

Metadata

Release files for pynaviz 0.2.0

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

Source distribution (sdist)

Source distribution for pynaviz 0.2.0
File Size Uploaded
pynaviz-0.2.0.tar.gz 240.1 kB Details

Built distribution (wheel)

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

Total release size: 380.1 kB

Release files / pynaviz-0.2.0.tar.gz

Download URL pynaviz-0.2.0.tar.gz
Size 240.1 kB
Tags Source
SHA-256 checksum
How to use checksums
170c731e2d580dbf61d657672d9a4c15ababfbea73707764c5d5a59dd872f055
BLAKE2b-256 checksum
How to use checksums
115cfc8db56939785c36d2023bbfbbca6899e26e13ff94eb500e1c89fc8973f7
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 May 7, 2026.

Transparency log

Release files / pynaviz-0.2.0-py3-none-any.whl

Download URL pynaviz-0.2.0-py3-none-any.whl
Size 140.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ffc05cca5b6c7698fd485294efe2ea494bfc9ec10b3693035653dfd4282c2471
BLAKE2b-256 checksum
How to use checksums
7ae817dd8381b0dc7b4e9fe1a34f79d858c6b298c0e9da90366a05dead9a14ca
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 May 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.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