Upgrade to Pro — share decks privately, control downloads, hide ads and more …

JSON

Avatar for Ranjitha M Ranjitha M
November 12, 2025
6

 JSON

JSON Basics

Avatar for Ranjitha M

Ranjitha M

November 12, 2025

Transcript

  1. Introduction to JSON Data Representation and Exchange Formats Dr. Ranjitha

    M Department of Computer Science Kristu Jayanti University, Bengaluru, India
  2. Overview • What is JSON? • History and Importance •

    Syntax and Structure • JSON Data Types • JSON vs XML • Parsing and Stringifying JSON • Applications and Examples
  3. What is JSON? • JSON stands for JavaScript Object Notation.

    • Lightweight data-interchange format. • Easy for humans to read and write. • Easy for machines to parse and generate. • Commonly used for web APIs and configuration files.
  4. Features of JSON • Text-based and language-independent. • Uses key-value

    pairs. • Supports nested structures. • Portable and easy to integrate. • Widely supported across programming languages.
  5. JSON Syntax Rules • Data is in name/value pairs. •

    Data is separated by commas. • Curly braces hold objects. • Square brackets hold arrays. Example: { "name": "John", "age": 25, "skills": ["Python", "C", "Java"] }
  6. JSON vs XML JSON: • Simpler syntax. • Less verbose.

    • Data-oriented. • Faster to parse. XML: • Markup language. • More complex and verbose. • Supports attributes and namespaces.
  7. Working with JSON in Python Example: import json # Convert

    Python dict to JSON x = {'name': 'Alice', 'age': 22} y = json.dumps(x) print(y) # Convert JSON to Python dict data = json.loads(y) print(data['name'])
  8. Applications of JSON • Web APIs and RESTful Services •

    Data Storage and Configuration Files • IoT and Mobile Applications • Database Communication (MongoDB, Firebase) • Data Serialization in Machine Learning
  9. Advantages of JSON • Lightweight and fast. • Easy to

    read and modify. • Widely supported in programming languages. • Ideal for data interchange between systems.
  10. Summary  • JSON is a universal data format for

    exchanging information.  • Easy to use, read, and parse.  • Plays a key role in modern web and mobile development.
  11. References • www.json.org • W3Schools JSON Tutorial • MDN Web

    Docs on JSON • Python Official Documentation (json module)