You should take a look on
https://cx-oracle.readthedocs.io/en/latest/user_guide/connection_handling.html#establishing-database-connections
To use a wallet with cx_Oracle, you need first to configure the wallet, create the sqlnet.ora and tnsnames.ora files, and you need to use the dsn property
connection = cx_Oracle.connect(dsn="mynetalias", encoding="UTF-8")
Where mynetalias is the TNS entry in your tnsnames.ora
mynetalias =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = yourhost )(PORT = yourport))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = yourservicename)
)
)
Be sure to have the sqlnet.ora configured for using the wallet
WALLET_LOCATION =
(SOURCE =
(METHOD = FILE)
(METHOD_DATA =
(DIRECTORY = /your_wallet_path_directory)
)
)
SQLNET.WALLET_OVERRIDE = TRUE