def showoff_databases(): """ Here we illustrate basic interaction with nosql databases """ log = utilities.configure_logger('default', '../logs/nosql_dev.log') log.info( "\n\n\nMongodb example to use data from Furniture module, so get it.") furniture = learn_data.get_furniture_data() log.info("\n\n\nHere's the MongoDB script.") mongodb_script.run_example(furniture) log.info("Other databases use data embedded in the modules") log.info("\n\n\nHere's the Redis script.") redis_script.run_example() log.info("\n\n\nHere's the Neo4J script.") neo4j_script.run_example() log.info( "\n\n\nHere's the persistence/serialization (Pickle/Shelve) script.") simple_script.run_example(furniture)
def showoff_databases(): """ Here we illustrate basic interaction with nosql databases """ log = utilities.configure_logger('default', '../logs/nosql_dev.log') log.info("Mongodb example to use data from Furniture module, so get it") furniture = learn_data.get_furniture_data() roygbiv = ["Red", "Orange", "Yellow", "Green", "Blue", "Indigo", "Violet"] for item in furniture: product_type = item['product'] color_name = 'N/A' for color in roygbiv: if color in product_type: color_name = color product_type = product_type.replace(color, '').lstrip(' ') break item['color'] = color_name item['product type'] = product_type mongodb_script.run_example(furniture) log.info("Other databases use data embedded in the modules") redis_script.run_example() neo4j_script.run_example() simple_script.run_example(furniture) persistence_serialization.run_json()
def main(): log = utilities.configure_logger('default', '../logs/mailroom_neo4j.log') neo4j_script.run_example() action = 0 while action != 5: try: action = user_input() choices[action]() except KeyError: print("Please enter a valid response.")
def showoff_databases(): """ Here we illustrate basic interaction with nosql databases """ log = utilities.configure_logger('default', '../logs/nosql_dev.log') log.info("Mongodb example to use data from Furniture module, so get it") furniture = learn_data.get_furniture_data() # mongodb_script.run_example(furniture) log.info("Other databases use data embedded in the modules") # redis_script.run_example() neo4j_script.run_example()
def showoff_databases(): """ Here we illustrate basic interaction with nosql databases """ log = utilities.configure_logger('default', '../logs/nosql_dev.log') # New furniture data source furniture = new_data.get_furniture_data() persistence = movie_data.get_movie_data() log.info("Running MongoDB exercise") mongodb_script.run_example(furniture) log.info("Running Redis exercise") redis_script.run_example() log.info("Running Neo4J exercise") neo4j_script.run_example() log.info("Running persistence and serialization exercise") simple_script.run_example(furniture, persistence)
def run_db(): neo4j_script.run_example() add_people() add_colors() match_people_colors()