Database-Linked Dataclasses
The most common use of a class in Python is acting as a data container. Throughout the development of our backend libraries at Narrative Science, we’ve seen several generations of code that attempts to make modeling this data easy.
Finding a simple to use abstraction for these type of classes allows us to focus less on writing mundane classes and more on our business logic.
In this post we will outline the evolution of this code and the pros and drawbacks of each approach.