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-material 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.4.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.4-py3-none-any.whl (43.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nc_check-0.2.4.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.4.tar.gz
Algorithm Hash digest
SHA256 c7da0c5a5e11b4399bd8f41cd5ac8d95ffe015f07c87c11958f6f59dc5eed6ba
MD5 b35d9aae61f8e566d9ea55cced6ed81d
BLAKE2b-256 b26d4d125717aeb328724adf642be8e68e39b981ab7003d019f576208b977500

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nc_check-0.2.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 cff24844ad0f036bb673a4ae33dd84c070066e8a8c831afc689a939bb5ddd000
MD5 e555bf08363d3ea1479980f9df39f5ba
BLAKE2b-256 397d28297160dd2be090f6586f06543f50226cfcde998d004a6a52a64539977c

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