山药YAml元绑定微框架为YAML文档定义架构,如SQLAlchemy,以像Python对象一样读取、写入和操作数据。基本示例:
from yamb import Literal , Nested , Collection , YAMBObject
class Address ( YAMBObject ):
city = Literal ( default = 'New York' )
street = Literal ()
class Person ( YAMBObject ):
name = Literal ()
phone = Literal ()
address = Nested ( Address )
def lives_close_to ( self , another_person ):
pass
暂无评论