Skip to content

Understand complex JSON by viewing its "summarised" schema

Notifications You must be signed in to change notification settings

ijohn/json-summary

Repository files navigation

   _
  (_)___  ___  _ __        ___ _   _ _ __ ___  _ __ ___   __ _ _ __ _   _
  | / __|/ _ \| '_ \ _____/ __| | | | '_ ` _ \| '_ ` _ \ / _` | '__| | | |
  | \__ \ (_) | | | |_____\__ \ |_| | | | | | | | | | | | (_| | |  | |_| |
 _/ |___/\___/|_| |_|     |___/\__,_|_| |_| |_|_| |_| |_|\__,_|_|   \__, |
|__/                                                                |___/

Code style: black mypy: checked codecov

Ever wanted to view summary of a complex JSON? json-summary could help you.

Let's say you have the following JSON:

input_json = {
  "name": "John Doe",
  "height": 160.5,
  "age": 18,
  "friends": [
    {
      "name": "Jane Doe",
      "address": {
        "city": "Jakarta"
      }
    }
  ]
}

Feeding above JSON to json_summary.summarise() will give the following result:

from json_summary import summarise

result = summarise(input_json)

# result
# {
#   "name": "string",
#   "height": "number",
#   "age": "number",
#   "friends": [
#     {
#       "name": "string",
#       "address": {
#         "city": "string"
#       }
#     }
#   ]
# }

About

Understand complex JSON by viewing its "summarised" schema

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages