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.2.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

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

yoki5-0.1.2-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file yoki5-0.1.2.tar.gz.

File metadata

  • Download URL: yoki5-0.1.2.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for yoki5-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ebf7e76434a65a6907a0873de9e884d97d1be50e12a1f7518b0d31606ecfc542
MD5 1c9b6f04164d423987775827269c3b6b
BLAKE2b-256 2940a4ebd2a969fc7abbca553d042be23fdf1fd9397ece4d2eeafb24fd6b599e

See more details on using hashes here.

File details

Details for the file yoki5-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: yoki5-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for yoki5-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e9affbeb4d4ab7b50052f4f4645594089279ca62276ad6f3e266be8ed48ef52c
MD5 745eff7442afb9abb9eb27ded8dc6d2b
BLAKE2b-256 c1c278e862e9e95559390b9e11a507629754654bb4ba45dedef75977d165bf45

See more details on using hashes here.

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