Based off digging through the source code for sqlalchemy, the correct way to do this is to set the username
property (not the database
property) of the sqlalchemy.engine.url.URL
to your TNS alias for your wallet.
With sqlalchemy.engine.url.make_url
import sqlalchemy.engine.url
url = url.make_url('oracle+cx_oracle://')
url.username = '/@PROD'
engine = create_engine(url)
With sqlalchemy.engine.url.URL
import sqlalchemy.engine.url
url = url.URL('oracle+cx_oracle', username='/@PROD')
engine = create_engine(url)
This is because ultimately, for cx_Oracle to use an Oracle Wallet, you must use the user
parameter in cx_Oracle.connect
.
e.g.
import cx_Oracle
connection = cx_Oracle.connect(user='/@PROD')
# Because the first parameter in connect is user, the following is also valid
# connection = cx_Oracle.connect('/@PROD')