def deliver_dictionary( self, dictionary_to_json, dictionary_to_pickle, project_name ): """ Write the dictionary as a pickle and as a json file """ ## write the current dict to a pickle file to compare next scrape ## The pickle file is used in the process_project_url method. ## This is a little sloppy, as the pickle directory is also defined ## separately in self.pickle_project_filename try: os.makedirs( "pickle" ) except OSError as e: if e.errno != errno.EEXIST: raise temp_file = open(self.pickle_project_filename, "w") pickle.dump( dictionary_to_pickle, temp_file ) temp_file.close() ## Dump data into a unique json in the data/project_name directory ## Please Note: The results of the "data/"+project_name string. JsonExport.write( dictionary_to_json, project_name, "data/"+project_name ) return ()
def standalone_writer( extracted_data_dict ): """ The FINAL part of the standalone functions for this code. This will be automatically used if the function at the bottom is called to tool out a new parser. Otherwise, no changes here do anything. """ import JsonExport ## Make sure JsonExport.py is available in this directory... JsonExport.write( extracted_data_dict, "standalone_parse", "standalone_parse" )
def object_exporter ( json_db_dict, project_name ): JsonExport.write( json_db_dict, project_name, project_name ) ##### cannot find this method's documentation. why does it require project name fro two separate arguments. does it creat a python dictionary? return
def object_exporter ( json_db_dict, project_name ): JsonExport.write( json_db_dict, project_name, project_name ) return