Skip to content

libraries

ralexrivero edited this page Nov 7, 2021 · 3 revisions

libraries

cmd

json

sys

os


cmd

json

Serialization with Python's json module is straightforward.

The process of serializing an object is called serialization, and the process of deserializing an object is called deserialization.

In python we use the json module to serialize and deserialize objects.

The computer works with binary data, so we need to encode our data into a format that the computer can understand.

Higer level data structures like lists, dictionaries, set and tuples can be transfered into a secuence of bits with the json module.

Serialization is present when passing data between programs or when storing data to disk and database.

There are many serializations formats like JSON, YAML, HD5, TOML Or pickle. The chosen one for this project and to extend a explanation is JSON using the Python programming language.

Why we need to serialize and deserialize data?

Because we need to store data in a format that the computer can understand in a sequence of bytes, in the other side is deserialization, thats convert the data back into a high level to abstract that computer code into data types that a human can undestand.

Design and document data

Before starting the serialization, we need to design and document the data that we want to store. Been aware about wath are the objects, their properies and limitations. And how to validaten them.

We must asume that the data is valid, and we must be able to validate it.

avoid tuples

JSON dont cover tuples, so we need to convert them into lists.

custom side bar

Clone this wiki locally