Skip to main content

Minimalist h5 Python logger

h5logger is a minimalist logger that allows to continuously save arbitrary quantities into h5 files. The logger automatically create/open/close h5 files and append data as a stream whenever the user calls the log method of the logger class. Only dependancy requirement is h5py.

Walkthrough example

Here is a simple example to store different realisation of random variables:

import numpy as np
from h5logger import h5logger


# set seed for reproducibility
np.random.seed(0)

# create the logger that will save the continuous
# stream of data into the logging_data.h5 file
logger = h5logger("logging_data.h5")

for i in range(10):
    number = np.random.randint()

    # save the number realisation into the `number`
    # variable, any string can be used for name
    logger.log('number', number)

# all the data is now into the h5 file which can be
# access as desired by the user
# h5logger has some built-in reading functions
with logger.open() as data:
    print(data['accu'])
    #


Minimalist Python logger/saver storing continuous stream of data into h5 files

Why the h5 format?

h5 files have many advantages:

  • big data friendely: h5py does not return an in-memory numpy array. Instead it returns something that behaves like it, hence accessing different chunks of data from any saved quantity can be done near instantly even though the entire dataset might be humongously large. Have a look at the h5py introduction for more information.

  • suited for saving streaming data: because h5 supports saving data per chunk, it is extremely well suited to dynamically expand dataset and insert new observations, i.e., it efficiently deals with saving streams of data

  • command-line monitoring: another great advantage of h5 files is their ability to be monitored from a terminal with simple command-line e.g. h5ls logging_data.h5. This is a crucial feature to easily monitor (locally and remotely) the logging status. For a list of commands see this guide (requires hdf5 package which can be installed with anaconda/brew/apt)

Metadata

Release files for h5logger 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for h5logger 0.0.1
File Size Uploaded Provenance
h5logger-0.0.1.tar.gz 2.8 kB Without provenance Details

Release files / h5logger-0.0.1.tar.gz

Download URL h5logger-0.0.1.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
409c8f2ec5d31534b91c9cc85fdf8c830f855d902eb00b60a5b2e9d56f469a62
BLAKE2b-256 checksum
How to use checksums
a0f2f6b9fde491a2af020d58849e4d1545df0df28dd2a910e54fc1a0a14a0980
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8

Security for h5logger 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page