Jupyter Notebook

Jupyter Notebook is an interactive computing environment that allows users to create and share documents containing live code, equations, visualizations, and narrative text. It supports various programming languages, including Python, R, and Julia, among others. Jupyter Notebook is commonly used for data analysis, machine learning, scientific computing, and research.

Requirements

Connection

Get the necessary connection information for your cluster:

  • Host

  • Port

  • Username

  • Password (Personal Access Token)

  • Cluster uuid

  • Secure

To use e6data with classic Jupyter Notebook and Python, follow these instructions:

  1. Create a new notebook: in the classic Jupyter Notebook, on the Files tab, click New > Python 3 (ipykernel).

  2. Run the below command in the Jupyter Notebook paragraph,

pip install e6data-python-connector
  1. Run the below script in the paragraph with the information prefilled,

from e6data_python_connector import Connection

username = '<username>'  # Your e6data Email ID.
password = '<password>'  # Access Token generated in the e6data console.

host = '<host>'  # IP address or hostname of the cluster to be used.
database = '<database>'  # # Database to perform the query on.
port = <port>  # Port of the e6data engine.
catalog_name = '<catalog_name>'
cluster_uuid = '<cluster_uuid>'  # Specify cluster UUID
secure = True # Flag to use a secure channel for data transfer, default to False

conn = Connection(
    host=host,
    port=port,
    username=username,
    database=database,
    password=password,
    cluster_uuid=cluster_uuid,
    secure=secure
)
  1. To query data from e6 please use the below script,

query = """select * from <table>"""  # Replace with the query.

cursor = conn.cursor(catalog_name=catalog_name)
query_id = cursor.execute(query)  # The execute function returns a unique query ID, which can be use to abort the query.
all_records = cursor.fetchall()
for row in all_records:
   print(row)

TLS/HTTPS

e6data utilizes globally trusted certificates, ensuring that the host and port provided by the connection dialogue are adequate. Any e6data cluster necessitating authentication must also employ TLS/HTTPS. If adhering to globally trusted certificate best practices, utilize the cluster’s HTTPS URL in the connection string as detailed in the aforementioned steps. (Only required for TLS connectivity type of endpoints.)

Last updated