/pyhessian2

a python implementation of hessian 2.0

Primary LanguagePythonMIT LicenseMIT

pyhessian2 is implemented for serialize and deserialize data in hessian2 protocol.

Note, there are some significant differences between the master and 3.1.5 branch:

Usage

Encoding


from pyhessian2 import HessianObject, Encoder
attrs = {
    "name": "xx",
    "age": 20,
}
obj = HessianObject("com.xx.person", attrs)
data = Encoder().encode(obj)
print "%r" % data

Decoding


from pyhessian2 import Decoder
data = ...  # a hessian bytes data
obj = Decoder().decoder(data)  # get a Hessianobject instance
print obj  # print json serialized data