adamringhede / py-dataclass-from-json

Generate python data classes from a JSON string

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

py-dataclass-from-json

Generate code for python data classes using example JSON.

This is useful when using a tool to decode json data to objects like https://pypi.org/project/dataclasses-json/

Example

Running the below command..

python fromjson.py Person <<< '{"name": "Adam"}'

... will produce the following output.

@dataclass
class Person():
    name: str

About

Generate python data classes from a JSON string


Languages

Language:Python 100.0%