Package hdf5pickle
[hide private]
[frames] | no frames]

Package hdf5pickle

source code

Create easily interoperable representations of Python objects in HDF5 files. The aim of this module is to provide both

  1. convenient Python object persistence
  2. compatibility with non-Python applications

Point 2 is useful, for example, if results from numerical calculations should be easily transferable for example to a non-Python visualization program, such as Octave. Having a serialized object format that is directly readable saves some hassle in writing custom data dumping routines for each object.

Of course, if your data does not fit into memory, you still need to use full features of PyTables. But, you can still use hdf5pickle for other parts of the data.

This module implements dump and load methods analogous to those in Python's pickle module. The programming interface corresponds to pickle protocol 2, although the data is not serialized but saved in HDF5 files. Additional methods, dump_many and load_many, are provided for loading multiple objects at once, to preserve references.

Data format

The layout of a python object saved to a HDF5 node is described below. The notation is roughly:

type-of-hdf5-node [(array shape), array type)] = what's in it
   .attribute-of-node = what's in it
   child-node

The structure of a node corresponding to a Python object varies, depending on the type of the Python object.




Warning: Although this module passes all relevant pickle unit tests from Python2.4 plus additional tests, it is still in early stages of development.

Bug: At present strings are not stored as HDF5 strings, as PyTables appears to chop them off at '\x00' characters.

Submodules [hide private]

Variables [hide private]
  __version__ = '0.2'

Variables Details [hide private]

__version__

None
Value:
'0.2'