Created
July 13, 2015 16:45
-
-
Save cindygis/0f5275754544c6ea84e4 to your computer and use it in GitHub Desktop.
Creates the folder structure for asset management GIS data. Must still be optimised
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
folder_assetarea = r"C:\Assets\AreaA" # The main folder for Area A | |
year = "2015" # The year to create the structure for | |
folder_year = os.path.join(fld_mun, year) | |
folder_list = [["conversion", ["cad_gis", "ftr_shp", "kml_gdb", | |
"pdf_jpg", "shp_gdb", "tbl_xls", | |
"xls_tbl",] "jpg_gis", "gps_gis", | |
"gis_cad"], | |
["data", ["recd", "sent"]], | |
["jpg", ["georef", "maps"]], | |
["mxd", ["site_mapbooks"]], | |
["pdf"], | |
["report", ["csv", "doc", "txt", "xls"]], | |
["workspace"]] | |
for fld in folder_list: | |
if len(fld) > 1: | |
for i in range(len(fld[1])): | |
subfolder_assetarea =os.path.join(folder_year, fld[0],fld[1][i]) | |
if os.path.exists(subfolder_assetarea): | |
print("Folder {} exists".format(subfolder_assetarea)) | |
else: | |
os.makedirs(subfolder_assetarea) | |
print("Created {}".format(subfolder_assetarea)) | |
else: | |
subfolder_assetarea = os.path.join(folder_year, fld[0]) | |
if os.path.exists(subfolder_assetarea): | |
print("Folder {} exists".format(subfolder_assetarea)) | |
else: | |
os.mkdir(subfolder_assetarea) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment