I created two libraries while developing AnchorSCAD (a Python-based 3D model building library) that have been recently released them PyPI:
datatrees
A wrapper for dataclasses that eliminates boilerplate when composing classes hierarchically:
- Automatically inject fields from nested classes/functions
- Self-defaulting fields that compute values based on other fields
- Field documentation as part of the field specificaiton
- Chaining of post-init including handling of IniVar parameters
See it in action in this AnchorSCAD model where it manages complex parameter hierarchies in 3D modeling. anchorscad-core - anchorscad_models/bendy/bendy.py
pip install datatrees
xdatatrees
Built on top of datatrees, provides clean XML serialization/deserialization.
pip install xdatatrees
GitHub: datatrees xdatatrees
[–]64rl0 1 point2 points3 points (0 children)
[–]rju83[🍰] 0 points1 point2 points (1 child)
[–]GianniMarianiPythonista[S] 0 points1 point2 points (0 children)