Serialize a JSON file to a hierarichal file structure of folders (representing arrays and objects) and text files (representing all other values).
The rules for serialization may seem fairly intuitive.
All collections (objects and arrays) are serialized into folders. The members of that object are stored in files or folders that correspond to their index, in the case of arrays, or their key, in the case of objects.
All non-collection values are written to a ".txt" file.
I have a project where something very similar to this type of serialization is necessary. I couldn't find any example of a tool that does this, which is kind of surprising.
In the example folder, there's a Jupyter Notebook calle Notebook.ipynb, and a corresponding "notebook-exploded" folder that contains the exploded representation of this notebook. (Notebooks are JSON files under the hood.)
This example was generated by running:
python explode_json/tool.py example/notebook.ipynb example/notebook-exploded
This is just a quick proof of concept. I intend to make this a pip installable package and also make a de-serializer that goes from a folder back to a single JSON file.