The following code
import sqlalchemy as db sql_engine = db.create_engine( f\'mysql+mysqlconnector://{username}:{password}@{server}:{str(port)}/{database}