cattrs
cattrs copied to clipboard
Composable custom class converters for attrs, dataclasses and friends.
* cattrs version: 23.2.0 * Python version: 3.10 * Operating System: macos 13.5.1 ### Description ``` >>> cattrs.structure({"a": 1, "b": 2}, List) ['a', 'b'] ``` I would expect it to...
Hi @Tinche! I really love the combination of attrs and cattrs; it is a great way to organize code! After having shot myself in the foot several times with pydantic,...
* cattrs version: 23.1.2 * Python version: 3.10.7 * Operating System: Ubuntu ### Description When working with generic attrs types with cattrs, I updated my version of attrs and it...
* cattrs version: 23.1.2 * Python version: 3.10 * Operating System: Ubuntu 22.04 ### Description For my project, [cachew](https://github.com/karlicoss/cachew), I've been trying to switch from using my custom serialization cold...
* cattrs version: 23.2.3 * Python version: 3.9 * Operating System: macOS ### Description I'm not sure if this idea has already come up somewhere, or if there's perhaps a...
* cattrs version: 23.2.3 * Python version: 3.11.5 * Operating System: Windows 10 ### Description I am trying to create a union type which uses an existing key to determine...
* cattrs version: v23.2.3 * Python version: 3.11.6 * Operating System: Ubuntu ### Description On previous cattrs versions, I used to structure and unstructure a lot of attrs classes that...
* cattrs version: 23.2.3 * Python version: Python 3.9.16 * Operating System: macOS Ventura 13.5.2 (22G91) ### Description I want to ultimately serialize an Enum (anywhere it appears in dataclasses)...
I want to use cattrs to structure dicts and other stuff to attrs. However, I am unhappy with the default behaviour that if attrs expects an `int`, `float`, `str`, `bool`...
* cattrs version: 23.1.2 * Python version: 3.10.7 * Operating System: Windows ### Description structuring with `include_subclasses` does not work properly when the union type is a direct field of...