Skip to main content

Prepare xarray Datasets for CF-1.12 compliant NetCDF output

Project description

nc-check

nc-check banner

Prepare xarray.Dataset objects for CF-1.12-ready NetCDF output.

What It Does

  • Validates metadata and conventions with ds.check.compliance().
  • Applies safe non-destructive metadata fixes with ds.check.make_cf_compliant().
  • Runs ocean-grid and time-slice coverage checks with ds.check.ocean_cover() and ds.check.time_cover().
  • Provides both Python and CLI workflows (nc-check, nc-comply).

Install

uv add nc-check
# or
pip install nc-check

Optional full CF checker support:

uv add "nc-check[cf]"
# or
pip install "nc-check[cf]"

Quickstart

import xarray as xr
import nc_check  # Registers ds.check accessor

ds = xr.Dataset(
    data_vars={"temp": (("time", "lat", "lon"), [[[280.0]]])},
    coords={"time": [0], "lat": [10.0], "lon": [20.0]},
)

compliance = ds.check.compliance(report_format="python")
fixed = ds.check.make_cf_compliant()
ocean = ds.check.ocean_cover(report_format="python")
time = ds.check.time_cover(report_format="python")
full = ds.check.all(report_format="python")

CLI quickstart:

nc-check input.nc
nc-check all input.nc --save-report
nc-comply input.nc output.nc

Docs

Local docs site:

uv run --with mkdocs mkdocs serve

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nc_check-0.2.3.tar.gz (39.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nc_check-0.2.3-py3-none-any.whl (43.3 kB view details)

Uploaded Python 3

File details

Details for the file nc_check-0.2.3.tar.gz.

File metadata

  • Download URL: nc_check-0.2.3.tar.gz
  • Upload date:
  • Size: 39.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for nc_check-0.2.3.tar.gz
Algorithm Hash digest
SHA256 5f4d20a466a4a542f2283d7ec3659e662d0a8a74a2a3670a9281597e00ad9cb1
MD5 82d258ffe6085681ac9e5347385ced20
BLAKE2b-256 28f8ce49c780116e828c1433cfe48ed055009fe03257e98a72363c0a717dde2e

See more details on using hashes here.

File details

Details for the file nc_check-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: nc_check-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 43.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for nc_check-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9f9423516f86314bc14397f3517f7d01df58405951d1b1019c2a30899680d474
MD5 41f67d9d9a67c67e2c7081406d4e04a3
BLAKE2b-256 6e5d63f1f42013648aceaccdaff8b3fea47cefbaebb4feb725ed01ad342200dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page