Skip to content

earthastronaut/classyjson

Repository files navigation

Classy Json

Classy json is the best friend to invite to the party. He knows how to check all the other json that comes in and class them up.

(Ok I had fun making this but actually you should use pydantic)

Quick Start

pip install classyjson

Create your objects with jsonschema definitions.

from classyjson import ClassyObject

class Config(ClassyObject):
    schema = {
        "properties": {
            "version": {"type": "string"},
            "verbosity": {"type": "integer"},
            "items": {"type": "array"}
        }
    }


config = Config({
    "version": "v1.0",
    "verbosity": 1,
    "items": [
        1, 2, 3
    ]
})

About

Python classes from Json schema

Resources

License

Stars

Watchers

Forks

Packages

No packages published