Skip to main content

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)

Uploaded Source

Built Distribution

jsonpython-0.0.5-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page