
Learn what CBOR is and how it compares to JSON, then build a Python API that supports both formats and benchmark payload size, serialization, and deserialization times.
Install and set up visual studio code to edit python scripts for this course, choosing the correct os version and completing download and installation.
Learn how to install Python from the official site, download version 3.12.4, complete the setup, and verify the installation with python --version on your system.
Explore the definition and history of JSON, developed by Douglas Crockford as a lightweight data interchange format, and how JSON uses key-value pairs, objects, arrays, and primitive types.
Explore the basic JSON data types—strings, numbers, booleans, null, objects, and arrays—and learn how to leverage nested structures for effective data modeling in Python.
Develop a practical Python project to manage student data stored in a JSON file using CRUD operations.
Discover CBOR, the concise binary object representation designed for compactness and efficiency in data serialization, with history in RFC 7049 (2013) and features like flexibility and interoperability.
Explore the CBOR data types, including unsigned and negative integers, floating-point numbers, byte strings, text strings, arrays, maps, tags, and null.
Encode, decode, and manipulate CBOR data in Python using the cbor2 library. Learn to serialize and deserialize CBOR data to files, and work with nested structures.
Examine the data representation differences between CBOR and JSON, including strings (text and byte strings), numbers (integers and floating-point), booleans, null and undefined, arrays, maps, and tags.
Explore how CBOR and JSON are supported across languages, with Python, Java, C#, and JavaScript libraries like cbor2, GSON, Json.NET, Jackson, and cbor-js.
Set up a Flask-based Python API that handles JSON and CBOR data, with routes to get and post users in JSON and CBOR, forming a base for a future benchmark.
Test a Flask API using Postman to compare JSON and CBOR data formats, then set up and test JSON and CBOR routes, sending requests and verifying responses.
Compare JSON and CBOR in a Python API by capturing traffic with Wireshark, measuring response times, and highlighting data size and performance differences for GET and POST routes.
Conclude a practical Python API project by comparing JSON and CBOR routes using Postman and Wireshark, showing CBOR delivers faster responses and smaller messages for efficient bandwidth.
This course is designed for beginner programming students, especially those learning Python. The goal is to provide a comprehensive understanding of two important data formats: JSON and CBOR.
Key Topics Covered:
What is JSON:
Definition and structure of JSON
How and why JSON is widely used for data interchange
Why JSON is Used:
Advantages and use cases of JSON
Practical examples of applications that use JSON
What is CBOR:
Definition and structure of CBOR
Introduction to CBOR as an efficient binary format
Why Use CBOR:
Advantages and benefits of CBOR compared to other data formats
Examples of scenarios where CBOR is more suitable than JSON
Differences Between JSON and CBOR:
Detailed comparison between the two formats
Analysis of the advantages and disadvantages of each
Practical Project:
As part of the course, you will develop a Python API with routes that use both JSON and CBOR. Using Wireshark, we will perform practical comparisons between the two approaches, measuring response times and analyzing the efficiency of each format.
What You Will Learn:
How to structure and manipulate data in JSON and CBOR
Best practices for using these data formats in your applications
How to develop and test a Python API that supports multiple data formats
Tools and techniques for analyzing and optimizing data interchange performance
Why Take This Course:
This course will not only provide theoretical knowledge about JSON and CBOR but also offer valuable practical experience, preparing you to apply this knowledge to real-world projects. By the end of the course, you will have a clear understanding of the differences between JSON and CBOR and know how to choose the most suitable format for your needs.