SQLAlchemy supports creating an engine to wrap a cx_Oracle connection, without having to attempt to translate the connection string into a form supported by SQLAlchemy. This is good for normal SQLAlchemy code and also for using it to pull data using pandas. Here it is in use:
import pandas as pd
from sqlalchemy import create_engine
import cx_Oracle
connection_string = 'user/pass@//host:port/name'
conn_factory = lambda: cx_Oracle.connect(connection_string)
engine = create_engine(
"oracle://",
creator=conn_factory
)
pd.read_sql("select sys_context('userenv', 'current_schema') as schema from dual", engine)