Python JSON examples. Encoding and Decoding to from JSON
- a_example.py: This module contains a sample of encoding and decoding json strings into python dictionaries, and from python dictionaries back to json strings.
- b_example.py: This module is similar to the previous one but it focuses more on the printing, and showing parts of the dictionary, and how to print it in a pretty way.
- c_example.py: This module is focusing on interncode() which divides the data into chunks that can be accessed in a loop.
- d_example.py: This module is about making a custom encoder and decoder for "complex" data. A data type that can't be serialized.
- e_example.py: This module is similar to the previous one but different data type, datetime data type.
- f_example.py: This module is the first exercise that you have to solve. The data contains both complex and datetime data types, you need to create a custom encoder and decoder for this data.
- g_example.py: This module is also an exercise with different data types (data,timedelta,timezone) that needs a different way of encoding and decoding.
- h_example.py: This module is the final exercise, it contains emailmessage, ipv4address, parseresult data types.
After solving exercises f-g-h files, You have to make test cases for your code. Its important to add test cases. Use pytest to make tests for your code and we will check them.
Also there will be discussion about your code. So questions (why did you do this instead of that...etc.) about your code so be prepared.