Usage#

Installation#

To use PyStarburst, first install it using pip:

(.venv) $ pip install pystarburst

Minimal supported Python version is 3.9.

In order to connect to running Starburst cluster and execute first query run (replace host, port, user and password):

import trino
from pystarburst import Session
db_parameters = {
    "host": "<host>",
    "port": "<port>",
    "http_scheme": "https",
    # Setup authentication through login or password or any other supported authentication methods
    # See docs: https://github.com/trinodb/trino-python-client#authentication-mechanisms
    "auth": trino.auth.BasicAuthentication("<user>", "<password>")
}
session = Session.builder.configs(db_parameters).create()
session.sql("SELECT * FROM system.runtime.nodes").collect()