--- id: cf-xarray version: "0.11.3" license: Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) license_treatment: permissive maintenance: active --- # cf-xarray — A convenience wrapper for using CF attributes on xarray objects License: permissive · Maintenance: active · Downloads: 353.4K/mo ## What it is and what it does cf-xarray is a lightweight wrapper that extends xarray with a `.cf` accessor, allowing you to write operations using CF (Climate and Forecast) convention attribute names instead of dataset-specific dimension and coordinate names. Instead of needing to know that a particular file uses 'lat' or 'latitude' or 'y', you can write `.cf.mean('latitude')` and the accessor resolves the actual dimension name from CF metadata attributes on your dataset. The package is designed for scientists and data engineers working with climate, weather, or other geospatial datasets that follow CF conventions. It reduces the friction of writing code that must work across multiple datasets with different naming schemes, and it depends only on xarray, making it a minimal addition to existing workflows. The package is in production-stable status, actively maintained, and supports Python 3.11, 3.12, and 3.13. Use it for: - Write climate analysis code that works across multiple datasets without hardcoding dimension names like 'lat', 'lon', or 'time'. - Automate data processing pipelines where input files may use different naming conventions but follow CF standards. - Build reusable analysis functions that accept CF-compliant xarray datasets and operate on standard semantic dimensions. - Simplify exploratory data analysis on unfamiliar CF-compliant netCDF or HDF5 files by using semantic names. - Integrate with Pangeo or other Earth science data ecosystems where CF conventions are standard. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. cf-xarray adds a `.cf` accessor to xarray objects that lets you reference dimensions and coordinates by their CF (Climate and Forecast) convention attributes instead of hardcoded names, enabling dataset-agnostic operations like `.cf.mean("latitude")`. Yes. cf-xarray is actively maintained, has no known vulnerabilities, carries a permissive Apache 2.0 license, and adds minimal install friction (pure Python, single dependency). It is worth installing if you work with CF-compliant xarray datasets and want to write code that is independent of dataset-specific naming schemes. If your datasets do not follow CF conventions or you do not use xarray, it offers no benefit. ## Install pip install cf-xarray uv add cf-xarray poetry add cf-xarray ## Installing cf-xarray Before you install: Low friction: pure Python wheel with a single runtime dependency on xarray. Repository is active with a recent commit on 2026-08-01 and 180 stars; last release was 2026-06-12, 63 days ago. License in practice: Apache License 2.0 is permissive; you may use, modify, and distribute the package freely provided you include a copy of the license and note any changes you make. Quickstart: pip install cf-xarray import xarray as xr import cf_xarray ds = xr.open_dataset('data.nc') result = ds.cf.mean('latitude') Requires xarray to be installed; your dataset must have CF-compliant attributes (e.g., `standard_name` or `long_name`) set on dimensions or coordinates for the `.cf` accessor to recognize them. Verify before relying: - Which specific CF attributes (standard_name, long_name, etc.) the accessor recognizes and prioritizes - Performance overhead of the accessor layer compared to direct xarray operations - Scope of CF convention coverage (e.g., does it handle all CF standard names or a subset) ## Package facts - License: Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 353.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags xarray CF conventions wrapper, climate forecast metadata xarray, dimension name abstraction xarray, CF attribute accessor, dataset-agnostic xarray operations, CF-compliant coordinate access, metadata-driven xarray selection, climate-data, metadata-driven, xarray-ecosystem [View on SkillFed](https://skillfed.io/packages/cf-xarray) · [View on PyPI](https://pypi.org/project/cf-xarray/)