NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #2132 most downloaded on PyPI
Provides an object-oriented python interface to the netCDF version 4 library
Last release 8 months ago
05 Jan 2026
Release timing varies
gaps range from 2 weeks to 12 months
Most releases are documented
notes for 39 of the last 60 stable releases
2 versions withdrawn
withdrawn after publishing
20 years old
88 releases · first in 2006
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
raise ImportError if netcdf-4 < 4.1.1 or hdf5 <= 1.8.4.
raise ImportError if netcdf-4 < 4.1.1 or hdf5 <= 1.8.4.
add netcdf4libversion and hdf5libversion module variables.
make sure data is not truncated to integers before scale_factor and add_offset is applied (issue 46).
fix bug in date2num with noleap calendar in netcdftime (issue 45).
fix bug in 360day calendar in netcdftime (issue 44).
python 2.4 compatibility restored (by modifying OrderedDict). Fixes issue 37.
make sure int64 attributes cast to int32 when format=NETCDF4_CLASSIC. This was causing tst_multifile.py to fail on 64-bit platforms.
fix tutorial.py to cast 64 bit integers to 32 bit when writing to 32-bit integer vlen (was causing tutorial.py to fail on 64-bit platforms).
remove nose dependency from tst_netcdftime.py.
fixed bug (issue 30) with date2index occurring with dates outside the support.
fixed bug (issue 30) with date2index occurring with dates outside the support.
make sure that auto masking works with MFDataset.
fix bug (issue 34) when slicing MFDataset variables with dimensions of length 1.
used ordered dictionaries for variables, dimensions, groups etc to preserve creation order (makes it easier to copy files, fixes issue 28).
change auto_maskandscale default to True. This means data will automatically be converted to and from masked arrays. Data scaled as short integers using the scale_factor and add_offset attributes will also be automatically converted to/from float arrays.
add setncattr, getncattr, delncattr methods (for setting/getting/deleting netcdf attributes with names that clash with the reserved python attributes).
compound type tests re-enabled. Compound and vlen types now fully supported in netcdf-4.1-beta2.
compound type tests re-enabled. Compound and vlen types now fully supported in netcdf-4.1-beta2.
make sure data retrieved from a netCDF variable is not coerced to a python scalar (it should remain a numpy scalar array).
fix docs to point out that an unlimited dimension can be created by setting size to either None or 0 in createDimension.
fix another slicing corner case.
remove auto pickling/unpickling into vlen strings (too cute, sometimes produced surprising results).
added 'cmptypes' and 'vltypes' Group/Dataset attributes, which contain dictionaries that map the names of compound and vlen types to CompoundType and
added 'cmptypes' and 'vltypes' Group/Dataset attributes, which contain dictionaries that map the names of compound and vlen types to CompoundType and VLType instances.
Experimental variable-length (vlen) data type support added.
changes to accommodate compound types in netcdf-4.1-beta snapshots. Compound types now work correctly for snapshots >= 20090603.
Added len method and 'size' property to Variable class.
In date2index, replaced the brute force method by the bisection method and added a 'select' keyword to find the index of the date before, after or nearest the given date.
Fixed bug occurring when indexing with a numpy array of length 1.
Fixed bug that occurred when -1 was used as a variable index.
enabled 'shared access' mode for NETCDF3 formatted files (mode='ws', 'r+s' or 'as'). Writes in shared mode are unbuffered, which can improve performance for non-sequential access.
fixed bug in renameVariable that caused failure when new name is longer than old name, and file format is NETCDF3_64BIT or NETCDF3_CLASSIC.
added 'stringtoarr' utility function for converting python strings to numpy character arrays of a specified size.
added 'stringtoarr' utility function for converting python strings to numpy character arrays of a specified size.
initial support for compound data types (which are mapped to structured numpy arrays). Compound data types are created with the createCompoundTYpe Dataset or Group method. Both attributes and variables can be compound types.
make sure 64-bit integer attributes converted to 32 bits when writing to a NETCDF3 formatted file.
added nc4tonc3 utility for converted NETCDF4_CLASSIC files to NETCDF3_64BIT files (useful for sharing data with colleagues that don't have netcdf-4 capable clients).
David Huard reworked fancy indexing - it is now much more efficient and less of a memory hog. Now works differently than numpy fancy indexing - 1d arr
David Huard reworked fancy indexing - it is now much more efficient and less of a memory hog. Now works differently than numpy fancy indexing - 1d arrays of boolean or integer indices work independently on each dimension. This enables things like:
tempdat = temp[[0,1,3],lats>0,lons>0] (retrieves 1st, 2nd and 4th levels, all Northern Hem. and Eastern Hem. grid points - note that this would raise an IndexError in numpy)
added opendap test (tst_dap.py).
bugfix for nc3tonc4 utility.
fix MFDataset.Variable. getattr to raise AttributeError instead of KeyError when attribute not found.
netcdftime version number upped to 0.7.
added date2index function, courtesy of David Huard, which finds the indices in a netCDF time variable corresponding to a sequence of datetime instance
added date2index function, courtesy of David Huard, which finds the indices in a netCDF time variable corresponding to a sequence of datetime instances.
make _get_att/_set_att raise AttributeError instead of RuntimeError, so that getattr(object, 'nonexistantattribute', None) works. (thanks David Huard)
v[:] = data now works along unlim dim, i.e. you can do this:
file = Dataset('test.nc', "w") file.createDimension("time", None) # unlimited dimension var = file.createVariable("var", 'd', ("time",))
#var[0:10] = numpy.arange(10)
var[:] = numpy.arange(10)
return a scalar array, not a python scalar, when a slice returns a single number. This is more consistent with numpy behavior, and fixes a bug in MFDa
ensure all arithmetic is done with float64 in netcdftime (Rob Hetland).
MFnetCDF4 module merged into netCDF4 and netCDF3 (now called MFDataset).
added 'endian()' and 'chunking()' Variable methods (to inquire about endian and chunking variable settings).
added 'endian()' and 'chunking()' Variable methods (to inquire about endian and chunking variable settings).
'ndim' attribute was not public (so it couldn't be accessed from python). Fixed.
added 'endian' kwarg to createVariable (to set the endian-ness used in the HDF5 file).
can now manually set HDF5 chunksizes for each dimension at variable creation, using 'chunksizes' kwarg to createVariable.
added "getlibversion()" function to get info about version of netcdf-4 library used to build module.
if a variable has an unsupported datatype (such as 'compound', or 'vlen'), then instead of raising an exception, just skip it. Print a useful error message when an attribute with an unsupported datatype is accessed.
if variable dimension is specified as 'dimname' or ('dimname') in createVariable, it is automatically converted to a tuple ('dimname',). Better error messages when specified dimension can't be found.
createVariable accepts numpy dtype object as datatype. dtype variable attribute is now a numpy dtype object.
renamed MFnetCDF4_classic --> MFnetCDF4.
renamed MFnetCDF4_classic --> MFnetCDF4.
eliminated netCDF4_classic module (all file formats handled by netCDF4 module now).
removed all user-defined data type stuff (it was hacky and made the code too complex - wait till there is a real use case to refactor and put back in).
added 'ndim' variable attribute (number of variable dimensions).
passes all tests with netcdf-4.0-beta1/hdf5-1.8.0-beta1.
passes all tests with netcdf-4.0-beta1/hdf5-1.8.0-beta1.
if slice index is not a slice object, assume it's an integer (and try to convert to one if it is not). This allows numpy scalar arrays to work as slice indices.
(netCDF4_classic only) try to make sure file is not left in 'define mode' when exception is raised.
if slicing a variable results in a array with shape (1,), just return a scalar (except for compound types).
added instructions for using the netCDF4_classic module to serve data over http with the DAP using pydap (http://pydap.org).
added --quiet and --chunk options to nc3tonc4.
Turned off zlib compression by default so as not to violate the 'principle of least surprise'. Shuffle filter still activated by default when zlib compression turned on.
Fixed bug in fletcher32 checksum activation call. Renamed compression() variable method to filters(), include fletcher32 checksum flag in output.
added utility for converting GRIB1 files to compressed NETCDF4_CLASSIC files (requires PyNIO).
added 'compression()' variable method that returns a dict with compression filter parameter settings for that variable. (rev 237)
reimplemented 'shape' and 'dimensions' variable attributes as properties.
fixed bug when 'chunking' keyword in createVariable was set to 'sub' (caused Bus Error on MacOS X).
Setting 'shuffle=0' keyword in createVariable was turning off zlib compression filter instead of shuffle filter. Fixed.
updated for compatibility with netcdf-4.0-alpha18 and hdf5 1.8.0alpha5 (shared dimensions actually work now).
updated for compatibility with netcdf-4.0-alpha18 and hdf5 1.8.0alpha5 (shared dimensions actually work now).
netCDF4.createVariable can now use old single character Numeric typecodes for datatype specification.
Improvements to MFDataset (now called MFnetCDF4_classic) by Rob Hetland.
bugfix for empty string attributes.
bugfixes for negative strides.
bugfix for empty string attributes.
support for shared dimensions (variables can use dimensions defined only in a parent group). This doesn't actually work yet, because of a bug in netcdf-4.0-alpha17.
now requires Pyrex (C source files generated on the fly when setup.py is run).
Your coding agent can read these notes before it upgrades. Set up the MCP server →