Create connection using config file | Teradata Package for Python - Create connection using config file - Teradata Package for Python

Teradata® Package for Python User Guide

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Teradata Package for Python
Release Number
20.00
Published
March 2025
ft:locale
en-US
ft:lastEdition
2025-11-06
dita:mapPath
nvi1706202040305.ditamap
dita:ditavalPath
plt1683835213376.ditaval
dita:id
rkb1531260709148
Product Category
Teradata Vantage

create_context() can establish the connection to Vantage using the configuration file.

Example 1

Create context from config file with name 'td_properties.cfg' available under current working directory.

The content of the config file must be in the following format:

host=tdhost
username=tduser
password=tdpassword
temp_database_name=tdtemp_database_name
logmech=tdlogmech
logdata=tdlogdata
database=tddatabase
>>> td_context = create_context()

Example 2

Create context from config file with name 'td_config.cfg' which is saved under '/secrets/user' directory.

>>> td_context = create_context(config_file='/secrets/user/td_config.cfg')