What is the alternative of Jackson in python?
attrs + cattrs is very close for the task.
copy one cattr example here,
>>> import attr, cattr>>>>>> @attr.s(slots=True, frozen=True) # It works with normal classes too.... class C:... a = attr.ib()... b = attr.ib()...>>> instance = C(1, 'a')>>> cattr.unstructure(instance){'a': 1, 'b': 'a'}>>> cattr.structure({'a': 1, 'b': 'a'}, C)C(a=1, b='a')
but it's not as capable as Jackson, i've not yet been able to find a solution to map attribute between serialized json and deserialized python object.
I have the same problem and could not find anything suitable.So I wrote pyson
https://tracinsy.ewi.tudelft.nl/pubtrac/Utilities/wiki/pyson
It's still under development and I will add new features along the way.It's not ment to be a complete substitute for jackson as jackson is huge. I just implement what I need, in jackson style where possible.
I think the most similar option you will get in python ecosystem will be jsonpickle
although it's not as complete as complete Jackson.python engineers and users chose a different respectable perspective and that is using schema-less approaches to problems so typing oriented serialization libraries like Jackson doesn't have a strong equivalent in Python.