src/fetch.py
def write_json(self, data, name, directory=None):
        """
        given string data write it to file name in folder directory
        """
        if not directory:
            directory = "./templates/resources/"
        targetdirectory = os.path.join(self.project_path, directory)

        if not os.path.exists(targetdirectory):
            os.makedirs(targetdirectory)

        path = f"{targetdirectory}/{name}.json"

        with open(os.path.join(self.project_path, path), "w") as fh:
            fh.write(json.dumps(data, default=str, sort_keys=True, indent=4, separators=(",", ": ")))

        given string data write it to file name in folder directory
        
given string data write it to file name in folder directory
given string data write it to file name in folder directory
def write_json(self, data, name, directory=None):
        if not directory:
            directory = "./templates/resources/"
        targetdirectory = os.path.join(self.project_path, directory)
        if not os.path.exists(targetdirectory):
            os.makedirs(targetdirectory)
        path = f"{targetdirectory}/{name}.json"
        with open(os.path.join(self.project_path, path), "w") as fh:
            fh.write(json.dumps(data, default=str, sort_keys=True, indent=4, separators=(",", ": ")))
def write_json ( self , data , name , directory = None ) : if not directory : directory = "./templates/resources/" targetdirectory = os . path . join ( self . project_path , directory ) if not os . path . exists ( targetdirectory ) : os . makedirs ( targetdirectory ) path = f"{targetdirectory}/{name}.json" with open ( os . path . join ( self . project_path , path ) , "w" ) as fh : fh . write ( json . dumps ( data , default = str , sort_keys = True , indent = 4 , separators = ( "," , ": " ) ) )
given string data write it to file name in folder directory
given string data write it to file name in folder directory
"""
        given string data write it to file name in folder directory
        """
self
data
name
directory