Define your JSON schema as Python dataclasses

codecov
Build Status

Define your JSON schema as Python dataclasses

Installation

pip install nvelope

The problem it solves

This is basically sommething like JSON-schema, but it works
with static type checking, since the classes you define are just regular
python dataclasses which can (and should) be type checked with mypy library.

It also lets not to just define the structure of your JSON data in a
single place in your
python code, but also to define
custom checks and conversions from/to JSON for any type you want.

Original use case

Say you have two
microservices communicating via JSON messages, both written in python.

You may define a shared package with the messages definition
and use

 

 

 

To finish reading, please visit source site