Server-Side Scripting/Key-Value Databases/Python (Flask)

app.py
"   return result

def country_exists(country): redis = redis_lib.Redis(host=HOST, db=DATABASE) return bool(redis.exists(country))

def insert_country(country, temperature): redis = redis_lib.Redis(host=HOST, db=DATABASE) redis.set(country, temperature)

def update_country(country, temperature): redis = redis_lib.Redis(host=HOST, db=DATABASE) redis.set(country, temperature)

def delete_country(country): redis = redis_lib.Redis(host=HOST, db=DATABASE) redis.delete(country)

if __name__ == "__main__": app.run(host='0.0.0.0', port=5000)

Try It

 * 1) Use Docker/Redis to run a Redis server.
 * 2) Use Docker/Flask and copy and paste the code above to run as the Flask application. Be sure to modify the Redis host address to match the address received by your Redis server.