npyz

Library Featured

NumPy file format (de-)serialization. Fork of outdated npy-rs.

Checked · Sources

Downloads
467,634
Dependents
36
Stars
33
Forks
11
Contributors
10
Commits
259
Latest release
0.9.1 ·

About

From the project README ·

Numpy format (*.npy) serialization and deserialization.

NPY is a simple binary data format. It stores the type, shape and endianness information in a header, which is followed by a flat binary data field. This crate offers a simple, mostly type-safe way to read and write *.npy files. Files are handled using iterators, so they don't need to fit in memory.

npyz is a fork and successor of the seemingly-dead npy.

API Documentation on docs.rs

Usage

[dependencies]
npyz = "0.9"

You also may be interested in enabling some features:

[dependencies]
npyz = {version = "0.9", features = ["derive", "complex", "npz", "arrayvec", "half"]}

Data can now be read from a *.npy file:

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let bytes = std::fs::read("test-data/plain.npy")?;

    // Note: In addition to byte slices, this accepts any io::Read
    let npy = npyz::NpyFile::new(&bytes[..])?;
    for number in npy.data::<f64>()? {
        let number = number?;
        eprintln!("{}", number);
    }
    Ok(())
}

For further examples and information on:

  • Reading npy files,
  • Writing npy files,
  • Working with structured arrays,
  • Interop with the ndarray crate,
  • NPZ files and scipy sparse matrices,
Read the full README

please see the documentation on the root module.

Relation to similar crates

The name npyz is actually an abbreviation. Here is the full name of the crate:

npy plus npz support, and a lot of other features that are frankly a lot more important than npz—not to mention the fact that npz support isn't even actually included in the first release—but I had to call it something, okay

To clarify, npyz is a fork of Pavel Potoček's npy crate. The original npy supported structured arrays with derives, but had many, many limitations.

Compared to npy, npyz has:

  • Support for multidimensional arrays.
  • Support for big endian files.
  • Support for Complex, strings and bytestrings.
  • A more versatile reading API based on std::io::Read, so you can read directly from e.g. a zip::read::ZipFile. The original API required a &[u8], with the expectation that a user can use a memmap for large files.
  • Writing APIs based on std::io::Write.

Originally, nippy npyz was a place for me to protype new features with reckless abandon before finally making a PR to npy, but even my first few foundational PRs have yet to be merged upstream. I believe Pavel has a good head on their shoulders and a great attention to detail, and I appreciated their initial response on my PRs, but nearly two years have passed since the last time I have heard from them. Therefore, I've decided to go forward and publish the fork.

License

npyz is Copyright 2021 Michael Lamparski, and provided under the terms of the MIT License.

npyz is based off of npy. npy is Copyright 2018 Pavel Potoček, which was provided under the terms of the MIT License.

Runs on
GPU support unknown
What shows it
  • no dependency or feature matches a backend row
Native code
None found
  • No native code found
Python bindings
No Python binding crate found
License
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.

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

NumPy file format (de-)serialization. Fork of outdated npy-rs.

467,634 downloads over 30 days 36 33 0.9.1 GPU support unknown No native code found MIT
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
ndarray-npy Featured

.npy and .npz file format support for ndarray

560,950 downloads over 30 days 99 71 0.10.0 GPU support unknown No native code found Apache-2.0 OR MIT
zarrs Featured

A library for the Zarr storage format for multidimensional arrays and metadata

75,052 downloads over 30 days 51 285 0.23.14 GPU support unknown Binds native code: blosc-src (feature blosc), gdeflate-sys (feature gdeflate), zfp-sys (feature zfp), zstd-sys (feature zstd) Apache-2.0 OR MIT
vortex Listed

An extensible, state-of-the-art framework for columnar compression, and the fastest FOSS columnar file format. Formerly at @spiraldb, now an Incubation Stage project at LFAI&Data, part of the Linux Foundation.

98,129 downloads over 30 days 32 3,310 0.93.0 GPU support unknown Binds native code: zstd-sys Apache-2.0

Pure Rust implementation of the HDF5 file format

801 downloads over 30 days 5 5 0.3.10 GPU support unknown No native code found BSD-3-Clause
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 32 active dependents and 28 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 3 May 2026, 190 days ago. The rules expect an update within 1200 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.9.1 base 300, doubled for 467634 downloads per month, doubled for 32 active users: E = 1200 days
  • dormancy: last activity 2026-05-03, 190 days ago, E = 1200: active
  • featured: featured: active_users 32, new_adopters 28, 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
Adoption32 active dependents, 28 new dependents in 365 days1 not measured
Adoption measurements
SignalValueSourceFetchedCounts
Active dependents32crates.io database dumpYes
New dependents (365 days)28crates.io database dumpYes
Peak active dependents31.5crates.io database dumpYes
Active dependents as a share of the peak1crates.io database dumpYes
Binary downloads per releaseNot measuredYes
MaintenanceLatest human commit: 6 months ago3 not measured
Maintenance measurements
SignalValueSourceFetchedCounts
Latest human commit2026-05-03GitHub repositoryYes
Latest release2026-05-02crates.io database dumpYes
First release2021-07-02crates.io database dumpYes
Latest version0.9.1crates.io database dumpYes
Days the oldest outside issue waits for a reply67GitHub repositoryYes
Maintainer replies over 365 days29GitHub 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
Distribution15 releases, 467,634 downloads over 30 days5 not measured
Distribution measurements
SignalValueSourceFetchedCounts
Releases15crates.io database dumpYes
Downloads over 30 days467634crates.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
Repository33 stars, 11 forks, 10 contributors, 259 commits. Stars alone never qualify a project.
Repository measurements
SignalValueSourceFetchedCounts
GitHub stars33GitHub repositoryYes — one part of the repository route
GitHub forks11GitHub repositoryYes — one part of the repository route
Contributors with a GitHub account10GitHub contributorsYes — one part of the repository route
Commits on the default branch259GitHub repositoryNo
Repository's main crate left out of the entrynonecrates.io database dumpYes
Facts that never count
Facts that never count measurements
SignalValueSourceFetchedCounts
LicenseMITcrates.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 dependenciesNo native code foundcrates.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 directly36crates.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.