Skip to content
Thor Whalen edited this page Sep 7, 2021 · 1 revision

cattrs

Found this article that compares attrs to pydantic.

I think it's relevant in itself to the many of our designs, but the main reason I mention this is because it's where I found cattrs.

It brings forth a new term that I might start using: structuring/unstructuring -- I like it because saying serializing/unserializing always bothered me since it can be confused with persistence and carries the "serial" legacy of mapping to bytes.

Here, cattrs states clearly that:

cattrs is an open source Python library for structuring and unstructuring data. cattrs works best with attrs classes, dataclasses and the usual Python collections, but other kinds of classes are supported by manually registering converters.

This separation of the structuring concern is something that bothered me in many of the would-have-helped packages I peeped into to help with the py2json problem (and really py2dataobjicanstoreorsend in general).

Clone this wiki locally