h5obj (version 0.1)
index
/home/djung/lib/h5obj/__init__.py

This module defines a wrapper for the class h5py.File (and h5py.Group), and
adds to it the ability to store any Python object (including nested and empty
lists and tuples, the None type, user-defined objects etc.) using the concept
of serialization. It uses the cPickle module for objects which fail to convert
properly to one of the default HDF5 datatypes, and when loading strings, it
tries to deserialize it before loading the string the normal way. It also makes
sure that you get back exactly the datatype that you were saving to the HDF5
file (unlike h5py.File, where you usually save a tuple or list, and get back a
numpy.ndarray instead).
 
If in certain situations, the attempt to pickle/unpickle the data is not
wanted, it can be switched off using the attributes "pickle" and "unpickle" of
the classes "Group" and "File".
 
This module depends on the module "h5py". It is available at
"http://www.h5py.org/" under a BSD license.
 
To do:
--> make get-method unpickle (so far it just calls the original get-method)

 
Package Contents
       
tools

 
Classes
       
_abcoll.MutableMapping(_abcoll.Mapping)
Group
File

 
class File(Group)
    Wrapper for h5py.File, using serialization for objects that normally
would not be able to be stored in a HDF5 file.
 
 
Method resolution order:
File
Group
_abcoll.MutableMapping
_abcoll.Mapping
_abcoll.Sized
_abcoll.Iterable
_abcoll.Container
__builtin__.object

Methods defined here:
__enter__(self)
__exit__(self, exc_type, exc_value, exc_traceback)
__init__(self, name, mode=None, driver=None, libver=None, pickle=True, unpickle=True, return_value=True, **kwargs)
close(self)
flush(self)

Data descriptors defined here:
attrs
driver
fid
filename
libver
mode

Data and other attributes defined here:
__abstractmethods__ = frozenset([])
__created__ = '2013-07-07'
__modified__ = '2013-07-18'

Methods inherited from Group:
__contains__(self, name)
__delitem__(self, key)
__getitem__(self, key)
__iter__(self)
__len__(self)
__repr__(self)
__setitem__(self, key, obj)
copy(self, source, dest, name=None)
create_dataset(self, name, shape=None, dtype=None, data=None, **kwargs)
create_group(self, name)
get(self, name, default=None, getclass=False, getlink=False)
require_dataset(self, name, shape, dtype, exact=False, **kwargs)
require_group(self, name)
visit(self, func)
visititems(self, func)

Methods inherited from _abcoll.MutableMapping:
clear(self)
D.clear() -> None.  Remove all items from D.
pop(self, key, default=<object object>)
D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
If key is not found, d is returned if given, otherwise KeyError is raised.
popitem(self)
D.popitem() -> (k, v), remove and return some (key, value) pair
as a 2-tuple; but raise KeyError if D is empty.
setdefault(self, key, default=None)
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
update(*args, **kwds)
D.update([E, ]**F) -> None.  Update D from mapping/iterable E and F.
If E present and has a .keys() method, does:     for k in E: D[k] = E[k]
If E present and lacks .keys() method, does:     for (k, v) in E: D[k] = v
In either case, this is followed by: for k, v in F.items(): D[k] = v

Methods inherited from _abcoll.Mapping:
__eq__(self, other)
__ne__(self, other)
items(self)
D.items() -> list of D's (key, value) pairs, as 2-tuples
iteritems(self)
D.iteritems() -> an iterator over the (key, value) items of D
iterkeys(self)
D.iterkeys() -> an iterator over the keys of D
itervalues(self)
D.itervalues() -> an iterator over the values of D
keys(self)
D.keys() -> list of D's keys
values(self)
D.values() -> list of D's values

Data and other attributes inherited from _abcoll.Mapping:
__hash__ = None

Class methods inherited from _abcoll.Sized:
__subclasshook__(cls, C) from abc.ABCMeta

