I have the following json file, it is read into python as a dictionary json.load(json_file)
{
"directory_structure":
{
"version": 1.0,
"folders":
{
"Documentation": "Documentation",
"Archive": "For_deposition",
"Model": "Model",
"Orthomosaic": "Orthomosaic",
"Project":
{
"Input_Data": "Input_Data"
},
"Tiles": "Tiles"
}
}
What I would like to do is to use this to build the directory structure as given under the "folders" key. I tried the following:
folders = directory_structure["folders"]
for dir in folders:
os.mkdir(dir)
But this gives me this where the Project and Input_Data folders will not be created:
Documentation
For_deposition
Model
Orthomosaic
{'Project': 'Project', 'Input_Data': 'Input_Data'}
Tiles
The folder structure I'm aiming for is, where the Input_Data folder is within the Project folder:
Documentation
For_deposition
Model
Orthomosaic
Project
-- Input_Data
Tiles
The json file can be changed if it is not optimal for this.