netCDF4
Provides an object-oriented python interface to the netCDF version 4 library
Decision gist · record as of 2026-08-14
Yes, if you work with netCDF files in scientific computing. The package is actively maintained, well-established (since 2006), has no known vulnerabilities, and provides convenient Python access to a standard data format. Install friction is moderate but manageable via precompiled wheels. The single-thread requirement for free-threaded Python is a gotcha only if you use that runtime; standard Python users are unaffected.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires the netCDF C library to be installed on your system; wheels bundle this for most platforms but some Linux distributions may require manual installation of system dependencies.
- Medium install friction due to compiled C library dependency.
- The package is actively maintained with recent releases (1.7.4 in January 2026) and provides precompiled wheels for multiple Python versions (3.10–3.14) and platforms, reducing build complexity.
License · maintenance · safety
MIT (permissive) — MIT license is permissive and imposes minimal restrictions on use, modification, and distribution.
last release 2026-01-05 (221 days) · last repo commit 2026-07-27 · 835 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 4,747,772 downloads/mo, #2,241 on PyPI
Alternatives
Verify before relying
pip install netcdf4
import netCDF4
ds = netCDF4.Dataset('file.nc', 'r')
data = ds.variables['var_name'][:]
ds.close()- Whether the thread-safety warning in the changelog (segfaults with free-threaded Python) affects typical single-threaded workflows.
- Performance characteristics for very large files or high-frequency read/write operations.
- Compatibility with alternative netCDF implementations or non-standard file variants.
What it is and what it does
netcdf4 is a Python wrapper around the netCDF C library that lets you work with netCDF version 4 files—a widely used format in climate, meteorology, and oceanography for storing multidimensional scientific data. It provides an object-oriented API to create, read, and modify netCDF datasets, including support for complex numbers, multiple compression algorithms (zstd, bzip2, blosc via plugins), and quantization for improved compression. The package depends on numpy for array operations, cftime for calendar-aware time handling, and certifi for SSL certificate validation in OpenDAP https URLs.
The library is maintained by Unidata and actively developed; version 1.7.4 (released January 2026) includes compression plugins in wheels, free-threaded Python support, and improved Unicode string handling. It requires Python 3.10 or later and provides precompiled wheels for macOS, Linux, and Windows across multiple architectures. A notable caveat: the underlying netCDF C library is not thread-safe, and while netcdf4-python includes internal locking, the documentation warns that free-threaded Python users must exercise care to call netCDF only from a single thread to avoid segfaults.
Use it for
- Read and analyze climate model output or observational data stored in netCDF format for research or forecasting.
- Create and write multidimensional scientific datasets with compression and metadata for archival or sharing.
- Access remote netCDF files via OpenDAP https URLs for distributed data analysis workflows.
- Convert between netCDF and other formats, or manipulate existing files to add/modify variables and attributes.
- Process time-series data from meteorological or oceanographic instruments using calendar-aware time coordinates.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you work with netCDF files in scientific computing.
The package is actively maintained, well-established (since 2006), has no known vulnerabilities, and provides convenient Python access to a standard data format. Install friction is moderate but manageable via precompiled wheels. The single-thread requirement for free-threaded Python is a gotcha only if you use that runtime; standard Python users are unaffected.
Install
netcdf4 on PyPI
Before you install
Medium install friction due to compiled C library dependency. The package is actively maintained with recent releases (1.7.4 in January 2026) and provides precompiled wheels for multiple Python versions (3.10–3.14) and platforms, reducing build complexity. Repository shows active development with 835 stars.
Requires the netCDF C library to be installed on your system; wheels bundle this for most platforms but some Linux distributions may require manual installation of system dependencies.
License in practice
MIT license is permissive and imposes minimal restrictions on use, modification, and distribution.
Quickstart
pip install netcdf4
import netCDF4
ds = netCDF4.Dataset('file.nc', 'r')
data = ds.variables['var_name'][:]
ds.close()
Verify before relying
- Whether the thread-safety warning in the changelog (segfaults with free-threaded Python) affects typical single-threaded workflows.
- Performance characteristics for very large files or high-frequency read/write operations.
- Compatibility with alternative netCDF implementations or non-standard file variants.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 3 packagescftimecertifinumpy |
| Maintenance | Actively maintained 221 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,747,772 / month, #2,241 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 3 - AlphaIntended Audience :: Science/ResearchOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Libraries :: Python ModulesTopic :: System :: Archiving :: Compression |
Evidence: netcdf4-1.7.4-cp310-cp310-macosx_13_0_x86_64.whl; netcdf4-1.7.4-cp310-cp310-macosx_14_0_arm64.whl; netcdf4-1.7.4-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; netcdf4-1.7.4-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; netcdf4-1.7.4-cp310-cp310-win_amd64.whl; netcdf4-1.7.4-cp311-abi3-macosx_13_0_x86_64.whl; netcdf4-1.7.4-cp311-abi3-macosx_14_0_arm64.whl; netcdf4-1.7.4-cp311-abi3-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; netcdf4-1.7.4-cp311-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; netcdf4-1.7.4-cp311-abi3-win_amd64.whl; netcdf4-1.7.4-cp311-abi3-win_arm64.whl; netcdf4-1.7.4-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; netcdf4-1.7.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; netcdf4-1.7.4-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; netcdf4-1.7.4-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; netcdf4-1.7.4-cp314-cp314t-macosx_13_0_x86_64.whl; netcdf4-1.7.4-cp314-cp314t-macosx_14_0_arm64.whl; netcdf4-1.7.4-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; netcdf4-1.7.4-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; netcdf4-1.7.4-cp314-cp314t-win_amd64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “netcdf file reading writing python”
- netCDF4netcdf4 provides a Python interface to read, write, and manipulate…
- biotrajReads and writes molecular dynamics trajectory files in XTC, TRR,…
- h5netcdfh5netcdf reads and writes netCDF4 files using h5py or h5pyd backends,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also h5netcdf · cfgrib · cftime · hdmf · tables · h5py · earthkit-data · pypcd4 · pydap · arraykit