Serialize and deserialize python object

Signed-off-by: Diyan Yordanov <diyordan@cisco.com>