This package enables Python applications to connect to the Teradata Database.
This package implements the PEP-249 Python Database API Specification 2.0.
This package requires 64-bit Python 3.4 or later, and runs on Windows, macOS, and Linux. 32-bit Python is not supported.
For community support, please visit Teradata Community.
For Teradata customer support, please visit Teradata Customer Service.
Please note, this driver may contain beta/preview features ("Beta Features"). As such, by downloading and/or using the driver, in addition to agreeing to the licensing terms below, you acknowledge that the Beta Features are experimental in nature and that the Beta Features are provided "AS IS" and may not be functional on any machine or in any environment.
Copyright 2022 Teradata. All Rights Reserved.
- Features
- Limitations
- Installation
- License
- Documentation
- Sample Programs
- Using the Driver
- Connection Parameters
- COP Discovery
- Stored Password Protection
- Client Attributes
- Transaction Mode
- Auto-Commit
- Data Types
- Null Values
- Character Export Width
- Module Constructors
- Module Globals
- Module Exceptions
- Connection Methods
- Cursor Attributes
- Cursor Methods
- Type Objects
- Escape Syntax
- FastLoad
- FastExport
- CSV Batch Inserts
- CSV Export Results
- Change Log
Table of Contents links do not work on PyPI due to a PyPI limitation.
The Teradata SQL Driver for Python is a DBAPI Driver that enables Python applications to connect to the Teradata Database. The driver implements the PEP-249 Python Database API Specification 2.0.
The driver is a young product that offers a basic feature set. We are working diligently to add features to the driver, and our goal is feature parity with the Teradata JDBC Driver.
At the present time, the driver offers the following features.
- Supported for use with Teradata Database 14.10 and later releases. Informally tested to work with Teradata Database 12.0 and later releases.
- COP Discovery.
- Laddered Concurrent Connect.
- HTTPS/TLS connections with Teradata SQL Engine 16.20.53.30 and later.
- Encrypted logon using the
TD2,JWT,LDAP,KRB5(Kerberos), orTDNEGOlogon mechanisms. - Data encryption governed by central administration, or enabled via the
encryptdataconnection parameter. - Unicode character data transferred via the UTF8 session character set.
- Auto-commit for ANSI and TERA transaction modes.
- 1 MB rows supported with Teradata Database 16.0 and later.
- Multi-statement requests that return multiple result sets.
- Most JDBC escape syntax.
- Parameterized SQL requests with question-mark parameter markers.
- Parameterized batch SQL requests with multiple rows of data bound to question-mark parameter markers.
- Complex data types such as
XML,JSON,DATASET STORAGE FORMAT AVRO, andDATASET STORAGE FORMAT CSV. - ElicitFile protocol support for DDL commands that create external UDFs or stored procedures and upload a file from client to database.
CREATE PROCEDUREandREPLACE PROCEDUREcommands.- Stored Procedure Dynamic Result Sets.
- FastLoad and FastExport.
- The UTF8 session character set is always used. The
charsetconnection parameter is not supported. - No support yet for Recoverable Network Protocol and Redrive.
- Monitor partition support is not available yet.
The driver depends on the pycryptodome package which is available from PyPI.
Use pip install to download and install the driver and its dependencies automatically.
| Platform | Command |
|---|---|
| macOS or Linux | pip install teradatasql |
| Windows | py -3 -m pip install teradatasql |
When upgrading to a new version of the driver, you may need to use pip install's --no-cache-dir option to force the download of the new version.
| Platform | Command |
|---|---|
| macOS or Linux | pip install --no-cache-dir -U teradatasql |
| Windows | py -3 -m pip install --no-cache-dir -U teradatasql |
Use of the driver is governed by the License Agreement for the Teradata SQL Driver for Python.
When the driver is installed, the LICENSE and THIRDPARTYLICENSE files are placed in the teradatasql directory under your Python installation directory.
In addition to the license terms, the driver may contain beta/preview features ("Beta Features"). As such, by downloading and/or using the driver, in addition to the licensing terms, you acknowledge that the Beta Features are experimental in nature and that the Beta Features are provided "AS IS" and may not be functional on any machine or in any environment.
When the driver is installed, the README.md file is placed in the teradatasql directory under your Python installation directory. This permits you to view the documentation offline, when you are not connected to the Internet.
The README.md file is a plain text file containing the documentation for the driver. While the file can be viewed with any text file viewer or editor, your viewing experience will be best with an editor that understands Markdown format.
Sample programs are provided to demonstrate how to use the driver. When the driver is installed, the sample programs are placed in the teradatasql/samples directory under your Python installation directory.
The sample programs are coded with a fake database hostname whomooz, username guest, and password please. Substitute your actual database hostname and credentials before running a sample program.
| Program | Purpose |
|---|---|
| BatchInsert.py | Demonstrates how to insert a batch of rows |
| BatchInsertCSV.py | Demonstrates how to insert a batch of rows from a CSV file |