Skip to content

Explode a JSON file to a hierarchical file structure that mirrors the data.

Notifications You must be signed in to change notification settings

jakekara/explode-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

explode-json

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.

Why?

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.

Example

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

TODO

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.

About

Explode a JSON file to a hierarchical file structure that mirrors the data.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published