Skip to main content

Base class with serialization helpers for user-defined Python objects

Project description

`|Build Status| <https://travis-ci.org/hammerlab/serializable>`_

serializable
============

Base class with serialization methods for user-defined Python objects

Usage
-----

Classes which inherit from ``Serializable`` are enabled with default
implementations of ``to_json``, ``from_json``, ``__reduce__`` (for
pickling), and other serialization helpers. A derived class must either
have a member data matching the name of each argument to ``__init__``
or, alternatively, must provide a user-defined ``to_dict()`` method
which returns a dictionary whose keys match the arguments to
``__init__``.

Limitations
-----------

- Serializable objects must inherit from ``Serializable``, be tuples or
namedtuples, be serializble primitive types such as dict, list, int,
float, or str.

- The serialized representation of objects relies on reserved keywords
(such as ``"__name__"``, and ``"__class__"``), so dictionaries are
expected to not contain any keys which begin with two underscores.

.. |Build
Status| image:: https://travis-ci.org/hammerlab/serializable.svg?branch=master

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 serializable, version 0.0.8
Filename, size File type Python version Upload date Hashes
Filename, size serializable-0.0.8.tar.gz (7.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page