Skip to main content

cdfviewer

Python interface to CDFViewer, an interactive viewer for NetCDF files and zarr stores.

Render a figure or an animation from a script, build a command line without running it, or keep a viewer open from a notebook cell and drive it while you look at it. Everything runs in the cdfviewer application itself, and every parameter is named after the command-line option it stands for.

pip install cdfviewer

The application binary is found through CDFVIEWER_BIN, then on PATH, and otherwise downloaded on first use (Linux x86_64). pip install "cdfviewer[xarray]" adds what is needed to pass xarray objects instead of file paths.

Save a figure

import cdfviewer as cv

fig = cv.savefig(
    "demo.nc",
    var="temperature", x="lon", y="lat", plot_type="heatmap",
    kwargs={"colormap": "balance", "colorrange": (-2, 30)},
    filename="temperature.png",
)

fig is the path of the file that was written -- path-like, with the pathlib.Path in fig.path -- and it draws the figure when it is the value of a notebook cell.

Record an animation

video = cv.record(
    "demo.nc",
    var="temperature", x="lon", y="lat", plot_type="heatmap",
    ani_dim="time",
    filename="temperature.mp4", framerate=25,
)

In a notebook the recording plays inline, embedded in the notebook up to cv.configure(embed_limit=...) megabytes (20 by default).

Keep a viewer open

s = cv.Session("demo.nc", var="temperature", x="lon", y="lat",
               plot_type="heatmap")

s.set(colormap="viridis")   # the open window updates
s.isel(time=5)
s.savefig("frame.png")
s.close()

The window stays open while the session lives, and your Python process is never blocked. Constructing a Session on a dataset that already has one adjusts that viewer instead of opening a second, so re-running a notebook cell updates the plot you are looking at.

Development

The package lives in python/ of the CDFViewer.jl repository and follows the conventions of fridom: src layout, uv, ruff with select = ["ALL"], NumPy-style docstrings, function-based tests that mirror the source tree, and a coverage gate of 95 % measured without a real binary.

cd python
uv sync --extra dev            # environment with xarray, netCDF4, zarr, ruff, pytest
uv run ruff check src tests    # lint (also the pre-commit hook at the repo root)
uv run pytest --cov            # unit tests against the fake binary, coverage gate
CDFVIEWER_BIN=/path/to/cdfviewer uv run pytest -m binary   # against a real app

The unit tests never start the real app: tests/fake_cdfviewer.py stands in for it, answering --version, --savefig/--record and the REPL the way the app does. The tests marked binary run only when CDFVIEWER_BIN names a real cdfviewer; the release workflow runs them against the bundle it has just built. The package version in src/cdfviewer/_version.py must equal the version in the repository's Project.toml — one tag releases the app, the bundle and the wheel.

Documentation

The full page -- installing, the binary search, every parameter, keyword values, in-memory data, errors -- is in the manual: https://gordi42.github.io/CDFViewer.jl/usage/python/.

MIT licensed, like CDFViewer.jl itself.

Metadata

Release files for cdfviewer 2026.8.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 cdfviewer 2026.8.4
File Size Uploaded
cdfviewer-2026.8.4.tar.gz 58.4 kB Details

Built distribution (wheel)

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

Total release size: 95.3 kB

Release files / cdfviewer-2026.8.4.tar.gz

Download URL cdfviewer-2026.8.4.tar.gz
Size 58.4 kB
Tags Source
SHA-256 checksum
How to use checksums
625cca33abb0ad5635c51235e2894e6c3f08d0a1b6cf9870ae0e18f2f17255c2
BLAKE2b-256 checksum
How to use checksums
6538f1220d04073e5c640788db3dd8930aa1d1d57956d0b36269748fcb81076b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 23, 2026.

Transparency log

Release files / cdfviewer-2026.8.4-py3-none-any.whl

Download URL cdfviewer-2026.8.4-py3-none-any.whl
Size 36.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
babd0482c4b0b39997ff35ca29e94a214223dba77e6fa702cb1d8869c46e0909
BLAKE2b-256 checksum
How to use checksums
543401c2a8b72c0f1c98c7f993a83184daf1b1c5244b401bdd5e0f469c475b29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 23, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2026.8.4 This release

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