extracts python models from json files
Project description
json to models
extracts python models from json files
usage
- input: ./json_data
pip install json-to-models
from json_to_models import JsonToModels
import glob, json
jtm = JsonToModels(root_name='Root')
for path in glob.glob(f'./json_data/*.json'):
print(path)
with open(path) as f:
data = json.load(f)
jtm.extract_models(data)
jtm.write_models()
- output: models.py
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
json_to_models-0.0.4.tar.gz
(2.4 kB
view hashes)
Built Distribution
Close
Hashes for json_to_models-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2598288c9014ff85d6e74776270d5e03433eea13f59d4579699ed50716aafcd |
|
MD5 | 2313d82db6167cafa65d35abe7561311 |
|
BLAKE2b-256 | 95f5843cb22560da6890769194161e87e1fa1f0abc8b3f035b902692f47951f7 |