import os from sqlalchemy import create_engine user = os.environ['DB_USER'] password = os.environ['DB_PASSWORD'] host = os.environ['DB_HOST'] port = os.environ['DB_PORT'] database = os.environ['DB_DATABASE'] def get_connection(): return create_engine( url="mysql+pymysql://{0}:{1}@{2}:{3}/{4}".format( user, password, host, port, database ) )