Skip to main content

Stores NumPy arrays in a way that is self-documented and tool-independent.

Project description

Github CI Status Appveyor Status PyPi version Conda Forge Codecov Badge Docs Status Zenodo Badge

Darr is a Python science library that allows you to work efficiently with potentially very large, disk-based Numpy arrays that are widely readable and self-documented. Documentation includes copy-paste ready code to read arrays in many popular data science languages such as R, Julia, Scilab, IDL, Matlab, Maple, and Mathematica, or in Python/Numpy without Darr. Without exporting them and with minimal effort.

Universal readability of data is a pillar of good scientific practice. It is also generally a good idea for anyone who wants to flexibly move between analysis environments, who wants to save data for the longer term, or who wants to share data with others without spending much time on figuring out and/or explaining how the receiver can read it. No idea how to read your 7-dimensional uint32 numpy array in Matlab to quickly try out an algorithm your colleague wrote? No worries, a quick copy-paste of code from the array documentation is all that is needed to read your data in, e.g. R or Matlab (see example). As you work with your array, its documentation is automatically kept up to date. No need to export anything, make notes, or to provide elaborate explanation. No looking up things. No dependence on complicated formats or specialized libraries for reading you data elsewhere later.

In essence, Darr makes it trivially easy to share your numerical arrays with others or with yourself when working in different computing environments, and stores them in a future-proof way.

More rationale for a tool-independent approach to numeric array storage is provided here.

Under the hood, Darr uses NumPy memory-mapped arrays, which is a widely established and trusted way of working with disk-based numerical data, and which makes Darr fully NumPy compatible. This enables efficient out-of-core read/write access to potentially very large arrays. In addition to automatic documentation, Darr adds other functionality to NumPy’s memmap, such as easy the appending and truncating of data, support for ragged arrays, the ability to create arrays from iterators, and easy use of metadata. Flat binary files and (JSON) text files are accompanied by a README text file that explains how the array and metadata are stored (see example arrays).

See this tutorial for a brief introduction, or the documentation for more info.

Darr is currently pre-1.0, still undergoing development. It is open source and freely available under the New BSD License terms.

Features

  • Data is stored purely based on flat binary and text files, maximizing universal readability.

  • Automatic self-documention, including copy-paste ready code snippets for reading the array in a number of popular data analysis environments, such as Python (without Darr), R, Julia, Scilab, Octave/Matlab, GDL/IDL, and Mathematica (see example array).

  • Disk-persistent array data is directly accessible through NumPy indexing and may be larger than RAM

  • Easy and efficient appending of data (see example).

  • Supports ragged arrays.

  • Easy use of metadata, stored in a widely readable separate JSON text file (see example).

  • Many numeric types are supported: (u)int8-(u)int64, float16-float64, complex64, complex128.

  • Integrates easily with the Dask library for out-of-core computation on very large arrays.

  • Minimal dependencies, only NumPy.

Limitations

  • No structured (record) arrays supported yet, just ndarrays

  • No string data, just numeric.

  • No compression, although compression for archiving purposes is supported.

  • Uses multiple files per array, as binary data is separated from text documentation and metadata. This can be a disadvantage in terms of storage space if you have very many very small arrays.

See the documentation for more information.

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

darr-0.6.0.tar.gz (67.9 kB view details)

Uploaded Source

Built Distribution

darr-0.6.0-py3-none-any.whl (55.6 kB view details)

Uploaded Python 3

File details

Details for the file darr-0.6.0.tar.gz.

File metadata

  • Download URL: darr-0.6.0.tar.gz
  • Upload date:
  • Size: 67.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.4

File hashes

Hashes for darr-0.6.0.tar.gz
Algorithm Hash digest
SHA256 bf2e608bbcf7bfc7835a1066e5e8fed8394abd2be50dad3e6e40d8d171e40c00
MD5 b96863b7609cadd7edd2f04f861fbcba
BLAKE2b-256 410ae44a7a08837f8769bba15bd07348b22a603c08618ad32be06a4eab9d7d22

See more details on using hashes here.

File details

Details for the file darr-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: darr-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 55.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.4

File hashes

Hashes for darr-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b4f07aa0826a0c5fd3b9bb8cbbdfad4595591487b9a050b6c7bf58c20eef2994
MD5 15f84ea5c3032f1ab9343163a8babcad
BLAKE2b-256 9a6df044828a4e490031b6be2c7fc29a80ad510fd5c7031830c758504f733c9e

See more details on using hashes here.

Supported by

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