Serialize
*********

exception psynet.serialize.CallableSerializationError

   Bases: "ValueError"

   Raised when a callable cannot be serialized safely.

class psynet.serialize.DominateHandler(context)

   Bases: "BaseHandler"

   The DominateHandler class

   flatten(obj, state)

      Flatten *obj* into a json-friendly form and write result to
      *data*.

      Parameters:
         * **obj** (*object*) -- The object to be serialized.

         * **data** (*dict*) -- A partially filled dictionary which
           will contain the json-friendly representation of *obj* once
           this method has finished.

class psynet.serialize.NoJSONHandler(context)

   Bases: "BaseHandler"

   The NoJSONHandler class

   flatten(obj, state)

      Flatten *obj* into a json-friendly form and write result to
      *data*.

      Parameters:
         * **obj** (*object*) -- The object to be serialized.

         * **data** (*dict*) -- A partially filled dictionary which
           will contain the json-friendly representation of *obj* once
           this method has finished.

   restore(state)

      Restore an object of the registered type from the json-friendly
      representation *obj* and return it.

class psynet.serialize.PsyNetUnpickler(backend=None, keys=False, safe=True, v1_decode=False, on_missing='ignore', handle_readonly=False)

   Bases: "Unpickler"

   The PsyNetUnpickler class

class psynet.serialize.SQLHandler(context)

   Bases: "BaseHandler"

   The SQLHandler class

   flatten(obj, state)

      Flatten *obj* into a json-friendly form and write result to
      *data*.

      Parameters:
         * **obj** (*object*) -- The object to be serialized.

         * **data** (*dict*) -- A partially filled dictionary which
           will contain the json-friendly representation of *obj* once
           this method has finished.

   restore(state)

      Restore an object of the registered type from the json-friendly
      representation *obj* and return it.

class psynet.serialize.SerializedCallable(function, arguments)

   Bases: "object"

class psynet.serialize.SerializedCallableHandler(context)

   Bases: "BaseHandler"

   Store a saved callback's function by import path, keeping class
   methods bound.

   flatten(obj, state)

      Flatten *obj* into a json-friendly form and write result to
      *data*.

      Parameters:
         * **obj** (*object*) -- The object to be serialized.

         * **data** (*dict*) -- A partially filled dictionary which
           will contain the json-friendly representation of *obj* once
           this method has finished.

   restore(state)

      Restore an object of the registered type from the json-friendly
      representation *obj* and return it.

psynet.serialize.callable_from_path(path)

   Load a supported callable from its import path.

psynet.serialize.callable_to_path(function)

   Return the import path for a supported function or class method.

psynet.serialize.load_class(path)

   Load a class from its import path, or return "None", as "loadclass"
   does.

psynet.serialize.prepare_class_method_for_serialization(function, arguments)

   Prepares a class method for serialization by jsonpickle. This is
   necessary because jsonpickle can't serialize class methods
   directly. Instead, we serialize the underlying function.

psynet.serialize.prepare_instance_method_for_serialization(method_caller, method_name, arguments)

   Prepares an instance method for serialization by jsonpickle. This
   is necessary because jsonpickle can't serialize instance methods
   directly. Instead, we turn it into an ordinary function where
   "self" is an argument.

psynet.serialize.serialize_callable(callable_obj, context)

   Serialize a callable with centralized validation and error
   messaging.
