xarray-schema icon indicating copy to clipboard operation
xarray-schema copied to clipboard

Serialize/ deserialize with cattrs

Open paiforsyth opened this issue 3 years ago • 1 comments

Cattrs (https://pypi.org/project/cattrs/) is a powerful library for automatic serialisation/ deserialisation of hierarchical data. It seems to me that it could be valuable to use it to implement the various to_json methods (for example https://github.com/carbonplan/xarray-schema/blob/2c56d6ad2d4650ab06b09383a3cdd0bea0988ed7/xarray_schema/dataset.py#L70).

paiforsyth avatar Apr 30 '22 20:04 paiforsyth

Thanks @paiforsyth for the suggestion. I'd love to see a proof of concept using cattrs if you (or anyone else) has time.

jhamman avatar Sep 14 '22 22:09 jhamman