Skip to content

Dogo6647/jsonbreak

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧩 jsonbreak

Breaks down large JSON files into a neat directory structure.

Usage

Place jsonbreak and/or jsonrebuild into your python project's folder and import their functions:

from jsonbreak.py import disassemble_json
from jsonrebuild.py import rebuild_json

Then, use the functions like so:

disassemble_json

disassemble_json(data, path, *, split_arrays=True/False)
  • data: The raw JSON data to be disassembled (JSON dump, not file path)
  • path: the path where to save the disassembled JSON directory structure

rebuild_json

rebuild_json(path)
  • path: The generated directory structure to reassemble.

rebuild_json returns a direct dump of the rebuilt json.

Directory structure example

Disassembling project.json from a Scratch 3 project produces something like:

src/
β”œβ”€β”€ customFonts
β”‚Β Β  β”œβ”€β”€ 0.json
β”‚Β Β  └── 1.json
β”œβ”€β”€ extensions
β”‚Β Β  β”œβ”€β”€ 0.json
β”‚Β Β  β”œβ”€β”€ 1.json
β”‚Β Β  β”œβ”€β”€ 2.json
β”‚Β Β  β”œβ”€β”€ 3.json
β”œβ”€β”€ extensionURLs
β”‚Β Β  └── index.json
β”œβ”€β”€ meta
β”‚Β Β  β”œβ”€β”€ index.json
β”‚Β Β  └── platform
β”‚Β Β      └── index.json
(...)

About

🧩 Python module to break down large JSON files into a neat directory structure.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages