Introduction to JSON

JSON is a popular language-independent data format. It has become the de facto standard for communication of web applications today. It is a light-weight human readable data format.

JSON handling is supported by many programming languages such as python, javascript and so on. See Extracting JSON with Mammoth to learn how to deal with JSON using Mammoth.

A JSON can be one of the following:

  1. lists: List of values. For example, [1, 2, 3]

  2. dictionaries: Key value pairs. For example {"name": "Alice", "score": 129}

  3. numbers: For example, 10, -23, 33.52

  4. text values: For example: “Mountains”, “Zebrafish”

  5. truth values: Boolean values true & false

  6. null: Empty value

JSON is a very flexible data format. It can be used to nest lists and dictionaries.

Following JSONs are valid.

  1. Simple list of numbers.

[10, 20]
  1. Simple list of text.

["Alice", "Bob"]
  1. Key value pairs.

{"Alice": 30, "Bob": 28}
  1. List of Key value pairs.

[
   {"name": "Alice", "Score": 30},
   {"name": "Alice", "Score": 28}
]
  1. A dictionary where the values are lists.

{
  "names": ["Alice", "Bob", "Claire"],
  "scores": [23, 56, 19]
}
  1. JSON can also be very unstructured, although very rarely.

[
  {
    "keys": ["Alice", "Bob", "Claire"],
    "vals": [23, 56, 19, {"Score": 12}]
  },
  2, "George", [1, 23, "ABC"]
]

As depicted above in the examples, JSON is a flexible data-format for web applications.

See also

Extract JSON

Learn how to extract JSON using Mammoth.

JSON official site.

Contains the official spec for JSON

JSON - Wikipedia

History of JSON, Syntax, examples etc.