lightweight & declarative model/struct representation, work as you expected it to
from datetime import datetime
from april import Struct
class User(Struct):
_fields = ['name', 'age', 'birthday']
user = UserModel(name='lucy', age=20, birthday='2017-09-08')
user2 = UserModel(name='hey')
class VIP(User):
_fields = ['level']
vip = VIP(user, level=1)
vip.name == lucy
user2.age is None
tips:
april
usually works along with serialization library, such as marshmallow