Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

HDF5-based serialization library for Python datatypes

Project description

RWA-python serializes Python datatypes and stores them in HDF5 files.

Code example

In module A referenced in sys.path:

class CustomClass(object):
        def __init__(self, arg=None):
                self.attr = arg

In module B:

from A import CustomClass
from rwa import HDF5Store

# make any complex construct
any_object = CustomClass((CustomClass('a'), dict(b=1)))

# serialize
hdf5 = HDF5Store('my_file.h5', 'w')
hdf5.poke('my object', any_object)

# deserialize
hdf5 = HDF5Store('my_file.h5', 'r')
reloaded_object = hdf5.peek('my object')


With Python3, RWA-python serialization is fully automatic for types with __slots__ defined or such that the __init__ constructor does not require any input argument.

The library generates serialization schemes for most custom types. When deserializing objects, it also looks for and loads the modules where the corresponding types are defined.

If RWA-python complains about a type that cannot be serialized, a partial fix consists of ignoring this datatype:


With Python2, the library requires explicit definitions in most cases. In addition, string typing is sometimes problematic. Non-ascii characters should be explicit unicode.


Python >= 2.7 or >= 3.5 is required.

pip should work just fine:

pip install --user rwa-python

pip install will install some Python dependencies if missing, but you may still need to install the HDF5 reference library.

See also

RWA-python is on readthedocs.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for rwa-python, version 0.8.5
Filename, size File type Python version Upload date Hashes
Filename, size rwa_python-0.8.5-py2.py3-none-any.whl (33.1 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size rwa-python-0.8.5.tar.gz (27.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page