Data descriptors inherited from _abcoll.Sized:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from _abcoll.Sized:
__metaclass__ = <class 'abc.ABCMeta'>
Metaclass for defining Abstract Base Classes (ABCs).
 
Use this metaclass to create an ABC.  An ABC can be subclassed
directly, and then acts as a mix-in class.  You can also register
unrelated concrete classes (even built-in classes) and unrelated
ABCs as 'virtual subclasses' -- these and their descendants will
be considered subclasses of the registering ABC by the built-in
issubclass() function, but the registering ABC won't show up in
their MRO (Method Resolution Order) nor will method
implementations defined by the registering ABC be callable (not
even via super()).

 
class Group(_abcoll.MutableMapping)
    Wrapper for h5py.Group, using serialization for objects that normally
would not be able to be stored in a HDF5 file.
 
 
Method resolution order:
Group
_abcoll.MutableMapping
_abcoll.Mapping
_abcoll.Sized
_abcoll.Iterable
_abcoll.Container
__builtin__.object

Methods defined here:
__contains__(self, name)
__delitem__(self, key)
__getitem__(self, key)
__init__(self, h5group, pickle=True, unpickle=True, return_value=True)
__iter__(self)
__len__(self)
__repr__(self)
__setitem__(self, key, obj)
copy(self, source, dest, name=None)
create_dataset(self, name, shape=None, dtype=None, data=None, **kwargs)
create_group(self, name)
get(self, name, default=None, getclass=False, getlink=False)
require_dataset(self, name, shape, dtype, exact=False, **kwargs)
require_group(self, name)
visit(self, func)
visititems(self, func)

Data and other attributes defined here:
__abstractmethods__ = frozenset([])
__created__ = '2013-07-07'
__modified__ = '2013-07-07'

Methods inherited from _abcoll.MutableMapping:
clear(self)
D.clear() -> None.  Remove all items from D.
pop(self, key, default=<object object>)
D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
If key is not found, d is returned if given, otherwise KeyError is raised.
popitem(self)
D.popitem() -> (k, v), remove and return some (key, value) pair
as a 2-tuple; but raise KeyError if D is empty.
setdefault(self, key, default=None)
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
update(*args, **kwds)
D.update([E, ]**F) -> None.  Update D from mapping/iterable E and F.
If E present and has a .keys() method, does:     for k in E: D[k] = E[k]
If E present and lacks .keys() method, does:     for (k, v) in E: D[k] = v
In either case, this is followed by: for k, v in F.items(): D[k] = v

Methods inherited from _abcoll.Mapping:
__eq__(self, other)
__ne__(self, other)
items(self)
D.items() -> list of D's (key, value) pairs, as 2-tuples
iteritems(self)
D.iteritems() -> an iterator over the (key, value) items of D
iterkeys(self)
D.iterkeys() -> an iterator over the keys of D
itervalues(self)
D.itervalues() -> an iterator over the values of D
keys(self)
D.keys() -> list of D's keys
values(self)
D.values() -> list of D's values

Data and other attributes inherited from _abcoll.Mapping:
__hash__ = None

Class methods inherited from _abcoll.Sized:
__subclasshook__(cls, C) from abc.ABCMeta

Data descriptors inherited from _abcoll.Sized:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from _abcoll.Sized:
__metaclass__ = <class 'abc.ABCMeta'>
Metaclass for defining Abstract Base Classes (ABCs).
 
Use this metaclass to create an ABC.  An ABC can be subclassed
directly, and then acts as a mix-in class.  You can also register
unrelated concrete classes (even built-in classes) and unrelated
ABCs as 'virtual subclasses' -- these and their descendants will
be considered subclasses of the registering ABC by the built-in
issubclass() function, but the registering ABC won't show up in
their MRO (Method Resolution Order) nor will method
implementations defined by the registering ABC be callable (not
even via super()).

 
Data
        __created__ = '2013-07-07'
__modified__ = '2013-07-18'
__version__ = '0.1'