Skip to main content

Wrapper around h5py to give easier interface around complex files.

Project description

yoki5

License PyPI Python Version CI codecov

Overview

A simple wrapper around h5py to give easier interface around complex HDF5 files.

This library is designed to simplify the process of reading and writing HDF5 files by providing several methods that make it easy to add/remove datasets or groups.

Getting started

import numpy as np
from yoki5.base import Store
from scipy.sparse import csr_matrix

# Create a new HDF5 file
store = Store('path/to/file.h5')
store.add_data_to_group(
    "group-1",
    {"data": np.random.rand(100, 100)},
    {"attribute": "value"},
    compression="gzip",
    chunks=(10, 10),
)
# Retrieve the array
array = store.get_array("group-1", "data")

# Add sparse matrix
store.add_data_to_group(
    "group-2",
    csr_matrix(np.random.randint(0, 255, (100, 100))),
    {"attribute": "value"},
)
# Retrieve the data
matrix = store.get_sparse_array("group-2")

Contributing

Contributions are always welcome. Please feel free to submit PRs with new features, bug fixes, or documentation improvements.

git clone https://github.com/lukasz-migas/yoki5.git

pip install -e .[dev]

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

yoki5-0.1.0.tar.gz (22.4 kB view hashes)

Uploaded Source

Built Distribution

yoki5-0.1.0-py3-none-any.whl (16.1 kB view hashes)

Uploaded Python 3

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