an implementation for hessian2


License
MIT
Install
pip install pyhessian2==1.2.1

Documentation

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