npyz
NumPy file format (de-)serialization. Fork of outdated npy-rs.
0.9.1
7.0M downloads/mo
#3785 most downloaded on crates.io
ExpHP/npyz
What this package is like to depend on
Last release 3 months ago
02 May 2026
Ships unpredictably
gaps range from 2 weeks to 1.4 years
Nearly every release is documented
notes for 14 of 15 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
15 releases · first in 2021
2 releases in the last 12 months
see the full history below
Release timeline
15 releases · Jul 2021 to May 2026
2022
2023
2024
2025
2026
Releases
latest 15-
0.9.102 May 2026Release notes
Open source →Added
WriterBuilder::begin_2d. Similar tobegin_1d, this allows the second dimension to be inferred based on the number of items written. Thanks, @Yomguithereal!
-
0.9.015 Apr 2026Release notes
Open source →Changed
- The
T: Serializebound has been removed from theWriterBuildertrait. This may introduce places in downstream code where aT: npyz::Serializebound must now be explicitly added.
Added
- Limited support for pickled arrays. See
examples/pickle.rs. Thanks, @paroga!TypeChar::Object(numpy's"|O"){TypeStr, DType NpyHeader}::uses_pickled_array()boolean function.NpyFilecan open files with pickled arrays, but it cannot extract items.WriteOptions::new_header_only,WriterBuilder::write_header_onlymakes it possible to write headers wwith object dtypes.
- The
-
0.8.415 May 2025Release notes
Open source →Changed
- Bug fix:
impl AutoSerialize for Complexnow properly generates typesc8andc16instead ofc4andc8. Thanks @calder! - Bug fix: The public dependency
zipis now properly re-exported. Fixes some warnings generated by the#[derive(...)]macros in newer rust versions.
- Bug fix:
-
0.8.323 Dec 2023Release notes
Open source →Added
- The
"npyz"feature is now supported when building for webassembly. Thanks, @KeKsBoTer!
- The
-
0.8.203 Dec 2023Release notes
Open source →Added
- npyz now has support for half-precision floats using the
halfcrate. This support can be enabled with the"half"feature. Thanks, @KeKsBoTer!
- npyz now has support for half-precision floats using the
-
0.8.105 Jun 2023Release notes
Open source →Added
- npyz now has experimental support for WASM. Thanks, @bluenote10! Not all cargo features are supported/tested yet; please see this issue.
-
0.8.004 Apr 2023Release notes
Open source →Added
- Added
NpyHeaderwhich is a more lightweight form ofNpyFilethat isn't a read adapter. You could use this for instance to parse multiple raw data streams using the same header.
Changed
- Some of the methods on
NpyFilehave been moved toNpyHeader, and are now accessed viaDeref. If you have been using UFCS to call these methods, you may need to update those callsites.
- Added
-
0.7.401 Feb 2023Release notes
Open source →Added
npyznow usespy_literalto parse the NPY header, allowing it to support a far greater amount of syntax than before. Thanks @sudo-carson!- String metacharacters like
'in structured array member names are now properly escaped when writing files. - Dimensions of length 0 in an array member of a structured array are now permitted. (e.g.
dtype=[('a', '>i4', (4,0,4))]).
-
0.7.323 Dec 2022Release notes
Open source →Changed
- Writers are now flushed when
.finish()is called. Thanks @sirno!
- Writers are now flushed when
-
0.7.206 Dec 2022 -
0.7.120 Sep 2022Release notes
Open source →Changed
- Fixes some warnings generated by the
#[derive(...)]macros in newer rust versions. - These changes were part of 0.8.4, but I hadn't released a new npyz-derive! My apologies.
- Fixes some warnings generated by the
-
0.7.027 Aug 2022Release notes
Open source →Added
- Added serialization and deserialization for the
Utype. Supported rust types areVec<char>,Vec<u32>, andString(and, of course,[char],[u32], andstrfor serialization). - Added support for the
atype, which is just an alias ofS. - Added the
FixedSizeByteswrapper type around[u8; N], which enables deserialization of typeVwithout individual allocations per element. - Added the
arrayvecfeature. This enables deserialization of typesUandSwithout individual allocations per element. (thanks to @m-dupont for the initial implementation) NpyReader::shapeandNpyReader::dtypeaccessors, for downstream code without access to anNpyFile.- Exposed various data from
TypeStr. New types includeEndianness,TypeChar, andTimeUnitstypes.TypeStrnow has getters to extract these fields. (thanks to @Shatur for requesting this)
Changed
np.datetime64now uses i64 instead of u64 for serialization, as it is defined to use a symmetric interval around the epoch.DType::num_byteshas been changed to returnOption<usize>, rather than panicking when the described datatype is too large to fit in the target platform'susizetype.
- Added serialization and deserialization for the
-
0.6.107 Jul 2021Nothing published for this version
-
0.6.006 Jul 2021Release notes
Open source →Added
- This CHANGELOG.
- Tools for NPZ files and scipy sparse matrices, and the associated
"npz"feature. - Nested structs inside array fields of a structured array now work.
NpyWriternow allowsT: ?Sized.
Changed
- In order to fix nested structs inside array fields, the layout of
DTypehad to be changed by removingshapefromDType::Plainand adding a newDType::Arrayvariant. NpyReaderwas split into two types: You now start by creating anNpyFile(which is NOT parameterized overT), which can then be turned into anNpyReader. The purpose of the split is to permit code to make multiple attempts to deserialize into different rust types. (e.g. indices in sparse NPZ files may be eitheri32ori64)Builderwas changed to a typestate API in order to avoid some runtime panics and to better accomodate NPZ. Generally speaking:- Code that writes NPY/NPZ files now typically has to
use npyz::WriterBuilder;. - Calls to
npyz::Builder::new()should now benpyz::WriteOptions::new(). begin_1d(),begin_nd()no longer take arguments. There are now.shape(shape)and and.writer(writer)methods that must be called to provide these things.
- Code that writes NPY/NPZ files now typically has to
-
0.5.002 Jul 2021Release notes
Open source →Added
- Initial release of the fork. The version started at 0.5.0 to indicate that this
version is a breaking change from 0.4.0 of the original
npy. - Adds multidimensional arrays. Hallelujah.
- Adds byteslice and complex types.
- Adds big endian support.
- Adds
NpyReaderfor reading from anio::Read - Adds
BuilderandNpyWriterfor writing to anio::Write
- Initial release of the fork. The version started at 0.5.0 to indicate that this
version is a breaking change from 0.4.0 of the original