schematics Python数据结构验证框架

schematics简介

schematics,是Python的第三方库,内部结构类似于ORM类型的系统,可用于将类型组合到结构中,验证数据,并根据简单的描述转换数据的形状。

schematics实例

>>> from schematics.models import Model
>>> from schematics.types import StringType, URLType
>>> class Person(Model):
...     name = StringType(required=True)
...     website = URLType()
...
>>> person = Person({'name': u'Abc Defghijk',
...                  'website': 'http://example.example/abcdefghijk'})
>>> person.name
u'Abc Defghijk'

schematics Github统计数据

The BSD License

Github 2.6k stars

schematics安装命令

pip install schematics

schematics要求的Python版本

Schematics currently supports Python versions 2.7, 3.3, 3.4, 3.5, 3.6 and 3.7.

免责声明:内容编辑自网络,仅供参考,不保证正确性,不作任何决策依据!!以上数据皆截止于博文的写稿日期。


行业导航 / Python指南 :
























Copyright © 2022-2024 笨鸟工具 x1y1z1.com All Rights Reserved.