ericpan64 / pydian-canvas-fork

Python framework for developer-friendly data interchange
MIT License
0 stars 0 forks source link

Look into using Pydantic under the hood #39

Closed ericpan64 closed 2 weeks ago

ericpan64 commented 5 months ago

Pydantic already solves many of the existing problems with #20 -- the main goal of the Pydian validation would be to make it easier to express some of the different rules and error cases (e.g. make it easier to slightly modify an existing model / set of rules)

E.g.

Could we get the best of both -- e.g. use Pydantic under the hood and make data models interoperable? Worth investigating further!

ericpan64 commented 5 months ago

A key use-case could be handling heavily-nested structures, and making it easier to express code and reduce the need for a bunch of custom middle classes

Look into: https://docs.pydantic.dev/latest/concepts/models/#dynamic-model-creation

From: https://stackoverflow.com/questions/63257839/best-way-to-specify-nested-dict-with-pydantic