A package to deserialize and serialize json files.
Project description
Jsonpython
A package to deserialize and serialize json.
Installing:
pip install jsonpython
Example:
data.json
{
"name": "Alex",
"age": 23,
"car": {
"model": "Tesla X",
"cost": 40000,
"company": {
"name": "Tesla"
}
}
}
main.py
from src.jsonpython import *
jobj = get_json_object("data.json")
print(jobj['name']) # Alex
print(jobj['car']['model']) # Tesla X
class Company:
name: str
class Car:
model: str
cost: int
company: Company
class Person:
age: int
name: str
car: Car
person = get_class(Person, "data.json")
print(person.car.model) # Tesla X
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jsonpython-0.0.5.tar.gz
(3.9 kB
view hashes)
Built Distribution
Close
Hashes for jsonpython-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ef5d205b7e4871660ce2031def8947602eef48d5ff22d4d9f7a63c36ec507f1 |
|
MD5 | 02ebbace51b5c5e49432cd884c0059cc |
|
BLAKE2b-256 | 0f31614b5cd8f1631c18225f5b8d37d90d69e4832d4e03c9ff68f330a8956eb5 |