Skip to main content

The cfdm Python package is a complete reference implementation of the CF data model for CF-1.11, that identifies the fundamental elements of the CF conventions and shows how they relate to each other, independently of the netCDF encoding.

The central element defined by the CF data model is the field construct, which corresponds to a CF-netCDF data variable with all of its metadata.

A simple example of reading a field construct from a file and inspecting it:

>>> import cfdm
>>> f = cfdm.read('file.nc')
>>> f
[<Field: air_temperature(time(12), latitude(64), longitude(128)) K>]
>>> print(f[0])
Field: air_temperature (ncvar%tas)
----------------------------------
Data            : air_temperature(time(12), latitude(64), longitude(128)) K
Cell methods    : time(12): mean (interval: 1.0 month)
Dimension coords: time(12) = [0450-11-16 00:00:00, ..., 0451-10-16 12:00:00] noleap
                : latitude(64) = [-87.8638, ..., 87.8638] degrees_north
                : longitude(128) = [0.0, ..., 357.1875] degrees_east
                : height(1) = [2.0] m

The cfdm package can

  • read field and domain constructs from netCDF, CDL, Zarr, Kerchunk, PP and UM datasets with a choice of backends and in local, http, and s3 locations,

  • be fully flexible with respect to dataset storage chunking,

  • create new field and domain constructs in memory,

  • write and append field and domain constructs to netCDF and Zarr v3 datasets on disk, with control over HDF5 internal file metadata,

  • read, write, and manipulate UGRID mesh topologies,

  • read, write, and manipulate HEALPix grids,

  • read, write, and create coordinates defined by geometry cells,

  • read and write netCDF4 string data-type variables,

  • read, write, and create netCDF and CDL datasets containing hierarchical groups,

  • read, write, and create data that have been compressed by convention (i.e. ragged or gathered arrays, or coordinate arrays compressed by subsampling), whilst presenting a view of the data in its uncompressed form,

  • read and write that data that are quantized to eliminate false precision.

  • convert field and domain constructs to xarray datasets in memory,

  • inspect field and domain constructs,

  • test whether two constructs are the same,

  • modify field and domain construct metadata and data,

  • create subspaces of field and domain constructs,

  • incorporate, and create, metadata stored in external files.

Documentation

https://ncas-cms.github.io/cfdm

Dask

From version 1.11.2.0 the cfdm package uses Dask for all of its data manipulations.

Tutorial

https://ncas-cms.github.io/cfdm/tutorial

Installation

https://ncas-cms.github.io/cfdm/installation

Command line utility

During installation the cfdump command line tool is also installed, which generates text descriptions of the field constructs contained in a netCDF dataset.

Source code

This project is hosted in a GitHub repository where you can access the most up-to-date source.

Release files for cfdm 1.13.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cfdm 1.13.3.0
File Size Uploaded
cfdm-1.13.3.0.tar.gz 779.8 kB Details

Release files / cfdm-1.13.3.0.tar.gz

Download URL cfdm-1.13.3.0.tar.gz
Size 779.8 kB
Tags Source
SHA-256 checksum
How to use checksums
55ba3cb8157d0043fe93ca016cbe55b0038f271d5be3c4a8607c6bb114df9e16
BLAKE2b-256 checksum
How to use checksums
b401fb1716ab402e170ee0afb290a7186c211e05f697d0db08ede41cdd6de9c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.11

Release history Release notifications | RSS feed

This release

1.13.3.0 This release

1 release file

1.9.0.4

1 release file

1.9.0.3

1 release file

1.9.0.2

1 release file

1.9.0.1

1 release file

1.9.0.0

1 release file

1.8.9.0

1 release file

1.8.8.0

1 release file

1.8.6.0

1 release file

1.8.5

1 release file

1.8.4

1 release file

1.8.3

1 release file

1.8.2

1 release file

1.8.1

1 release file

1.8.0

1 release file

1.7.11

1 release file

1.7.10

1 release file

1.7.9

1 release file

1.7.8

1 release file

1.7.7

1 release file

1.7.6

1 release file

1.7.5

1 release file

1.7.4

1 release file

1.7.3

1 release file

1.7.2

1 release file

1.7.1

1 release file

1.7.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page