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
path = cv.savefig(
"demo.nc",
var="temperature", x="lon", y="lat", plot_type="heatmap",
kwargs={"colormap": "balance", "colorrange": (-2, 30)},
filename="temperature.png",
)
Record an animation
path = cv.record(
"demo.nc",
var="temperature", x="lon", y="lat", plot_type="heatmap",
ani_dim="time",
filename="temperature.mp4", framerate=25,
)
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.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cdfviewer-2026.8.3.tar.gz | 54.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cdfviewer-2026.8.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 88.1 kB
Release files / cdfviewer-2026.8.3.tar.gz
| Download URL | cdfviewer-2026.8.3.tar.gz |
|---|---|
| Size | 54.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
496098c778887a0709e0b23bb6a1327cec718d78281c518cba4133b379a1d13a
|
|
BLAKE2b-256 checksum How to use checksums |
ec7b7d9b4741a5a71c51b3adf4d87b2078da2bd89cc34be2af36afcc76cd75d2
|
| 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 22, 2026.
Transparency logRelease files / cdfviewer-2026.8.3-py3-none-any.whl
| Download URL | cdfviewer-2026.8.3-py3-none-any.whl |
|---|---|
| Size | 33.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c406a5ad54d6b4f2b9a49ee7c687c989db67688cdc4b15fb94bc71882650a6b5
|
|
BLAKE2b-256 checksum How to use checksums |
8f0eb4b33ebf0a33c64df70938f75b24257db47b895523183cff31713e82976b
|
| 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 22, 2026.
Transparency log