netcdf

Library Featured

High-level NetCDF bindings for Rust

Checked · Sources

Downloads
22,481
Dependents
29
Stars
106
Forks
30
Contributors
18
Commits
620
Latest release
0.12.1 ·

About

From the project README ·

Medium-level netCDF bindings for Rust, allowing easy reading and writing of array-like structures to a file. netCDF can read and write hdf5 files, which is a commonly used file format in scientific computing.

Status

Supported:

  • Variables
  • Normal Dimensions
  • Attributes
  • Subgroups
  • Open/Append/Create modes
  • Reading from memory
  • Unlimited dimensions
  • User defined types, using the feature derive (enum, compound, other types requires additional work)

Not (yet) supported (PRs welcome):

  • Writing using memory-mapped file

All variable data is read into a contiguous buffer, or into an ndarray if the ndarray feature is activated.

Building

This crate depends on the C library netcdf-c which must be installed on the machine, along with libraries such as hdf5 which netcdf-c depends on. For some platforms you might have to set the environment variable NETCDF_DIR which needs to point at the installation of netcdf-c you wish to use.

An alternative to using the system libraries is to enable static feature of this crate (cargo add netcdf --features static), which compiles libnetcdf from source. The static feature requires cmake, a c++ compiler and more to be installed on the build machine.

Read the full README

The crate is built on several platforms using github actions, and is currently known to build form from source on all major platforms (linux, macos, windows (gnu+msvc)), and through the package installers conda and apt. Please see the github workflows for tips on how to install netcdf.

Building libnetcdf statically
  1. git clone https://github.com/georust/netcdf
  2. git submodule update --init --recursive
  3. cargo build --features static

Documentation

Some examples of usage can be found in the tests/lib.rs file. The documentation can also be generated using cargo doc.

Thread safety

The netcdf crate is thread-safe, although the netcdf-c library is not itself threadsafe. To render a safe interface, a global mutex is used to serialize access to the underlying library. Consider using a non threadsafe version of hdf5 to avoid double locking (performance consideration).

Use of netcdf-sys is not thread-safe. Users of this library must take care that calls do not interfere with simultaneous use of e.g. netcdf or hdf5-sys. Use the lock provided by netcdf-sys to serialise access to the hdf5 and netCDF libraries.

License

Licensed under either of

  • Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Runs on
GPU support unknown
What shows it
  • no dependency or feature matches a backend row
Native code
Required
  • Binds native code: netcdf-sys, hdf5-metno-sys, libz-sys, mpi-sys (feature mpi)
Python bindings
No Python binding crate found
License
Apache-2.0 OR MIT

Compare with similar projects

Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days. ML Rust runs this catalogue, so its closest project always gets a row.

netcdf beside the projects that share a topic with it
ProjectDownloadsDependentsStarsLatest releaseRuns on (GPU)Native codeLicense
netcdf This page Featured

High-level NetCDF bindings for Rust

22,481 downloads over 30 days 29 106 0.12.1 GPU support unknown Binds native code: netcdf-sys, hdf5-metno-sys, libz-sys, mpi-sys (feature mpi) Apache-2.0 OR MIT
arrow-rs Featured

Rust implementation of Apache Arrow

Python bindings

10,746,755 downloads over 30 days 2,126 3,664 60.1.0 GPU support unknown Binds native code: ring (feature encryption), liblzma-sys (feature default), zstd-sys (feature default) Apache-2.0
lance Featured

A columnar data format that is 100x faster than Parquet for random access.

915,526 downloads over 30 days 48 7,268 14.0.2 GPU support unknown Binds native code: ring (feature credential-vendor-gcp), lz4-sys (feature lz4), zstd-sys (feature zstd). Build uses a native toolchain: cc Apache-2.0
hdf5-rust Featured

Thread-safe Rust bindings for the HDF5 library.

253,180 downloads over 30 days 70 85 0.15.1 GPU support unknown Binds native code: hdf5-metno-sys, blosc-src (feature blosc), lzf-sys (feature lzf), mpi-sys (feature mpio), zfp-sys (feature zfp) Apache-2.0 OR MIT
dlpark Listed

Pure Rust DLPack implementation for zero-copy tensor interoperability

Python bindings

68,157 downloads over 30 days 5 66 0.10.0 CUDA No native code found Apache-2.0

Pure-Rust NetCDF-3 classic and NetCDF-4 (HDF5-backed) file reader

36,012 downloads over 30 days 10 11 0.12.1 GPU support unknown No native code found Apache-2.0 OR MIT
compressr App New

Model conversion and quantization with no Python: reads SafeTensors, GGUF, TCF and PyTorch state dicts, writes SafeTensors, GGUF and TCF, and quantizes to Q2_K through Q8_0 and IQ4 formats, including Q4_K_M mixes. GPTQ, AWQ, NF4, FP8, EXL2 and ONNX input are not implemented.

