Prepare xarray Datasets for CF-1.12 compliant NetCDF output
Project description
nc-check
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()andds.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
Development Test Run
uv sync --group dev
uv run --group dev python -m pytest
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.5.tar.gz
(50.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
nc_check-0.2.5-py3-none-any.whl
(60.6 kB
view details)
File details
Details for the file nc_check-0.2.5.tar.gz.
File metadata
- Download URL: nc_check-0.2.5.tar.gz
- Upload date:
- Size: 50.2 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
317fb73085fb2151b314f66bfcb38ff8027c23702815ce949c076dbae9ffbf23
|
|
| MD5 |
01f30eb01d2f1430d236df5ecc6b671f
|
|
| BLAKE2b-256 |
16b6c9de874d3d42d5e8835e14d22f2dff9c29c65c848d9e5afe280c77fe94f8
|
File details
Details for the file nc_check-0.2.5-py3-none-any.whl.
File metadata
- Download URL: nc_check-0.2.5-py3-none-any.whl
- Upload date:
- Size: 60.6 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd70ef997df2fef82c573eb050f12cb4656460847667622ca04fde99afb3554f
|
|
| MD5 |
5b5b4d33b3eab84b18d229fe0673bf4c
|
|
| BLAKE2b-256 |
eba0a4d16a329b2091695858c66dbabb6435ca20b6f6cd6819a1f12cb1f8400f
|