Skip to main content

Memory-mapped .npz files.

Project description

mmnpz

PyPI: Version Documentation Tests License: MIT

mmnpz is a small Python package for handling large .npz files. .npz files are uncompressed zip files containing numpy arrays. mmnpz unlocks their potential as an efficient, standardized option for storing and accessing large datasets.

Installation

mmnpz is available on PyPI. To install the latest release, run:

pip install mmnpz

Usage

mmnpz can write large .npz files incrementally:

>>> import numpy as np
>>> import mmnpz
>>> with mmnpz.NpzWriter("test.npz") as f:
>>>     for i in range(10):
>>>         f.write(f"a{i}", np.full(10000, i))

mmnpz can read large .npz files as memory maps:

>>> import mmnpz
>>> x = mmnpz.load("test.npz")
>>> x["a2"][10:15]
memmap([2, 2, 2, 2, 2])

This allows accessing individual excerpts of large datasets without I/O overhead.

Documentation

The documentation is hosted on readthedocs.

Acknowledgements

The package layout and toolchain is based on Ai2's Python package template, Microsoft's Python package template and pytest's Python package. The package was developed at the Institute of Computational Perception, Johannes Kepler University Linz.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mmnpz-1.0.0.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mmnpz-1.0.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file mmnpz-1.0.0.tar.gz.

File metadata

  • Download URL: mmnpz-1.0.0.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for mmnpz-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b4a6909c0bd728fa6d710c2edb2cdd6e567fa1942fe55c4fae0b8ce8422baad9
MD5 ea3dfd5ba6bf85a3ae617a79ad142eae
BLAKE2b-256 66a55cfd8b6d70faeea6b830843158d8f2415de7e08e79894fff754c6461e553

See more details on using hashes here.

Provenance

The following attestation bundles were made for mmnpz-1.0.0.tar.gz:

Publisher: pypi.yml on f0k/mmnpz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mmnpz-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: mmnpz-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for mmnpz-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 70683c12bd06dd02f320f2cb555226183a6d61e3c5769b4e8c59d3dd4433301e
MD5 38abc6f8e51e6eece4e09e7a22110113
BLAKE2b-256 ccd7cf59916921d7042708fdb6a8230575ba900182aa428e384c890bbb10c5d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for mmnpz-1.0.0-py3-none-any.whl:

Publisher: pypi.yml on f0k/mmnpz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page