Python bindings

23 downloads over 30 days Not applicable 0 0.2.1 GPU support unknown No native code found Apache-2.0
Why FeaturedIt passes every Featured gate.

What it meets

  • It has 18 active dependents and 16 new dependents in 365 days. Featured needs 11 active dependents or 9 new dependents in 365 days.
  • Active dependents are at 100% of their peak. Featured needs at least 50%.
  • Docs are present. The release commit or a manifest ties the crate to the repository.
  • No vulnerability advisory stays unpatched past the grace window. At least one version is neither a prerelease nor 0.0.x.
  • The last activity is on 19 Sep 2026, 51 days ago. The rules expect an update within 600 days. Dormancy rule

Exact rules: Featured library. The check on applied thresholds version 9.

Every rule outcome, as the check records it
  • expected-interval: version 0.12.1 base 300, doubled for 18 active users: E = 600 days
  • dormancy: last activity 2026-09-19, 51 days ago, E = 600: active
  • featured: featured: active_users 18, new_adopters 16, former_glory 1

Measurements and sources

Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.

Sources6 sources
Adoption18 active dependents, 16 new dependents in 365 days1 not measured
Adoption measurements
SignalValueSourceFetchedCounts
Active dependents18crates.io database dumpYes
New dependents (365 days)16crates.io database dumpYes
Peak active dependents18crates.io database dumpYes
Active dependents as a share of the peak1crates.io database dumpYes
Binary downloads per releaseNot measuredYes
MaintenanceLatest human commit: 51 days ago3 not measured
Maintenance measurements
SignalValueSourceFetchedCounts
Latest human commit2026-09-19GitHub repositoryYes
Latest release2026-07-26crates.io database dumpYes
First release2015-06-27crates.io database dumpYes
Latest version0.12.1crates.io database dumpYes
Days the oldest outside issue waits for a reply0GitHub repositoryYes
Maintainer replies over 365 days13GitHub repositoryYes
Repository archivedfalseGitHub repositoryYes
Repository gonefalseGitHub repositoryYes
Release commit or manifest in the repotruecrates.io packageYes
Published docstruecrates.io database dumpYes
Latest release fails cargo checkNot measuredYes
Build check dateNot measuredYes
Build check toolchainNot measuredYes
SecurityUnpatched vulnerabilities: none
Security measurements
SignalValueSourceFetchedCounts
Unpatched vulnerabilities past the grace windownoneRustSec advisory databaseYes
RustSec unmaintained advisorynoneRustSec advisory databaseYes
Deprecation noticenonecrates.io database dumpYes
Deprecated requirementnonecrates.io database dumpYes
Distribution31 releases, 22,481 downloads over 30 days5 not measured
Distribution measurements
SignalValueSourceFetchedCounts
Releases31crates.io database dumpYes
Downloads over 30 days22481crates.io database dumpYes
Binary downloads over the last 3 releasesNot measuredYes
Homebrew installs on request over 365 daysNot measuredYes
Repology repository familiesNot measuredYes
Docker pull growth over 90 daysNot measuredYes
Docker pulls at the growth baselineNot measuredYes
Every version a prereleasefalsecrates.io database dumpYes
Every version 0.0.xfalsecrates.io database dumpYes
Every version yankedfalsecrates.io database dumpYes
Crate deleted from crates.iofalsecrates.io database dumpYes
Repository106 stars, 30 forks, 18 contributors, 620 commits. Stars alone never qualify a project.
Repository measurements
SignalValueSourceFetchedCounts
GitHub stars106GitHub repositoryYes — one part of the repository route
GitHub forks30GitHub repositoryYes — one part of the repository route
Contributors with a GitHub account18GitHub contributorsYes — one part of the repository route
Commits on the default branch620GitHub repositoryNo
Repository's main crate left out of the entrynonecrates.io database dumpYes
Facts that never count
Facts that never count measurements
SignalValueSourceFetchedCounts
LicenseApache-2.0 OR MITcrates.io database dumpNo
Runs on, from listed crates and their direct dependenciesGPU support unknowncrates.io database dumpNo
What shows each backendno dependency or feature matches a backend rowcrates.io database dumpNo
Native code, from listed crates and their dependenciesBinds native code: netcdf-sys, hdf5-metno-sys, libz-sys, mpi-sys (feature mpi)crates.io database dumpNo
Python bindings, from direct dependencies of listed cratesNo Python binding crate foundcrates.io database dumpNo
Crates that depend on a listed crate directly29crates.io database dumpNo

Corrections and review history

Report a correction

No correction applies to this entry.

Judgments

A judgment enters only through an approved issue and a merged pull request.

No judgment applies to this entry.