{"id":15043608,"url":"https://github.com/potocpav/npy-rs","last_synced_at":"2025-06-23T18:07:17.035Z","repository":{"id":57645991,"uuid":"84207335","full_name":"potocpav/npy-rs","owner":"potocpav","description":"NumPy file format (de-)serialization in Rust","archived":false,"fork":false,"pushed_at":"2019-07-15T14:57:22.000Z","size":100,"stargazers_count":31,"open_issues_count":12,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T00:29:13.393Z","etag":null,"topics":["numpy","rust","serialization"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/potocpav.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-07T14:17:39.000Z","updated_at":"2024-12-04T08:58:53.000Z","dependencies_parsed_at":"2022-08-27T21:52:08.854Z","dependency_job_id":null,"html_url":"https://github.com/potocpav/npy-rs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/potocpav/npy-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potocpav%2Fnpy-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potocpav%2Fnpy-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potocpav%2Fnpy-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potocpav%2Fnpy-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/potocpav","download_url":"https://codeload.github.com/potocpav/npy-rs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/potocpav%2Fnpy-rs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261528667,"owners_count":23172752,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["numpy","rust","serialization"],"created_at":"2024-09-24T20:49:20.146Z","updated_at":"2025-06-23T18:07:17.000Z","avatar_url":"https://github.com/potocpav.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# npy-rs\n[![crates.io version](https://img.shields.io/crates/v/npy.svg)](https://crates.io/crates/npy) [![Documentation](https://docs.rs/npy/badge.svg)](https://docs.rs/npy/) [![Build Status](https://travis-ci.org/potocpav/npy-rs.svg?branch=master)](https://travis-ci.org/potocpav/npy-rs)\n\nNumpy format (*.npy) serialization and deserialization.\n\n\u003c!-- [![Build Status](xxx)](xxx) --\u003e\n\n\n[**NPY**](https://docs.scipy.org/doc/numpy-dev/neps/npy-format.html) is a simple binary data format.\nIt stores the type, shape and endianness information in a header,\nwhich is followed by a flat binary data field. This crate offers a simple, mostly type-safe way to\nread and write *.npy files. Files are handled using iterators, so they don't need to fit in memory.\n\n## Usage\n\nTo use **npy-rs**, two dependencies must be specified in `Cargo.toml`:\n\n```toml\nnpy = \"0.4\"\nnpy-derive = \"0.4\"\n```\n\nA typical way to import everything needed is:\n\n```rust\n#[macro_use]\nextern crate npy_derive;\nextern crate npy;\n```\n\nThe `npy-derive` dependency is only needed for\n[structured array](https://docs.scipy.org/doc/numpy/user/basics.rec.html)\nserialization.\n\nData can now be imported from a `*.npy` file:\n\n```rust\nuse npy::NpyData;\n\nstd::fs::File::open(\"data.npy\").unwrap().read_to_end(\u0026mut buf).unwrap();\nlet data: Vec\u003cf64\u003e = NpyData::from_bytes(\u0026buf).unwrap().to_vec();\n\n```\n\nand exported to a `*.npy` file:\n\n```\nnpy::to_file(\"data.npy\", data).unwrap();\n```\n\nSee the [documentation](https://docs.rs/npy/) for more information.\n\nSeveral usage examples are available in the\n[examples](https://github.com/potocpav/npy-rs/tree/master/examples) directory; the\n[simple](https://github.com/potocpav/npy-rs/blob/master/examples/simple.rs) example shows how to load a file, [roundtrip](https://github.com/potocpav/npy-rs/blob/master/examples/roundtrip.rs) shows both reading\nand writing. Large files can be memory-mapped as illustrated in the\n[large example](https://github.com/potocpav/npy-rs/blob/master/examples/large.rs).\n\n[Documentation](https://docs.rs/npy/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotocpav%2Fnpy-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpotocpav%2Fnpy-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpotocpav%2Fnpy-rs/lists"}