json转实体类
Project description
jsonModel
python json数据转为实体类的工具
python版本
2.7 ~ 3.8
安装
包被上传到pypi
使用pip安装:
$ pip install jsonModel
使用方法
# 模型
class People:
name = None
age = None
# 引用
import jsonModel
data = '[{"name":"jack","age":13},{"name":"jone","age":21}]'
# json 转 实体类
res = jsonModel.loads(data, People)
# 实体类 转 json
jsonStr = jsonModel.dumps(res)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyjsonmodel-1.0.0.tar.gz
(3.1 kB
view hashes)
Built Distribution
Close
Hashes for pyjsonmodel-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a999c61a53bdf145258f5c40bb6b5a788cb722878e117658e1cbb912fcb9d964 |
|
MD5 | e63aebed1be60bc0db9e7c2972daa268 |
|
BLAKE2b-256 | 89ea84ca0a884a0c8091e7f2ba9112091964b0e42a4a7d4b7c7e455e561bd407 |