编写json的艺术
justif的Python项目详细描述
安装
此项目仅支持python3版本python2支持可能会在upcomming版本中出现
通过PIP
# if under linux machiene pip3 install justify # if under windows pip install justify
通过Github
#cloning git repo git clone git@github.com:AngrySoilder/json-justify.git cd json-justify python3 setup.py install
基本用法
json_justify的基本用法如下所示,它用于验证来自源的数据
fromjson_justifyimportJsonManagerfromjson_justify.fieldsimportString,Number,Boolean,ArrayclassJs(JsonManager):name=String("name")age=Number("age")male=Boolean("male")friends=Array("friends")data={"name":"john doe","age":120,"male":False,"friends":["Jelly","Kelly"]}# This will return Truejs=Js(data=data)data.is_valid()
贡献
我们欢迎您的贡献,我们非常感谢您的贡献!每 一点点帮助,功劳就会一直得到。
报告错误
在https://github.com/AngrySoilder/json-justify/issues
如果您报告了一个错误,请包括:
- 您的操作系统名称和版本。
- 有关本地设置的任何有助于故障排除的详细信息。
- 如果可以,请提供详细的步骤来重现错误。
- 如果您没有步骤来重现错误,只需在 尽可能多的细节。开始讨论这个问题的问题 很受欢迎。
提交反馈
发送反馈的最佳方式是在 https://github.com/AngrySoilder/json-justify/issues
如果您提出一项功能:
- 详细解释它的工作原理。
- 尽量缩小范围,以便于实施。
- 记住这是一个志愿者驱动的项目 欢迎使用:)