Importing the Python connector - Amazon Redshift

Amazon Redshift will no longer support the creation of new Python UDFs starting November 1, 2025. If you would like to use Python UDFs, create the UDFs prior to that date. Existing Python UDFs will continue to function as normal. For more information, see the blog post .

Importing the Python connector

To import the Python connector, run the following command.

>>> import redshift_connector

To connect to an Amazon Redshift cluster using AWS credentials, run the following command.

conn = redshift_connector.connect( host='examplecluster.abc123xyz789.us-west-1.redshift.amazonaws.com', port=5439, database='dev', user='awsuser', password='my_password' )