Skip to main content

RWA-python

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)
hdf5.close()

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

Introduction

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:

hdf5_not_storable(type(unserializable_object))

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

Installation

Python >= 3.6 is required. RWA-python may still work with Python 2.7 and 3.5 but support has been dropped.

Windows users should favor Conda for installing RWA-python, as Conda will seamlessly install the HDF5 standard library which is a required dependency.

For other users, 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. Note that most package managers include this library.

The RWA-python package can also be installed using Conda:

conda install rwa-python -c conda-forge

or poetry:

poetry add rwa-python

See also

RWA-python is on readthedocs.

Release files for rwa-python 0.10

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

Source distribution (sdist)

Source distribution for rwa-python 0.10
File Size Uploaded
rwa_python-0.10.tar.gz 31.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rwa-python 0.10
File Interpreter ABI Platform
rwa_python-0.10-py3-none-any.whl Python 3 none any Details

Total release size: 65.5 kB

Release files / rwa_python-0.10.tar.gz

Download URL rwa_python-0.10.tar.gz
Size 31.1 kB
Tags Source
SHA-256 checksum
How to use checksums
57eb9f36aa800ecf83927a684044c99716e4930ed3d3c8a5bb52fac73448e233
BLAKE2b-256 checksum
How to use checksums
7dda0271c8de7c9e5e4c55b36cb5b2d127d3b79a6eddd6fa3b91d32663d414f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release files / rwa_python-0.10-py3-none-any.whl

Download URL rwa_python-0.10-py3-none-any.whl
Size 34.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eea46d3b447ab63a43784a758881a081362826232dedb4680de8548badee45c3
BLAKE2b-256 checksum
How to use checksums
927898fc086382a4e1b4c8ff67c30a0c3a08f8f184bd80d2597fd6dd84feb364
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release history Release notifications | RSS feed

This release

0.10 This release

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.5

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8

2 release files

0.7.5

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7

2 release files

0.6

2 release files

0.5.1

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

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