Python Teradatasql TDWallet

Connectivity
Connectivity covers the mechanisms for connecting to the Teradata Database, including driver connectivity via JDBC or ODBC.
Tourist

Python Teradatasql TDWallet

I'm working on a python script that connects to Teradata using teradatasql module, runs a very simple query and returns an output. Here's how I'm currently connecting in DEV. And it's working: 

with my.connect(None, host='whomooz', user='guest', password='password', tmode='TERA', logmech='LDAP') as con:

 

My question is, if I want to use TDWallet for this connect (we use tdwallet at our org for scripts connecting to TD) how can I achieve this?

 

Thanks

7 REPLIES 7
Teradata Employee

Re: Python Teradatasql TDWallet

Hi don_one99,

 

I think teradatasql python's module relies on JDBC which (unfortunately) doesn't support TDWallet.

But teradatasqlalchemy module relies on ODBC which supports TDWallet.

 

Edit : ok this is false information, please read corrections in the following posts by Fred & Tomnolan.

Teradata Employee

Re: Python Teradatasql TDWallet

The teradatasql module is native Python, but is similar to JDBC in that the available Stored Password Protection support relies on the TJEncryptPassword mechanism instead of TDWallet.

Teradata Employee

Re: Python Teradatasql TDWallet

@Fred is correct on all points:

  1. The teradatasql Python module does not use the Teradata JDBC Driver. It is a completely independent standalone Python module.
  2. The teradatasql Python module does not interoperate with Teradata Wallet.
  3. The teradatasql Python module offers Stored Password Protection that is compatible with the Teradata JDBC Driver, meaning that both drivers can share the same encrypted password files.

 

Documentation for the teradatasql Python module's Stored Password Protection feature is located here:

https://github.com/Teradata/python-driver#StoredPasswordProtection

Teradata Employee

Re: Python Teradatasql TDWallet

@WaldarThe teradatasqlalchemy Python module does not use ODBC.

The teradatasqlalchemy Python module uses the teradatasql Python module, and therefore teradatasqlalchemy uses the Stored Password Protection offered by teradatasql.

Teradata Employee

Re: Python Teradatasql TDWallet

Thanks @Fred and @tomnolan for the precisions.

 

Pretty sure one of my python program which use both SQL Achemy with teradata dialect also use TDWallet.

maybe it's an another (older) version of the dialect ?

Teradata Employee

Re: Python Teradatasql TDWallet

@Waldar 

 

sqlalchemy-teradata https://pypi.org/project/sqlalchemy-teradata/ is the older dialect that uses ODBC and optionally Teradata Wallet.

 

teradatasqlalchemy https://pypi.org/project/teradatasqlalchemy/ is the newer dialect that uses teradatasql and optionally Stored Password Protection.

Teradata Employee

Re: Python Teradatasql TDWallet

Thanks I was confused between those two.